Commit graph

2060 commits

Author SHA1 Message Date
Ian Lance Taylor
b8520cf360 * coffgen.c (coff_real_object_p): Set obj_raw_syment_count.
(coff_get_normalized_symtab): Verify obj_raw_syment_count, rather
	than setting it.
1994-08-26 20:01:21 +00:00
Ian Lance Taylor
fc10f31e8b * archive.c (bsd_write_armap): Remove host dependencies. 1994-08-25 19:50:26 +00:00
Ian Lance Taylor
435b470ec3 * aoutx.h (add_to_stringtab): Check for _bfd_stringtab_add error
before adding BYTES_IN_WORD.
1994-08-25 18:56:11 +00:00
Ian Lance Taylor
6d04c6d475 * coffgen.c (coff_find_nearest_line): Look for the best C_FILE,
not merely the first.
1994-08-25 15:58:43 +00:00
Ian Lance Taylor
715cde57f8 * coffgen.c (coff_write_alien_symbol): If we are not using the
symbol, clear the name so that it is not put in the string table.
	From Antti.Miettinen@ntc.nokia.com.
1994-08-25 14:46:10 +00:00
Ian Lance Taylor
5a53b1c178 * coffgen.c (coff_print_symbol): Cast pointer different to long
and use %ld to print it.
	* osf-core.c (osf_core_core_file_p): Remove unused variable
	dseccnt.
	* ecoffswap.h (ecoff_swap_ext_out): If ECOFF_64, clear remaining
	bytes in bits2.
1994-08-24 21:17:40 +00:00
Ian Lance Taylor
073e795f5e * configure.host, config.bfd: Change i[34]86 to i[345]86. 1994-08-24 16:41:48 +00:00
Ian Lance Taylor
a74d15178f * coffgen.c (coff_real_object_p): Set obj_conv_table_size here,
rather than waiting until coff_slurp_symbol_table.
	(coff_write_alien_symbol): Just ignore BSF_DEBUGGING symbols.
	From Antti.Miettinen@ntc.nokia.com.
1994-08-24 16:32:40 +00:00
Ian Lance Taylor
d37002222d * section.c (bfd_make_section_anyway): Fix failure check of
bfd_make_empty_symbol.  From Antti.Miettinen@ntc.nokia.com.
1994-08-24 16:29:17 +00:00
Ian Lance Taylor
1afd2380ea * aoutx.h (translate_to_native_sym_flags): Use the output_section
(and output_offset) if there is one.

	* aoutx.h (aout_link_check_archive_element): Discard the symbols
	if the archive element was not needed.

	* aoutx.h (aout_get_external_symbols): Ensure that a zero string
	index yields an empty string.
	(aout_link_write_symbols): If info->keep_memory is false, use name
	from original hash table entry, not from entry in *sym_hash.

	* aoutx.h (struct aout_final_link_info): Add fields contents,
	relocs, symbol_map and output_syms.
	(NAME(aout,final_link)): Work out the largest section size, reloc
	size, and number of symbols.  Use them to preallocate buffers that
	are large enough for all cases.
	(aout_link_input_bfd): Use preallocated symbol_map.
	(aout_link_write_symbols): Remove symbol_map argument; use
	preallocated symbol_map instead.  Change all callers.  Use
	preallocated output_syms.
	(aout_link_input_section): Remove symbol_map argument.  Change all
	callers.  Use preallocated contents and relocs.
	(aout_link_input_section_std): Remove symbol_map argument; use
	preallocated symbol_map instead.  Change all callers.
	(aout_link_input_section_ext): Likewise.
1994-08-24 15:59:40 +00:00
Ian Lance Taylor
81eb52b34d * targets.c (BFD_JUMP_TABLE_ARCHIVE): Add _update_armap_timestamp.
(bfd_target): Add field _bfd_update_armap_timestamp.
	* bfd.c (bfd_update_armap_timestamp): Define.
	* bfd-in2.h: Rebuilt.
	* libbfd-in.h (_bfd_noarchive_update_armap_timestamp): Define.
	(_bfd_archive_bsd_update_armap_timestamp): Declare.
	(_bfd_archive_coff_update_armap_timestamp): Define.
	* libbfd.h: Rebuilt.
	* archive.c (_bfd_write_archive_contents): Call
	bfd_update_armap_timestamp instead of checking for a BSD archive
	and calling bsd_update_armap_timestamp.
	(_bfd_archive_bsd_update_armap_timestamp): Rename from
	_bsd_update_armap_timestamp.  Don't assume that armap_datepos is
	already set.
	* aout-target.h (MY_update_armap_timestamp): Define if not already
	defined.
	* coff-rs6000.c (rs6000coff_update_armap_timestamp): Define.
	* ieee.c (ieee_update_armap_timestamp): Define.
	* libecoff.h (_bfd_ecoff_update_armap_timestamp): Define.
	* oasys.c (oasys_update_armap_timestamp): Define.
	* som.c (som_update_armap_timestamp): Define.
1994-08-22 21:20:12 +00:00
Ian Lance Taylor
e914ed5219 * hash.c: Copy string hash functions from aoutx.h.
* aoutx.h: String hash functions moved to hash.c.  Retain
	simplified versions of add_to_stringtab and emit_stringtab.
	Change all callers to use new function and structure names.
	* libbfd-in.h (_bfd_stringtab_init, _bfd_stringtab_free): Declare.
	(_bfd_stringtab_size, _bfd_stringtab_add): Declare.
	(_bfd_stringtab_emit): Declare.
	* libbfd.h: Rebuilt.
1994-08-22 16:36:52 +00:00
Ian Lance Taylor
0ff4ca1eef Mon Aug 22 10:49:37 1994 Eric Youngdale (ericy@cais.cais.com)
* i386linux.c (linux_add_one_symbol): Create a fixup for any
	defined absolute symbol, not just GOT or PLT symbols.
	(linux_tally_symbols): Correct handling of references to defined
	symbols.
1994-08-22 15:00:26 +00:00
Ian Lance Taylor
f494527192 Get ld -x -r to handle a.out set symbols correctly.
* aoutx.h (adjust_o_magic): If the .bss VMA was set outside of
	BFD, pad the .data section up to the VMA of the .bss section.
	(aout_link_add_symbols): If a set symbol does not get modified,
	treat it as a local symbol.
	(aout_link_write_symbols): Set the value of set symbols
	correctly.  Don't discard set symbols even if discarding local
	symbols.
	(aout_link_write_other_symbol): Don't abort on bfd_link_hash_new,
	since it can now happen for set symbols.
1994-08-18 21:48:23 +00:00
Ian Lance Taylor
32c765539c * elfcode.h (elf_fake_sections): Just check for ".rela" and
".rel", not ".rela." and ".rel."; make this work by checking
	use_rela_p.
	* elf32-i386.c (elf_i386_check_relocs): Just check for ".rel", not
	".rel."
	(elf_i386_size_dynamic_sections): Likewise.
	(elf_i386_relocate_section): Likewise.
	* elf32-sparc.c (elf32_sparc_check_relocs): Just check for
	".rela", not ".rela."
	(elf32_sparc_size_dynamic_sections): Likewise.
	(elf32_sparc_relocate_section): Likewise.
1994-08-18 21:33:07 +00:00
Ian Lance Taylor
7cc5cc22bb * linker.c (_bfd_generic_link_add_archive_symbols): Initialize
PASS to the old value + 1.
1994-08-17 20:58:47 +00:00
Ian Lance Taylor
d83689d4de * coffgen.c (coff_get_normalized_symtab): If a C_FILE symbol has
no aux entries, use the symbol name as the file name.
	(coff_find_nearest_line): Look for the right C_FILE symbol, rather
	than always using the first one.  If there is a debugging symbol
	after a function symbol, skip it.  Add the section VMA to the line
	offset, since it was subtracted out in coff_slurp_line_table.
PR 5010.
1994-08-17 17:44:17 +00:00
Jeff Law
fde543b5ff * som.c (som_prep_headers): If writing some form of an executable,
allocate and attach an exec header to the BFD private data.
	(som_begin_writing): Don't fill fields of the exec header based
	on BFD private data here (like the exec flags).  Do not write
	the exec header here.
	(som_write_headers): Instead do it here.
	* som.h (struct somdata): New field "exec_hdr" for the executable
	file header.
	(obj_som_exec_hdr): New accessor macro.
1994-08-16 23:11:59 +00:00
Ian Lance Taylor
969ceea035 * i386linux.c (linux_link_create_dynamic_sections): Create section
named .linux-dynamic, not .dynamic.
	(linux_add_one_symbol): Use .linux-dynamic, not .dynamic.
	(bfd_linux_size_dynamic_sections): Likewise.
	(linux_finish_dynamic_link): Likewise.
1994-08-16 04:15:50 +00:00
Ian Lance Taylor
9fbe895ae7 * coffgen.c (STRING_SIZE_SIZE): Define.
(coff_fix_symbol_name): Use STRING_SIZE_SIZE, not 4.
	(coff_write_symbols, build_string_table): Likewise.
	(coff_get_normalized_symtab): Likewise.
1994-08-15 22:07:29 +00:00
Ian Lance Taylor
f07bb971a0 * libcoff-in.h (obj_symbol_slew): Don't define.
(struct coff_tdata): Remove unused fields index_slew, raw_linenos,
	and flags.
	* libcoff.h: Rebuilt.
	* coffcode.h (coff_mkobject): Don't initialize raw_linenos.
	(coff_mkobject_hook): Don't initialize flags.
1994-08-15 21:02:05 +00:00
Ian Lance Taylor
a932d0ffb7 * aout-target.h (MY_zmagic_contiguous): Define as 0 if not already
defined.
	(MY(backend_data)): Use MY_zmagic_contiguous, not hardcoded 0.
	* i386linux.c (MY_zmagic_contiguous): Define.
1994-08-15 18:12:05 +00:00
Ian Lance Taylor
823609fe90 * elfcode.h (bfd_section_from_shdr): If a SHT_SYMTAB section in a
shared object has SHF_ALLOC set, create a BFD section for it.
	(elf_section_from_bfd_section): There may be a BFD section for a
	SHT_SYMTAB section.
1994-08-15 18:08:13 +00:00
Ian Lance Taylor
e8fbe6d924 * coffcode.h (styp_to_sec_flags): Add name argument. If no flags
are recognized, chose section flags based on the name.
	(bfd_coff_backend_data): _bfd_styp_to_sec_flags_hook field: Add
	name argument.
	(bfd_coff_styp_to_sec_flags_hook): Add name argument.
	(coff_compute_section_file_positions): Don't adjust the section
	position by COFF_PAGE_SIZE unless SEC_ALLOC is set.
	* libcoff.h: Rebuilt.
	* coffgen.c (make_a_section_from_file): Pass section name to
	bfd_coff_styp_to_sec_flags_hook.
	* ecoff.c (_bfd_ecoff_styp_to_sec_flags): Add unused name
	argument.
	* libecoff.h (_bfd_ecoff_styp_to_sec_flags): Add name argument to
	prototype.
1994-08-15 16:26:06 +00:00
Ian Lance Taylor
e9227b4255 * elfcode.h (section_from_elf_index): Correct check for invalid
section index.
1994-08-12 23:25:23 +00:00
Ian Lance Taylor
1c640609d8 * elfcode.h (elf_link_add_object_symbols): If there is no symbol
table, try using the dynamic symbol table.  From Eric Youngdale
	<ericy@cais.cais.com>.
1994-08-12 15:51:09 +00:00
Ian Lance Taylor
098e8a89ec * configure.host (sparc-*-solaris2*): Use solaris2, not sysv4.
The linker depends upon configuring for solaris2.
	* hosts/solaris2.h: New file; include hosts/sysv4.h.
	* config/solaris2.mh: New file; copy of config/sysv4.mh.
1994-08-12 15:28:19 +00:00
Ian Lance Taylor
af76a6e052 Remove aout-ns32k.h. 1994-08-11 04:39:16 +00:00
Ian Lance Taylor
e1f99f6068 * aoutx.h (adjust_z_magic): Make sure data section is padded to
page boundary when the VMA is set by the calling program.  From
	Eric Youngdale <ericy@cais.cais.com>.
1994-08-10 17:15:05 +00:00
Stan Shebs
fb49a80173 Update to ns32k support, from Ian Dall (dall@hfrd.dsto.gov.au).
* aout-ns32k.c: Add declarations that were in aout-ns32k.h, change
	declarations to traditional form.
	(MY_reloc_howto, MY_put_reloc): Change from macro to function.
	(ns32k_relocate_contents): New function.
	* aout-ns32k.h: Remove.
	* cpu-ns32k.c: Add declarations that were in aout-ns32k.h, change
	declarations to traditional form.
	(ns32k_final_link_relocate): Call ns32k_relocate_contents.
	* netbsd532.c: Reformat to standards, add copyright notice.
	(ARCH): Don't define.
	(aout-ns32k.h): Don't include.
	* pc532-mach.c: Ditto.
1994-08-09 01:06:29 +00:00
Peter Schauer
f20860cdbc * irix-core.c (irix_core_core_file_p): Ignore sections that
are not contained in the core file.
1994-08-07 13:26:46 +00:00
Jean Marie Diaz
7432993954 Fix up namespace handling in last patch. 1994-08-04 19:59:27 +00:00
Jean Marie Diaz
8337ee9d51 * coff-m68k.c (_bfd_coff_m68k_reloc_type_lookup): New function.
(coff_bfd_reloc_type_lookup): Define.
1994-08-04 16:38:05 +00:00
Jean Marie Diaz
203778cee1 * elfcode.h (elf_bfd_final_link): Force the vma of sections which
do not have SEC_ALLOC set to be 0.  This is needed to handle
	relocs against debugging sections.
1994-08-04 16:10:23 +00:00
Jean Marie Diaz
1b8a11d430 * coff-i960.c (coff_i960_relocate): Rewrote to change relocs
against locally defined symbols into relocs against section
	symbols, for VxWorks 5.1.
1994-08-03 20:51:59 +00:00
Jean Marie Diaz
e696f6a9b9 Wed Aug 3 10:34:37 1994 Eric Youngdale (ericy@cais.cais.com)
* i386linux.c (linux_add_one_symbol): Only handle
	SHARABLE_CONFLICTS specially if BSF_CONSTRUCTOR is set.  Set hashp
	for a GOT or PLT symbol.  Set jump field of fixup for a PLT symbol.
	(linux_tally_symbols): Check section of real symbol.  When looking
	for a builtin fixup, check builtin and jump flags.  Create no more
	than one fixup, and always create one if the real symbol is in the
	absolute section.  Only strip absolute symbols.
1994-08-03 14:43:42 +00:00
David Henkel-Wallace
756b40d520 LynxOS changes 1994-08-03 13:45:11 +00:00
Jean Marie Diaz
b2ea35c7ab * hp300hpux.c (BMAGIC): Define as HPUX_DOT_O_MAGIC, to make test
in aoutx.h work correctly.
1994-08-02 19:16:36 +00:00
Jean Marie Diaz
5e694c29a5 * coff-i960.c (coff_i960_relocate): New function.
(howto_rellong, howto_iprmed): Use it as special_function.
1994-08-02 15:26:26 +00:00
Jean Marie Diaz
e0566e19aa * libbfd-in.h: Move declarations of bfd_read, bfd_write, bfd_seek,
bfd_tell, bfd_flush, and bfd_stat from here...
	* bfd-in.h: ...to here, to make them visible to programs which
	know more about the object file format than BFD does.
	* libbfd.h, bfd-in2.h: Rebuilt.
1994-08-02 14:48:21 +00:00
Jean Marie Diaz
e21679173e Forgot to check this in. 1994-08-01 23:45:51 +00:00
Jean Marie Diaz
df9e066f4b * elfcode.h (map_program_segments): Check DYNAMIC as well as EXEC_P.
(assign_file_positions_except_relocs): Likewise.
1994-08-01 23:37:22 +00:00
Jean Marie Diaz
4ab1f94712 * elf64-sparc.c (ELF_MAXPAGESIZE): Define. 1994-08-01 23:29:31 +00:00
Jean Marie Diaz
99dd775492 ELF linker patches from Eric Youngdale <ericy@cais.cais.com>.
* elfcode.h (elf_link_create_dynamic_sections): Set type of
	_DYNAMIC to STT_OBJECT.
	(NAME(bfd_elf,record_link_assignment)): Always create hash table
	entry.  Set type to STT_OBJECT.
	(elf_link_output_extsym): Don't set type of weak defined symbol to
	STB_WEAK if symbol was referenced.
	* elf32-i386.c (elf_i386_create_dynamic_sections): Set type of
	_GLOBAL_OFFSET_TABLE to STT_OBJECT.
	(elf_i386_check_relocs): Ignore local PLT32 relocs.
	(elf_i386_relocate_section): Treat local PLT32 relocs as PC32.
1994-08-01 23:11:18 +00:00
Jean Marie Diaz
287e3ce228 Mon Aug 1 17:55:53 1994 Fred Fish (fnf@cygnus.com)
* ptrace-core.c (ptrace_unix_core_file_p):  Convert zalloc usage
	to bfd_zalloc.
1994-08-01 22:00:19 +00:00
Ian Lance Taylor
30e5ad97e9 * elfcode.h (elf_adjust_dynamic_symbol): Correct weak symbol
handling again.
1994-08-01 20:53:48 +00:00
Ian Lance Taylor
f3817a52e5 * configure.host (sparc-*-solaris2*): Use sysv4, not solaris2.
* hosts/solaris2.h: Remove.
	* config/solaris2.mh: Remove.
1994-08-01 16:35:40 +00:00
Ian Lance Taylor
d510fd893a * elfcode.h (elf_slurp_reloc_table): Don't try to read the relocs
if there aren't any.
1994-08-01 16:34:09 +00:00
Ian Lance Taylor
abc61566c0 * configure.host (sparc-*-solaris2*): Use sysv4, not solaris2.
* hosts/solaris2.h: Remove.
	* config/solaris2.mh: Remove.
1994-08-01 16:16:47 +00:00
Jeff Law
58bbba79a2 * elf32-hppa.c, elf32-hppa.h: Update comment reflecting which
HPPA ELF spec the code implements.
1994-07-31 20:29:19 +00:00
Ken Raeburn
b5b056fc38 i960xl changes (sanitized) 1994-07-27 00:21:43 +00:00
Ken Raeburn
ffeef0bbcb (howto_rellong, howto_iprmed, howto_optcall): Use HOWTO macro. 1994-07-27 00:11:56 +00:00
Ken Raeburn
e26e4fbc0b i960xl sanitization; keep some more ns32k related files 1994-07-27 00:10:18 +00:00
Ian Lance Taylor
9a402d7ac5 * elfcode.h (elf_adjust_dynamic_symbol): When handling a weak
symbol, correct check to see whether the equivalent normal symbol
	was referenced.
1994-07-26 19:34:14 +00:00
Ian Lance Taylor
374d2ef905 Add support for creating shared libraries under i386 ELF and SPARC
ELF.  Based on patches by Eric Youngdale <ericy@cais.cais.com>.
	* libelf.h (struct elf_link_hash_entry): Remove copy_offset field.
	Add got_offset and plt_offset fields.
	(ELF_LINK_HASH_REF_DYNAMIC_MULTIPLE): Don't define.
	(ELF_LINK_HASH_DEF_DYNAMIC_MULTIPLE): Don't define.
	(ELF_LINK_HASH_NEEDS_COPY): Define.
	(struct elf_backend_data): Add check_relocs field.
	(struct bfd_elf_section_data): Change relocs from PTR to
	Elf_Internal_Rela *.
	(struct elf_obj_tdata): Add local_got_offsets field.
	(elf_local_got_offsets): Define accessor macro.
	(bfd_elf32_link_create_dynamic_sections): Declare.
	(bfd_elf32_link_record_dynamic_symbol): Declare.
	(bfd_elf64_link_create_dynamic_sections): Declare.
	(bfd_elf64_link_record_dynamic_symbol): Declare.
	* elfcode.h (elf_slurp_reloc_table): Don't use the section data
	relocs field.
	(elf_link_record_dynamic_symbol): Make globally visible.  Use
	macro to rename to NAME(bfd_elf,link_record_dynamic_symbol).
	(elf_link_add_object_symbols): If creating a shared library, put
	make all local symbols dynamic.  Don't bother with the
	DYNAMIC_MULTIPLE flags.  Call the check_relocs backend function if
	it is defined.
	(elf_link_create_dynamic_sections): Make globally visible.  Use
	macro to rename to NAME(bfd_elf,link_create_dynamic_sections).  If
	creating a shared library, make sure that _DYNAMIC is added as a
	dynamic symbol.
	(elf_link_read_relocs): New function.
	(NAME(bfd_elf,record_link_assignment)): If creating a shared
	library, always create symbols, and always make them dynamic.
	(elf_bfd_final_link): Permit creation of shared libraries.
	(elf_link_input_bfd): Use elf_link_read_relocs to get the relocs.
	* elf.c (_bfd_elf_link_hash_newfunc): Don't initialize
	copy_offset.  Initialize got_offset and plt_offset.
	* elf32-target.h (elf_backend_check_relocs): Define as 0 if not
	defined.
	(elf32_bed): Initialize check_relocs field.
	* elf64-target.h (elf_backend_check_relocs): Define as 0 if not
	defined.
	(elf64_bed): Initialize check_relocs field.
	* elf32-i386.c (elf_howto_table): Change R_386_PLT32 and
	R_386_GOTPC to be pc_relative and pcrel_offset.
	(elf_i386_pic_plt0_entry): Define.
	(elf_i386_pic_plt_entry): Define.
	(elf_i386_create_dynamic_sections): Create a .got.plt section, and
	define _GLOBAL_OFFSET_TABLE_ at the start of it.  If creating a
	shared library, make sure that _GLOBAL_OFFSET_TABLE_ is added as a
	dynamic symbol.  Don't create .rel.bss if creating a shared
	library.
	(elf_i386_check_relocs): New function.
	(elf_i386_adjust_dynamic_symbol): Don't make a PLT entry if the
	symbol already has one.  When making a PLT entry, set plt_offset.
	Don't create a copy reloc when creating a shared library.  Don't
	set copy_offset, just set ELF_LINK_HASH_NEEDS_COPY.
	(elf_i386_allocate_dynamic_section): Remove.
	(elf_i386_size_dynamic_sections): Look through all the sections
	rather than assuming we know their names.  Remove any empty reloc
	or plt sections.  Only add a DT_DEBUG entry if not creating a
	shared library.  Only add a DT_PLTGOT entry if there is a PLT.
	Add a DT_TEXTREL entry if required.
	(elf_i386_relocate_section): Permit undefined symbols when
	creating a shared library.  Handle the special relocation types
	specially.
	(elf_i386_finish_dynamic_symbol): Create a PLT entry if plt_offset
	is set.  If creating a shared library, produce a PIC PLT entry.
	Only mark a PLT symbol as undefined if it was not defined by a
	regular object file.  Create a GOT entry if got_offset is set.
	Create a copy reloc if ELF_LINK_HASH_NEEDS_COPY is set.
	(elf_i386_finish_dynamic_sections): Change the handling of
	DT_RELSZ to simply subtract out the size of .rel.plt.  If creating
	a shared library, produce PIC PLT code.
	(elf_backend_check_relocs): Define.
	* elf32-sparc.c (elf_sparc_howto_table): Change R_SPARC_GOT10,
	R_SPARC_GOT22, and R_SPARC_PC10 to not warn about reloc overflow.
	(elf32_sparc_create_dynamic_sections): If creating a shared
	library, make sure that _GLOBAL_OFFSET_TABLE_ is added as a
        dynamic symbol, and set the type to STT_OBJECT.  Likewise for
        _PROCEDURE_LINKAGE_TABLE_.  Don't create .rel.bss if creating a
        shared library.
	(elf32_sparc_check_relocs): New function.
	(elf32_sparc_adjust_dynamic_symbol): Don't make a PLT entry if the
	symbol already has one.  When making a PLT entry, set plt_offset.
	Don't create a copy reloc when creating a shared library.  Don't
	set copy_offset, just set ELF_LINK_HASH_NEEDS_COPY.
	(elf32_sparc_allocate_dynamic_section): Remove.
	(elf32_sparc_size_dynamic_sections): Look through all the sections
	rather than assuming we know their names.  Only add a DT_DEBUG
	entry if not creating a shared library.  Add a DT_TEXTREL entry if
	required.
	(elf32_sparc_relocate_section): Permit undefined symbols when
	creating a shared library.  Handle the special relocation types
	specially.
	(elf32_sparc_finish_dynamic_symbol): Create a PLT entry if plt_offset
	is set.  Only mark a PLT symbol as undefined if it was not defined
	by a regular object file.  Create a GOT entry if got_offset is
	set.  Create a copy reloc if ELF_LINK_HASH_NEEDS_COPY is set.
	(elf32_sparc_finish_dynamic_sections): Store dynobj in a local
	variable.
	(elf_backend_check_relocs): Define.
1994-07-26 17:18:37 +00:00
Stan Shebs
56fbe88919 Update to reflect comings and goings of ns32k and mach-related files 1994-07-25 20:04:11 +00:00
Stan Shebs
caede51576 * configure.in (pc532mach_vec): Change to pc532machaout_vec.
* config.bfd (ns32k-*-netbsd*): Use ns32k-nbsd as bfd_name.
	* Makefile.in (ALL_MACHINES): Add cpu-ns32k.o.
	(BFD32_BACKENDS): Add aout-ns32k.o, netbsd532.o, m88kmach3.o,
	pc532-mach.o.
	* targets.c (pc532machaout_vec): Use instead of pc532mach_vec.
	* config/pc532-mach.mt (DEFAULT_VECTOR): Ditto.
	(SELECT_VECS): Remove.
	* config/ns32k-nbsd.mt: New file, was ns32k-netbsd.mt.
	* config/ns32k-netbsd.mt: Remove, name too long.
1994-07-25 20:00:10 +00:00
Ian Lance Taylor
f2c2e75ce0 Forgot to save my buffer before last check in. 1994-07-22 23:50:35 +00:00
Ian Lance Taylor
7c6da9cade * aoutx.h (aout_link_check_ar_symbols): When changing a symbol to
common, set the alignment.
	(aout_link_add_symbols): Restrict the alignment of a common symbol
	to the alignment power given by the architecture.
	* elf.c (_bfd_elf_link_hash_newfunc): Don't initialize align.  Do
	initialize copy_offset.
	* elf32-i386.c (elf_i386_adjust_dynamic_symbol): Use copy_offset
	field rather than align field.  Get alignment using bfd_log2
	rather than switch.
	* elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Likewise.
	* elf32-i386.c (elf_i386_finish_dynamic_symbol): Use copy_offset,
	not align.
	* elf32-sparc.c (elf32_sparc_finish_dynamic_symbol): Likewise.
1994-07-22 18:53:23 +00:00
Ian Lance Taylor
2aaaab7ceb * aoutx.h (NAME(aout,some_aout_object_p)): Just check
STAT_FOR_EXEC, don't check MACH.
	* m88kmach3.c (MACH): Don't define.
	* config/i386-mach3.mt (TDEFINES): Define STAT_FOR_EXEC.
	* config/m88k-mach3.mt (TDEFINES): Likewise.
	* config/mips-mach3.mt (TDEFINES): Likewise.
1994-07-22 15:13:33 +00:00
Stan Shebs
bb99a7328c * i386mach3.c: Reverted to version from before Jul 5 1994 changes.
Un-break gas/binutils/ld for FSF.
1994-07-22 00:28:17 +00:00
Ian Lance Taylor
f42fe1599a * reloc.c (struct reloc_howto_struct): Remove special_function1.
It's the wrong way to do things.
	(HOWTO): Change accordingly.
	(HOWTO2): Remove.
	(_bfd_final_link_relocate): Remove references to
	special_function1.
	* bfd-in2.h: Rebuilt.
	* aoutx.h (aout_link_input_section_std): Remove references to
	special_function1.
	(aout_link_reloc_link_order): Likewise.
1994-07-21 16:34:59 +00:00
Ian Lance Taylor
f9779aad5a * elfcode.h (NAME(bfd_elf,size_dynamic_sections)): Add rpath
argument.  If it is not NULL, use it to set DT_RPATH.
	* bfd-in.h (bfd_elf32_size_dynamic_sections): Update prototype.
	(bfd_elf64_size_dynamic_sections): Likewise.
	* bfd-in2.h: Rebuilt.
1994-07-20 19:51:18 +00:00
Ian Lance Taylor
bf73e4f3fe * libelf.h (ELF_LINK_HASH_DEFINED_WEAK): Define.
* elfcode.h (elf_link_add_object_symbols): If symbol is defined as
	weak, set ELF_LINK_HASH_DEFINED_WEAK.
	(elf_link_output_extsym): If symbol is defined as weak, mark it
	STB_WEAK.
1994-07-17 02:15:24 +00:00
Ian Lance Taylor
ea61717495 * libelf.h (struct bfd_elf_section_data): Add relocs field.
(shdr_name): Remove; unused.
	* elfcode.h (elf_slurp_reloc_table): Rewrote to handle both REL
	and RELA relocs.  Free up the unswapped relocs.  Permit the relocs
	to be cached in the section_data.  Correct the reloc address.
	(elf_slurp_reloca_table): Remove.
	(elf_canonicalize_reloc): Rewrote.
	(elf_link_input_bfd): Permit the relocs to be cached in the
	section data.
1994-07-17 01:15:42 +00:00
Stan Shebs
d9840ab79e * config.bfd (m88*-harris-cxux*): Recognize.
* hosts/harris.h (POSIX_UTIME, HAVE_PROCFS): Define.
1994-07-16 21:08:41 +00:00
Stan Shebs
ef8b133d8c * configure.host (m68*-atari-sysv4*): New host.
(m68*-cbm-sysv4*): Use m68kv4 instead of amix.
	* hosts/amix.h: Remove.
	* hosts/m68kv4.h: New file, was amix.h.
1994-07-16 21:02:53 +00:00
Ken Raeburn
1fb83be62b NS32K changes from Ian Dall.
Note: Some of the ns32k-specific files do require gcc to compile at present.
This will be fixed.
1994-07-14 21:35:54 +00:00
Stan Shebs
a307efdfac * coff-sparc.c (sparccoff_vec): Have leading underscores. 1994-07-14 18:50:22 +00:00
Peter Schauer
57a814a93e * aix386-core.c, aoutf1.h, cisco-core.c, elfcode.h, hppabsd-core.c,
hpux-core.c, irix-core.c, lynx-core.c, osf-core.c, ptrace-core.c,
	rs6000-core.c, trad-core.c:  Remove SEC_ALLOC flag from .reg
	sections, .reg sections are not allocated and contain debug
	information only.
	* osf-core.c (make_bfd_asection, osf_core_core_file_p):  Use
	bfd_make_section_anyway instead of building unique section names.
1994-07-12 19:14:09 +00:00
Ian Lance Taylor
840846dac5 * libelf.h (bfd_elf32_swap_symbol_in): Declare.
(bfd_elf32_swap_symbol_out): Declare.
	(bfd_elf64_swap_symbol_in, bfd_elf64_swap_symbol_out): Declare.
	* elf32-hppa.c (elf32_hppa_args_hash_table_init): Correct cast.
1994-07-12 16:13:05 +00:00
Ian Lance Taylor
42ec46c361 * aout-encap.c (ARCH): Don't define. Obsolete.
* aout0.c, aoutx.h, gen-aout.c, hp300bsd.c, hp300hpux.c: Likewise.
	* i386aout.c, i386bsd.c, i386dynix.c, i386linux.c: Likewise.
	* i386lynx.c, m68klynx.c, mipsbsd.c, netbsd386.c: Likewise.
	* newsos3.c, sparclynx.c, sunos.c: Likewise.
1994-07-12 15:46:32 +00:00
Ian Lance Taylor
18938e4d3e * section.c (STD_SECTION): Make the sixth argument boolean, not
the seventh.  From gary@tuva.pacsemi.oz.au (gary kopff).
1994-07-12 00:12:19 +00:00
David Henkel-Wallace
4852416e2a Sun Jul 10 09:12:02 1994 D. V. Henkel-Wallace (gumby@cygnus.com)
* aoutx.h (bfd_free_cached_info): Change name of FREE to BFCI_FREE
        in order not to collide with LynxOS's definition of FREE in
        /usr/include/sys/proc.h
1994-07-10 16:15:07 +00:00
Peter Schauer
fd4913f196 * aoutx.h (howto_table_std): Add entry for GOT relocations
which are present in sun3 shared libraries, to avoid assertions
	when reading the dynamic relocations.
1994-07-07 17:11:58 +00:00
Jeff Law
48530c25d3 * som.h (R_HPPA_COMPLEX): Fix dumb typo. 1994-07-07 16:22:01 +00:00
Ian Lance Taylor
874a43273c * elfcode.h (elf_link_output_sym): Don't call output_symbol_hook
if it is NULL.
1994-07-06 23:33:02 +00:00
Ian Lance Taylor
7a769b7ffa * hosts/sysv4.h (qsort, strtol): Don't declare. 1994-07-06 23:28:31 +00:00
Peter Schauer
5fb54939a9 * coff-alpha.c (alpha_ecoff_mkobject_hook): New hook to
additionally copy object type information from the alpha file
	header to the BFD flags.
	(alpha_ecoff_backend_data):  Use it.
	(ecoffalpha_little_vec):  Add DYNAMIC to object_flags.
	* aout64.c:  Fix typo in conditional QMAGIC definition.
1994-07-06 07:53:31 +00:00
Jeff Law
2c0f3abc50 * hppabsd-core.c (hppabsd_core_core_file_p): Sanity check the
value of clicksz to help weed out non HPPA BSD core files.
1994-07-06 06:17:06 +00:00
Stan Shebs
11676adc14 Mach 3 support.
* config.bfd (m88*-*-mach3*, mips*-dec-mach3*, mips*-*-mach3*):
	New targets.
	* configure.host (i[34]86-*-mach3*, ns32k-*-mach3*): Recognize
	"mach3" instead of "mach".
	(m88*-*-mach3*, mips*-dec-mach3*, mips*-*-mach3*): New hosts.
	* targets.c (m88kmach3_vec): New target vector.
	(bfd_target_vector): Add i386mach3_vec and m88kmach3_vec, but
	inside #if 0.
	* aoutx.h (some_aout_object_p) [MACH]: Recognize executables by
	checking for execute permission, instead of looking at entry
	point.
	* i386mach3.c: Update, define MACH, N_TXTOFF, N_TXTADDR,
	N_SHARED_LIB, don't include aout/*.h files, etc.
	* m88kmach3.c: New file, m88k Mach 3 target.
	* config/m88k-mach3.mt,	config/mips-mach3.mt: New files, target
	makefile fragments.
	* config/i386mach3.mh, config/m88kmach3.mh, config/mipsmach3.mh:
	New files, host	makefile fragments.
	* hosts/m88kmach3.h, hosts/mipsmach3.h: New files, host definitions.
1994-07-05 21:50:43 +00:00
Ian Lance Taylor
71edd06df7 * elfcode.h (swap_out_syms): Get alignment of common symbol from
st_value field of saved ELF symbol information, if there is any.
1994-07-05 18:05:03 +00:00
Jeff Law
edf7c1e4fe * som.h (R_HPPA_COMPLEX): Define.
* elf32-hppa.h (R_HPPA_COMPLEX): Define.
	(elf32_hppa_reloc_type): Delete R_PARISC_STUB_CALL_17.
1994-07-05 01:19:31 +00:00
Jeff Law
ff5a090fb4 * Support code for enabling the new style linker for PA ELF.
* elfcode.h (swap_symbol_in, swap_symbol_out): Externalize.
	(elf_compute_section_file_positions): Pass link_info to
	the begin_write_processing hook.
	(bfd_elf_write_object_contents): Pass NULL for new link_info
	argument to final_write_processing hook.
	(elf_link_output_sym): Accept new "input_section" argument for
	the symbols's input section.  All callers changed.  Call the
	link_output_symbol_hook if it's defined.
	(elf_bfd_final_link): Call the final_write_processing hook if
	it's defined.
	* libelf.h (elf_backend_link_output_symbol_hook): Declare.
	(elf_backend_begin_write_processing): Add new "info" argument.
	(elf_backend_final_write_processing): Likewise.
	* elf32-target.h (elf_backend_link_output_symbol_hook): Provide
	a default definition.
	(elf32_bed): Add elf_backend_link_output_symbol_hook.
	* elf64-target.h: Likewise.

	* Major rework of the PA ELF code.  Uses the new style BFD
	linker, major cleanups.
	* hppa_stubs.h: Rewrite from scratch.  Much smaller and simpler.
	* elf32-hppa.h: Delete all symbol extension related code.
	(hppa_look_for_stubs_in_section): Delete decl.
	(elf32_hppa_size_stubs, elf32_hppa_build_stubs): New decls.
	* elf32-hppa.c: Symbol extension stuff moved form elf32-hppa.h
	into elf32-hppa.c.  Do not include aout64.h.
	(typdef hppa_stub_type): Delete.
	(elf32_hppa_stub_name_list_struct): Delete.
	(elf32_hppa_stub_description_struct): Delete.
	(arg_reloc_type): Use simpler enumerations.  All references changed.
	(arg_location, arg_reloc_relocation): Likewise.
	(elf32_hppa_symextn_map_struct): Delete.
	(get_symbol_value): Delete.
	(elf32_hppa_get_sym_extn): Delete.
	(find_stubs, new_stubs, type_of_mismatch): Delete.
	(find_stub_by_name, add_stub_by_name): Delete.
	(hppa_elf_stub_finish, hppa_elf_stub_reloc): Delete.
	(hppa_elf_arg_reloc_needed): Renamed.  Simplify.
	(hppa_elf_build_linker_stub, hppa_elf_create_stub_sec): Delete.
	(hppa_elf_long_branch_needed_p): Delete.
	(hppa_look_for_stubs_in_section): Delete.
	(hppa_elf_get_section_contents): Delete.
	(elf32_hppa_backend_symbol_processing): Delete.
	(elf32_hppa_backend_section_processing): Delete.
	(elf32_hppa_backend_section_from_shdr): Delete.
	(elf32_hppa_backend_fake_sections): Delete.
	(elf32_hppa_backend_section_from_bfd_section): Delete.
	(NEW_INSTRUCTION): Delete.
	(CURRENT_STUB_OFFSET): Delete.
	(elf32_hppa_relocate_section): New function.
	(elf32_hppa_bfd_final_link_relocate): New function.
	(elf32_hppa_size_symext): New function.
	(elf32_hppa_link_output_symbol_hook): New function.
	(elf32_hppa_read_symext_info): New function.
	(elf32_hppa_add_symbol_hook): New function.
	(elf32_hppa_name_of_stub): New function.
	(elf32_hppa_size_of_stub): New function.
	(elf32_hppa_build_one_sub): New function.
	(elf32_hppa_build_stubs): New function.
	(elf32_hppa_size_stubs): New function.
	(linker, stub and argument hash tables): Add appropriate
	structures, definitions and functions to implement all three
	hash tables.
	(hppa_elf_relocate_insn): Don't need argument location information
	in this function.
	(add_entry_to_symext_chain): Accept a symbol's argument location
	information rather than the symbol itself.  All callers changed.
	(hppa_elf_gen_reloc_type): Simplify.
	(hppa_elf_set_section_contents): Stub section is no longer special.
	(hppa_elf_reloc): Greatly simplify.
	(elf32_hppa_begin_write_processing): Accept link_info argument.
	Handle being called from the BFD backend linker.
	(elf32_hppa_final_write_processing): Likewise.
	(elf_hppa_tc_make_sections): No longer call stub_finish.
1994-07-01 19:00:17 +00:00
Stan Shebs
6989f6778e * ecoffswap.h (ecoff_swap_pdr_in, ecoff_swap_pdr_in) [MPW_C]:
Alternate versions without ECOFF_64 that chokes MPW C.
1994-06-30 00:20:40 +00:00
Stan Shebs
75c8a303bb Remove more GM-specific stuff. 1994-06-28 02:12:13 +00:00
Steve Chamberlain
eeaed1957a * section.c (bfd_get_section_contents): Put in parens to get
precedence right.
1994-06-28 01:09:50 +00:00
Jeff Law
6dde66d569 * libelf.h (relocate_section): New argument "output_names" added
to prototype.
	* elfcode.h (elf_link_input_bfd): New argument "output_names"
	added to prototype of relocate_section.  Pass the output symbol
	names to relocate_section.
	* elf32-i386.c (elf_i386_relocate_section): Use "output_names" to
	determine the name of a local symbol.
	* elf32-mips.c (mips_elf_relocate_section): Likewise.
	* elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
1994-06-27 00:17:41 +00:00
Stan Shebs
c71f57835c * mpw-config.in: Use sed instead of StreamEdit, add definitions
for mips target.
	* mpw-make.in: Remove mips targets definitions, add rule to
	compile with GCC, remove ecoff.c.o and ecofflink.c.o from list of
	required object files.
1994-06-26 23:00:20 +00:00
Peter Schauer
5e16521ab7 Add Solaris BCP (the part of Solaris which allows it to run
SunOS4 a.out files) core file handling.
	* aoutf1.h (external_solaris_bcp_core, swapcore_solaris_bcp):
	New structure and its swap in function.
	(internal_sunos_core):  New member c_data_addr, to receive the
	start address of the data section in the core file.
	(swapcore_sun3, swapcore_sparc, sunos4_core_file_p):  Use it.
	(sunos4_core_file_p):  Recognize Solaris BCP core file.
	(sunos4_core_file_matches_executable_p):  Always indicate match
	for Solaris BCP core files.
1994-06-24 16:18:35 +00:00
Ian Lance Taylor
8af74670df Preliminary support for generating shared libraries, from Eric
Youngdale <ericy@cais.cais.com>.
	* elfcode.h (prep_headers): If DYNAMIC, set e_type to ET_DYN.
	(elf_link_add_object_symbols): If generating a shared library,
	create dynamic sections for first input BFD with the right format.
	(elf_link_create_dynamic_sections): Don't create .interp section
	if creating a shared library.
	(elf_link_input_bfd): Skip dynamic sections in input file.
	(elf_bfd_final_link): If creating a shared library, it's OK for
	dynobj to have sections which are not SEC_IN_MEMORY.
	* elf32-i386.c (elf_i386_size_dynamic_sections): Only set .interp
	section if not creating a shared library.
	* elf32-sparc.c (elf_sparc_size_dynamic_sections): Likewise.
1994-06-23 21:36:03 +00:00
Ian Lance Taylor
51fc377bab * elfcode.h (elf_object_p): Don't set DYNAMIC just because there
is an SHT_DYNAMIC section.
1994-06-23 20:14:58 +00:00
David MacKenzie
1f8b3b5746 Change --with-targets to --enable-targets, per GNU coding standards. 1994-06-23 20:08:57 +00:00
Ian Lance Taylor
135a68152c * linker.c (_bfd_generic_link_add_archive_symbols): Initialize
pass from abfd->archive_pass, and save it there as well.
1994-06-23 00:36:38 +00:00
Ken Raeburn
2e66a62730 linker.c (FAIL): Undefine macro before defining as enum. 1994-06-23 00:10:06 +00:00
Ken Raeburn
3bf36e67e2 config.bfd (powerpc-*-elf*): New target, like powerpc-*-sysv4*. 1994-06-22 23:40:17 +00:00
Ian Lance Taylor
a537cb21bb * hash.c (bfd_hash_allocate): Don't call bfd_set_error if
obstack_alloc returns NULL unless the size is non-zero.

	* linker.c (archive_hash_allocate): Define.
	(_bfd_generic_link_add_archive_symbols): Use archive_hash_allocate
	rather than obstack_alloc, for clarity.
1994-06-22 22:37:54 +00:00
Ian Lance Taylor
66f2c66f93 * elfcode.h (elf_get_reloc_upper_bound): Correct. 1994-06-22 20:00:05 +00:00
Ian Lance Taylor
d81843e864 * aout64.c (BMAGIC, QMAGIC): Define if not already defined. From
Peter Schauer <pes@regent.e-technik.tu-muenchen.de>.
1994-06-22 19:38:57 +00:00
Ian Lance Taylor
0630aba528 Linux ZMAGIC support from Eric Youngdale <ericy@cais.cais.com>.
* libaout.h (struct aoutdata): Add field zmagic_disk_block_size.
	* aout-target.h (MY(callback)): Only set alignment according to
	architecture if the section sizes are aligned to that alignment,
	for backward compatibility.
	(MY(set_sizes)): Initialize zmagic_disk_block_size field.
	* aoutx.h (adjust_z_magic): Set ztih if using q_magic_format.  Set
	text section filepos to zmagic_disk_block_size if not ztih.  Use a
	different padding algorithm if not ztih.
	* i386linux.c (MY_text_includes_header): Don't define.
1994-06-22 19:13:55 +00:00
Ian Lance Taylor
4587b57831 * aoutx.h (aout_link_check_ar_symbols): Just skip N_STAB and N_FN
symbols; don't look them up in the hash table.  From
        ralphc@pyramid.com (Ralph Campbell).
1994-06-22 14:55:58 +00:00
Ian Lance Taylor
badd23e323 * section.c (bfd_abs_section): Make const.
(bfd_abs_section_ptr, bfd_is_abs_section): Define.
	(bfd_und_section): Make const.
	(bfd_und_section_ptr, bfd_is_und_section): Define.
	(bfd_com_section): Make const.
	(bfd_com_section_ptr): Define.
	(bfd_ind_section): Make const.
	(bfd_ind_section_ptr, bfd_is_ind_section): Define.
	(bfd_abs_symbol, bfd_com_symbol): Make const.
	(bfd_und_symbol, bfd_ind_symbol): Likewise.
	(global_syms): Cast initialization of section field.
	(STD_SECTION): Define as const, and cast initializations.
	* bfd-in2.h: Rebuilt.
	* Many files: Change uses of bfd_abs_section, etc., to use
	bfd_abs_section_ptr or bfd_is_abs_section, etc.
1994-06-21 16:47:07 +00:00
Ian Lance Taylor
2f3508ad05 * Many files: change all bfd_target vectors to be const. Change
all uses of bfd_target * to be const bfd_target *.  Change
	bfd_target_vector and bfd_default_vector arrays to be const
	bfd_target * const *.
1994-06-20 21:55:45 +00:00
Ian Lance Taylor
75f3ef7a63 * ecoff.c, libecoff.h, ecoffswap.h, coff-alpha.c, coff-mips.c,
elf32-mips.c: Renamed all externally visible ECOFF routines which
	are local to BFD to start with _bfd_ecoff instead of just ecoff.
1994-06-20 19:39:15 +00:00
Ian Lance Taylor
aac6b32f31 * ecoff.c (ecoff_swap_tir_in): Change input argument to const.
(ecoff_swap_tir_out): Likewise.
	(ecoff_swap_rndx_in, ecoff_swap_rndx_out): Likewise.
	(ecoff_slurp_symbolic_info): Add new arguments to correspond to
	read_debug_info entry point in ecoff_debug_swap structure.
	Change all calls.
	* libecoff.h (ecoff_slurp_symbolic_info): Change declaration.
	* ecoffswap.h (ecoff_swap_tir_in, ecoff_swap_tir_out): Declare.
	(ecoff_swap_rndx_in, ecoff_swap_rndx_out): Declare.
	* coff-alpha.c (alpha_ecoff_backend_data): Initialize new
	ecoff_debug_swap fields.
	* coff-mips.c (mips_ecoff_backend_data): Likewise.
	* elf32-mips.c (mips_elf_read_ecoff_info): Undefine READ.
	(mips_elf_ecoff_debug_swap): Initialize new ecoff_debug_swap
	fields.
	* configure.in (bfd_elf32_bigmips_vec): Use ecoff.o and
	ecofflink.o.
	(bfd_elf32_littlemips_vec): Likewise.
	(ecoff_big_vec, ecoff_little_vec): Likewise.
	(ecoffalpha_little_vec): Likewise.
	* Makefile.in (BFD_LIBS): Remove ecoff.o and ecofflink.o.
	(BFD32_BACKENDS): Add ecoff.o and ecofflink.o.
1994-06-20 18:26:55 +00:00
Ian Lance Taylor
6c8fa8e62c * aoutx.h (NAME(aout,final_link)): Check flavour of sub, not abfd,
when computing reloc sizes.  From Eric Youngdale
	<ericy@cais.cais.com>.
	* elfcode.h (elf_bfd_final_link): Don't try to compute maximum
	reloc count or size for a non-ELF file.
1994-06-20 15:51:28 +00:00
Ian Lance Taylor
aa91350c62 Comment change. 1994-06-20 15:30:56 +00:00
Ian Lance Taylor
6fea065949 * mipsbsd.c (MY_final_link_callback): Define to avoid warning. 1994-06-20 15:25:58 +00:00
Ian Lance Taylor
263a3f176a * hp300hpux.c (MY_final_link_callback): Define to avoid warning.
(BMAGIC, QMAGIC): Define; used by aoutx.h.
	(MY(slurp_symbol_table)): Change translate_from_native_sym_flags
	calls to use new parameters.
1994-06-20 15:11:34 +00:00
Ian Lance Taylor
785e2b52bc * aout-target.h (MY(callback)): Set the alignments of the text,
data and bss sections after determining the architecture.
1994-06-17 18:49:39 +00:00
Ian Lance Taylor
ec88c42e5e * sunos.c (sunos_add_one_symbol): Treat a common symbol from a
dynamic object as being in the .bss section of the object, rather
	than as being undefined.
1994-06-17 18:47:50 +00:00
Jeff Law
9fefc1befc * libhppa.h (bfd_hppa_insn2fmt, hppa_rebuild_insn): Make INLINE. 1994-06-17 18:11:17 +00:00
Jeff Law
83b69190b3 * elf32-hppa.h (elf_hppa_final_processing): Delete decl. 1994-06-17 17:18:25 +00:00
Jeff Law
c46b8ed7e6 * elfcode.h (elf_link_input_bfd): Don't try to read local symbols
if there aren't any in the input file.
1994-06-17 05:39:55 +00:00
Ian Lance Taylor
e3400040fa * config.bfd: If second argument is ``_'', then, instead of
echoing config file name, echo whether target uses leading
	underscores on symbol names.  Add appropriate settings to
	different cases.  Used by binutils/configure.in to set default for
	c++filt.
1994-06-16 21:58:48 +00:00
Ken Raeburn
346a6d5982 keep makefile.dos 1994-06-16 20:27:39 +00:00
Ian Lance Taylor
0ff5d3a69a * elfcode.h (elf_bfd_final_link): If trying to generate a shared
object, warn and return false.
1994-06-16 19:30:49 +00:00
Ian Lance Taylor
04003b573d Thu Jun 16 14:25:22 1994 Eric Youngdale (ericy@cais.cais.com)
* i386linux.c: Many new functions and definitions for linker
	support for Linux shared libraries.
	* bfd-in.h (bfd_linux_size_dynamic_sections): Declare.
	* bfd-in2.h: Rebuild.
1994-06-16 18:29:21 +00:00
Ian Lance Taylor
7b0243215c * aoutx.h (NAME(aout,some_aout_object_p)): Accept BMAGIC objects
and treat them as OMAGIC.
1994-06-16 18:25:00 +00:00
Ian Lance Taylor
c1f84521bf * libelf.h (struct elf_obj_tdata): New field dt_needed_name.
(elf_dt_needed_name): New accessor macro.
	* elfcode.h (elf_link_add_object_symbols): If elf_dt_needed_name
	is set, use that instead of the filename for the DT_NEEDED dynamic
	entry.
	* elf.c (bfd_elf_set_dt_needed_name): New function.
	* bfd-in.h (bfd_elf_set_dt_needed_name): Declare.
	* bfd-in2.h: Rebuilt.
1994-06-16 00:01:32 +00:00
Ken Raeburn
485dc654e2 comment on v9 stuff 1994-06-15 23:27:54 +00:00
Ken Raeburn
0b72c41044 added elf64-sparc.* 1994-06-15 22:55:16 +00:00
Ken Raeburn
66599384bb unsanitizing v9 1994-06-15 22:41:46 +00:00
Ken Raeburn
7faa6d38bb regenerated (unsanitize v9) 1994-06-15 22:40:59 +00:00
Ken Raeburn
9180892d10 unsanitize v9 1994-06-15 22:31:16 +00:00
Ken Raeburn
4f9617ca5e unsanitize v9 1994-06-15 22:10:50 +00:00
Ken Raeburn
5546cc7eb6 Tweak v9 support to ready it for release. 1994-06-15 22:05:40 +00:00
Ian Lance Taylor
7c726b6625 * elfcode.h (NAME(bfd_elf,size_dynamic_sections)): Add sinterpptr
argument, and set it to the .interp section.
	* bfd-in.h (bfd_elf32_size_dynamic_sections): Update prototype.
	(bfd_elf64_size_dynamic_sections): Likewise.
	* bfd-in2.h: Rebuilt.
1994-06-15 19:58:59 +00:00
Ian Lance Taylor
f1d42c0476 * coff-sparc.c (SWAP_OUT_RELOC_EXTRA): Define to clear the r_spare
field of the reloc rather than letting it be garbage.
1994-06-15 19:54:15 +00:00
Ian Lance Taylor
aeef32f01c * archive.c (bfd_slurp_armap): Recognize __.SYMDEF/ as well as
__.SYMDEF; the former was used in old Linux archives.  From
	jrs@world.std.com (Rick Sladkey).
1994-06-15 17:22:41 +00:00
Ian Lance Taylor
f7d2fa4455 * i386linux.c (i386linux_write_object_contents): Define; like
MY(write_object_contents) in aout-target.h, but set MACHTYPE to
	M_386.  From jrs@world.std.com (Rick Sladkey).
	(MY_write_object_contents): Define.
1994-06-15 17:15:03 +00:00
Ian Lance Taylor
2cd086e387 * aoutx.h (translate_from_native_sym_flags): Treat N_SETV symbols
as N_DATA symbols.
	(aout_link_add_symbols): Likewise.
1994-06-15 15:29:44 +00:00
Ian Lance Taylor
d63d0479d9 Comment change. 1994-06-15 15:17:09 +00:00
Ian Lance Taylor
d17fc4c990 * aoutx.h: Rewrite symbol duplicate elimination to use BFD hash
tables.
	(struct stringtab_entry, struct stringtab_data): Remove.
	(HASHMAXLEN, HASH_CHAR, hash, compare, log2, emit_strtab): Remove.
	(struct strtab_hash_entry, struct strtab_hash): Define.
	(strtab_hash_newfunc, strtab_hash_lookup): Define.
	(stringtab_free, emit_stringtab): Define.
	(stringtab_init, add_to_stringtab): Rewrite.
	(NAME(aout,write_syms)): Use new stringtab code.
	(struct aout_final_link_info, NAME(aout,final_link)): Likewise.
	(aout_link_write_symbols, aout_link_write_other_symbol): Likewise.
1994-06-15 05:48:14 +00:00
Ian Lance Taylor
a7ff9b8029 * bfd-in.h (BFD_TRADITIONAL_FORMAT): Define new BFD flag to
request BFD to write object in the traditional format, whatever
	that means for the particular backend.
	* bfd-in2.h: Rebuilt.
1994-06-15 05:46:46 +00:00
Ian Lance Taylor
3183bb13d7 Correct copyright date and add usual blank lines in header. 1994-06-15 02:47:49 +00:00
Ian Lance Taylor
f5419a5908 * libaout.h (struct aoutdata): Add q_magic_format to subformat
enum.
	* aout-target.h (MY_bfd_copy_private_bfd_data): Define as function
	if not already defined.  Copy subformat information.
	(MY_text_includes_header): Define as 0 if not already defined.
	(MY(backend_data)): Use MY_text_includes_header rather than 0.
	(MY_final_link_callback): Rename from final_link_callback, and
	define only if MY_final_link_callback is not already defined.
	(MY_bfd_final_link): Rename use of final_link_callback to
	MY_final_link_callback.
	* aoutx.h (NAME(aout,some_aout_object_p)): Handle QMAGIC like
	ZMAGIC, but set the subformat to q_magic_format.  Abort if the
	magic number if not recognized.
	(adjust_z_magic): Use QMAGIC if q_magic_format.
	* i386linux.c (MY_text_includes_header): Define as 1.
	(i386linux_bfd_final_link): New static function.
	(MY_bfd_final_link): Define as i386linux_bfd_final_link.

	* aoutx.h (translate_to_native_sym_flags): Check both section and
	output_section against sections of abfd.
1994-06-14 22:04:54 +00:00
Ian Lance Taylor
ac9ed09667 For PR 4865.
* libecoff.h (struct ecoff_link_hash_entry): Change type of
	written from boolean to char.  Add new field small.
	* ecoff.c (ecoff_link_hash_newfunc): Initialize written to 0
	rather than false.  Initialize small to 0.
	(ecoff_link_add_externals): If ECOFF type is scSUndefined, set
	small.  If small is set, and hash table type is common, force the
	symbol into a section named SCOMMON and change the ECOFF type from
	scCommon to scSCommon.
	(ecoff_link_write_external): Set written to 1 rather than true.
	* coff-mips.c (mips_relocate_section): Correct JMPADDR reloc
	overflow check to consider section VMA of input file.
1994-06-14 17:06:08 +00:00
Ian Lance Taylor
9ae74960a8 * aoutf1.h (aout_32_sunos4_write_object_contents): Handle a
machine type of 68000.
	* aoutx.h (NAME(aout,machine_type)): Add new argument unknown.
	Set *unknown to true if machine type is really unknown, as opposed
	to M_UNKNOWN for the 68000.
	(NAME(aout,set_arch_mach)): Change NAME(aout,machine_type) call
	accordingly.
	* libaout.h (NAME(aout,machine_type)): Add new argument to
	prototype.
1994-06-13 18:25:12 +00:00
Jeff Law
8117e1ea9a * som.c (EXEC_AUX_ID): Define based on availablity of HPUX_AUX_ID
or HIUX_AUX_ID.
	(som_begin_writing): Use EXEC_AUX_ID instead of HPUX_AUX_ID.
	(som_write_armap): Use CPU_PA_RISC1_0 as the magic number.  Note
	som.c is careful to always define CPU_PA_RISC1_0.
1994-06-13 02:31:43 +00:00
Ian Lance Taylor
4298e311fe Add weak symbols as an extension to a.out.
* aoutx.h (sym_in_text_section): Don't define.
	(sym_in_data_section, sym_in_bss_section): Likewise.
	(sym_is_undefined, sym_is_global_defn): Likewise.
	(sym_is_debugger_info, sym_is_fortrancommon): Likewise.
	(sym_is_absolute, sym_is_indirect): Likewise.
	(translate_from_native_sym_flags): Rewrite for clarity.  Rearrange
	arguments and change caller.  Handle weak symbols.
	(translate_to_native_sym_flags): Likewise.
	(aout_link_check_ar_symbols): Don't ignore weak symbols.  Pull
	object in from archive if a weak defintion is found for an
	existing undefined symbol.
	(aout_link_add_symbols): Put all cases in switch.  Set flags of an
	undefined symbol to 0.  Handle weak symbols.
	(aout_link_write_symbols): Handle weak symbols.
	(aout_link_write_other_symbol): Likewise.
	(aout_link_input_section_std): Likewise.
	(aout_link_input_section_ext): Likewise.
	* sunos.c (sunos_write_dynamic_symbol): Likewise.
1994-06-11 20:40:59 +00:00
Ian Lance Taylor
4f019d0445 * aoutx.h (NAME(aout,canonicalize_reloc)): Handle .bss section.
(NAME(aout,get_reloc_upper_bound)): Likewise.
1994-06-10 19:00:28 +00:00
Ian Lance Taylor
22aabad533 * coff-i960.c (coff_i960_reloc_type_lookup): Add BFD_RELOC_CTOR.
* linker.c (_bfd_generic_link_write_global_symbol): Don't assume
	the section of a common symbol is not NULL.
1994-06-10 17:27:22 +00:00
Ian Lance Taylor
1b88cd182c * aoutx.h (aout_get_external_symbols): Don't try to read the
strings if there are no symbols.
	(aout_link_write_other_symbol): Use the output section when
	working out the type.
1994-06-09 03:59:22 +00:00
Ian Lance Taylor
b9ac0a53fd * elfcode.h (assign_section_numbers): Put shstrtab, symtab and
strtab sections at end of file.  Avoids bug in some versions of
	SVR4 strip.  From Eric Youngdale <eric@tantalus.nrl.navy.mil>.
1994-06-07 20:20:05 +00:00
Ian Lance Taylor
d38eee518f * coffcode.h (styp_to_sec_flags): If COFF_PAGE_SIZE is defined,
set SEC_DEBUGGING for STYP_INFO sections.
	(coff_compute_section_file_positions): If COFF_PAGE_SIZE is
	defined, and D_PAGED is set, set the file position equal to the
	section VMA modulo COFF_PAGE_SIZE.
	* coffgen.c (coff_real_object_p): If F_EXEC is set, set D_PAGED.
	* coff-i386.c: Set D_PAGED in BFD target.
	(COFF_PAGE_SIZE): Define.
	* coff-m68k.c, coff-sparc.c: Likewise.
1994-06-07 17:48:00 +00:00
Ian Lance Taylor
e6667b2bc3 * elfcode.h (bfd_section_from_shdr): Don't turn a reloc section
into a BFD section just because SHF_ALLOC is set; require that it
	not use the normal symbol table.
	(elf_section_from_bfd_section): Corresponding change.
1994-06-06 23:59:27 +00:00
Ian Lance Taylor
f88c900883 Comment change. 1994-06-06 22:31:58 +00:00
Ian Lance Taylor
118e8d1c7d Better indirect and warning symbol handling inspired by Stuart
Quick <stuck@cs.man.ac.uk>.
	* linker.c (enum link_action): Add REF, MIND, CWARN, REFC.
	(link_action): Change UNDEF_ROW/def and UNDEFW_ROW/def from NOACT
	to REF.  Change UNDEF_ROW/indr and UNDEFW_ROW/indr from CYCLE to
	REFC.  Change DEF_ROW/indr and COMMON_ROW/indr from CYCLE to MDEF.
	Change DEFW_ROW/indr from CYCLE to NOACT.  Change INDR_ROW/indr
	from MDEF to MIND.  Change INDR_ROW/warn from WARNC to CYCLE.
	Change WARN_ROW/def and WARN_ROW/indr from MWARN to CWARN.  Change
	WARN_ROW/com from MWARN to WARN.  Change WARN_ROW/warn from NOACT
	to CYCLE.  Change SET_ROW/warn from WARNC to CYCLE>
	(_bfd_generic_link_add_one_symbol): Handle REF, MIND, CWARN and
	REFC.  If a new indirect symbol has been referenced, push the
	reference down to the symbol it points to.  FIx handling of WARN.
	* aoutx.h (translate_from_native_sym_flags): If N_WARNING, don't
	clobber e_type of next symbol.
	(translate_to_native_sym_flags): Likewise.
	(aout_link_write_symbols): Loop on bfd_link_hash_warning as well
	as bfd_link_hash_indirect.
1994-06-06 21:54:54 +00:00
Ian Lance Taylor
35fee729f2 * libaout.h (struct aout_link_hash_entry): New field written.
* aoutx.h (NAME(aout,link_hash_newfunc)): Initialize written.
	(aout_link_write_symbols): Use written, not root.written.
	(aout_link_write_other_symbol): Likewise.
	* sunos.c (sunos_scan_dynamic_symbol): Likewise.
	* libecoff.h (struct ecoff_link_hash_entry): New field written.
	* ecoff.c (ecoff_link_hash_newfunc): Initialize written.
	(ecoff_link_write_external): use written, not root.written.
	* genlink.h (struct generic_link_hash_entry): New field written.
	* linker.c (_bfd_link_hash_newfunc): Don't initialize written.
	(generic_link_hash_newfunc): Initialize written.
	(_bfd_generic_link_output_symbols): Use written, not root.written.
	(_bfd_generic_link_write_global_symbol): Likewise.
	(_bfd_generic_reloc_link_order): Likewise.
1994-06-06 18:42:38 +00:00