Commit Graph

145 Commits

Author SHA1 Message Date
Ian Lance Taylor 6ccdc203e6 * aoutx.h (NAME(aout,final_link)): Don't emit the string table if
there are no symbols.
1997-08-11 16:46:40 +00:00
Ian Lance Taylor 508539ab8b * bfd-in.h: Don't include obstack.h.
(struct bfd_hash_table): Change memory field to PTR.
	* bfd.c (struct _bfd): Change memory field to PTR.
	* bfd-in2.h: Rebuild.
	* libbfd-in.h (bfd_release): Declare as function, don't define as
	macro.
	* libbfd.h: Rebuild.
	* opncls.c: Include "objalloc.h" rather than "obstack.h".  Use
	objalloc routines rather than obstack routines.
	(obstack_chunk_alloc, obstack_chunk_free): Don't define.
	(getpagesize): Don't define.
	(_bfd_new_bfd): Don't set _bfd_chunksize.
	(bfd_openr): Free new bfd and objalloc on failure.
	(bfd_fdopenr, bfd_openstreamr, bfd_openw): Likewise.
	(bfd_alloc_size): Remove.
	(bfd_release): New function.
	* hash.c: Include "objalloc.h" rather than "obstack.h".  Use
	objalloc routines rather than obstack routines.
	(obstack_chunk_alloc, obstack_chunk_free): Don't define.
	* ecofflink.c: Include "objalloc.h" rather than "obstack.h".  Use
	objalloc routines rather than obstack routines.
	(obstack_chunk_alloc, obstack_chunk_free): Don't define.
	(struct accumulate): Change memory to struct objalloc *.
	* liboasys.h (oasys_data_type): Remove oasys_obstack field.
	* dep-in.sed: Don't remove obstack.h from dependency list.
	* Makefile.in: Rebuild dependencies.
	(BFD_H_DEPS): Remove obstack.h.
	(install): Don't install obstack.h.
	* Many files: Don't include "obstack.h".
	* VERSION: Bump.
1997-03-18 00:47:04 +00:00
Ian Lance Taylor 167dc907f2 * aoutx.h (aout_link_write_symbols): Don't apply discard_l to
debugging symbols.
Mentioned in PR 11540.
1997-01-31 19:08:31 +00:00
Ian Lance Taylor 7dd3d45a45 * aoutx.h (NAME(aout,find_nearest_line)): Make room for the
potential leading underscore in the allocated buffer.
1996-05-28 15:48:13 +00:00
Ian Lance Taylor b7d1158a90 * aoutx.h (translate_from_native_sym_flags): Don't create
SEC_CONSTRUCTOR sections.
	* ecoff.c (ecoff_set_symbol_info): Likewise.
1996-05-01 01:01:50 +00:00
Ian Lance Taylor 18de3f1908 * libaout.h (WRITE_HEADERS): Write out the relocs even if there
aren't any symbols.
	* aoutx.h (NAME(aout,swap_std_reloc_out)): Set r_index to N_ABS,
	not 0, for an absolute symbol.
	(NAME(aout,swap_ext_reloc_out)): Likewise.
PR 7387.
1996-04-10 18:11:00 +00:00
Ian Lance Taylor f1b45745b4 * aoutx.h (aout_link_add_symbols): Always call add_dynamic_symbols
entry point, not just for DYNAMIC objects.
	* sunos.c (sunos_add_dynamic_symbols): Always call
	sunos_create_dynamic_sections.  If called with a non DYNAMIC
	object, don't do anything else.
	(sunos_add_one_symbol): Don't call sunos_create_dynamic_sections.
1996-04-09 15:46:41 +00:00
David Edelsohn d1f74cd2c3 * aoutf1.h (sunos_32_set_arch_mach): Handle M_SPARCLET.
(aout_32_sunos4_write_object_contents): Likewise.
	* aoutx.h (NAME(aout,machine_type)): Handle
	bfd_mach_sparc_{sparclet,sparclite}.
	* archures.c (bfd_mach_sparc_{sparclet,sparclite}): Define.
	(bfd_mach_sparc_v9_p): Update.
	* cpu-sparc.c (arch_info_struct): Add entries for sparclet,sparclite.
	* libaout.h (enum machine_type): Add M_SPARCLET.
	* sunos.c (MACHTYPE_OK): Define.
	* bfd-in2.h: Regenerated.
1996-04-02 21:28:33 +00:00
Ian Lance Taylor aad53b0d59 * aoutx.h (aout_link_input_section_std): When reporting an
overflow error, use the name of the symbol in the hash table if
	available.
	(aout_link_input_section_ext): Likewise.
1996-04-01 22:33:05 +00:00
Ian Lance Taylor ff0e4a9341 Remove SEC_LINKER_MARK, and add a linker_mark bitfield to the asection
structure instead.
1996-03-27 22:23:18 +00:00
Ian Lance Taylor 7ec49f9133 * section.c (SEC_LINKER_MARK): Define.
* bfd-in2.h: Rebuild.
	* aoutx.h (NAME(aout,final_link)): Mark sections included in the
	link.
	(aout_link_input_bfd): Don't link unmarked sections.
	* cofflink.c (_bfd_coff_final_link): Mark sections included in the
	link.
	(_bfd_coff_link_input_bfd): Don't link unmarked sections.
	* coff-ppc.c (ppc_bfd_coff_final_link): Mark sections included in
	the link.
	* elflink.h (elf_bfd_final_link): Mark sections included in the
	link.
	(elf_link_input_bfd): Don't link unmarked sections.
	* xcofflink.c (_bfd_xcoff_bfd_final_link): Mark sections included
	in the link.
	(xcoff_link_input_bfd): Don't link unmarked sections.
1996-03-27 19:21:19 +00:00
Ian Lance Taylor c189fdfb8e * stab-syms.c (__define_stab_duplicate): Define.
(bfd_get_stab_name): Rename from aout_stab_name.  Rewrite to use a
	switch.
	* bfd-in.h (bfd_get_stab_name): Declare.
	* bfd-in2.h: Rebuild.
	* Makefile.in: Rebuild dependencies.
	(BFD_LIBS): Add stab-syms.o.
	(BFD_LIBS_CFILES): Add stab-syms.c.
	(BFD32_BACKENDS): Remove stab-syms.o.
	(BFD32_BACKENDS_CFILES): Remove stab-syms.c.
	* configure.in: Don't list stab-syms.o in bfd_backends.
	* configure: Rebuild.
	* libaout.h (aout_stab_name): Don't declare.
	* aoutx.h (NAME(aout,get_symbol_info)): Call bfd_get_stab_name,
	not aout_stab_name.
1996-03-11 17:33:43 +00:00
Ian Lance Taylor 20ab764e38 * aoutx.h (howto_table_ext): Fix RELOC_BASE10 and RELOC_BASE22
entries.
1996-01-15 22:37:16 +00:00
Ian Lance Taylor f7e684639c update copyrights 1996-01-09 20:53:33 +00:00
Ian Lance Taylor 64d5f5d061 Tue Jan 9 15:22:53 1996 David Mosberger-Tang <davidm@azstarnet.com>
* coff-alpha.c (alpha_relocate_section): During final link, allow
 	output .lita section to be bigger than 64k by adjusting gp value
 	on a per-input section basis.
	* libecoff.h (struct ecoff_tdata): Add issued_multiple_gp_warning
	field.
	(struct ecoff_section_tdata): Add gp field.

Tue Jan  9 12:00:36 1996  Ian Lance Taylor  <ian@cygnus.com>

	Handle Alpha ECOFF changes in OSF/1 3.2.
	* libecoff.h (struct ecoff_backend_data): Add get_elt_at_filepos
	field.
	* coff-alpha.c: Include "aout/ar.h".
	(alpha_ecoff_get_relocated_section_contents): Don't require an
	ALPHA_R_IGNORE reloc after an ALPHA_R_GPDISP reloc, since OSF/1
	3.2 doesn't generate one.
	(alpha_relocate_section): Likewise.
	(alpha_ecoff_slurp_armap): Define.
	(alpha_ecoff_slurp_extended_name_table): Define.
	(alpha_ecoff_construct_extended_name_table): Define.
	(alpha_ecoff_truncate_arname): Define.
	(alpha_ecoff_write_armap): Define.
	(alpha_ecoff_generic_stat_arch_elt): Define.
	(alpha_ecoff_update_armap_timestamp): Define.
	(ARFZMAG): Define.
	(alpha_ecoff_read_ar_hdr): New static function.
	(alpha_ecoff_get_elt_at_filepos): New static function.
	(alpha_ecoff_openr_next_archived_file): New static function.
	(alpha_ecoff_get_elt_at_index): New static function.
	(alpha_ecoff_backend_data): Initialize get_elt_at_filepos field.
	(ecoffalpha_little_vec): Change BFD_JUMP_TABLE_ARCHIVE from
	_bfd_ecoff to alpha_ecoff.
	* ecoff.c (ecoff_link_add_archive_symbols): Use get_elt_at_filepos
	field from backend structure, rather than always calling
	_bfd_get_elt_at_filepos.
	* coff-mips.c (mips_ecoff_backend_data): Initialize
	get_elt_at_filepos field.
	* archive.c (_bfd_generic_read_ar_hdr_mag): New function, copied
	from _bfd_generic_read_ar_hdr with minor changes.
	(_bfd_generic_read_ar_hdr): Use _bfd_generic_read_ar_hdr_mag.
	* libbfd-in.h (_bfd_generic_read_ar_hdr_mag): Declare.
	* libbfd.h: Rebuild.

	* bfd-in.h (BFD_IN_MEMORY): Define.
	* libbfd-in.h (struct bfd_in_memory): Define.
	* libbfd.c (bfd_read): Handle BFD_IN_MEMORY flag.
	(bfd_get_file_window): Don't try to map a BFD_IN_MEMORY file.
	(bfd_write, bfd_stat): Abort if BFD_IN_MEMORY is set.
	(bfd_tell, bfd_flush, bfd_seek): Handle BFD_IN_MEMORY flag.
	* bfd.c (struct _bfd): Change iostream field from char * to PTR.
	(bfd_get_size): Handle BFD_IN_MEMORY flag.
	* cache.c (bfd_cache_close): Ignore BFD_IN_MEMORY files.
	(bfd_open_file): Cast to PTR, not char *, when setting iostream.
	(bfd_cache_lookup_worker): Abort if BFD_IN_MEMORY is set.
	* opncls.c (bfd_fdopenr): Cast to PTR, not char *, when setting
	iostream.
	(bfd_openstreamr): Likewise.
	* aoutx.h (NAME(aout,some_aout_object_p)): Only fstat iostream if
	BFD_IN_MEMORY is not set.
	* riscix.c (riscix_some_aout_object_p): Likewise.
	* bfd-in2.h, libbfd.h: Rebuild.

	* targets.c (bfd_target): Add _bfd_get_elt_at_index field.
	(BFD_JUMP_TABLE_ARCHIVE): Add _get_elt_at_index.
	(bfd_get_elt_at_index): Define.
	* archive.c (_bfd_generic_get_elt_at_index): Rename from
	bfd_get_elt_at_index.  Change index parameter from int to
	symindex.
	* libbfd-in.h (_bfd_generic_get_elt_at_index): Declare.
	(_bfd_noarchive_get_elt_at_index): Define.
	(_bfd_archive_bsd_get_elt_at_index): Define.
	(_bfd_archive_coff_get_elt_at_index): Define.
	* bfd-in2.h, libbfd.h: Rebuild.
	* aout-target.h (MY_get_elt_at_index): Define if not defined.
	* coff-rs6000.c (xcoff_get_elt_at_index): Define.
	* ieee.c (ieee_get_elt_at_index): Define.
	* libecoff.h (_bfd_ecoff_get_elt_at_index): Define.
	* oasys.c (oasys_get_elt_at_index): Define.
	* som.c (som_get_elt_at_index): Define.
1996-01-09 20:40:39 +00:00
Ian Lance Taylor 14dc2f774e * aoutx.h: Include <ctype.h>.
(struct aout_link_includes_table): Define.
	(struct aout_link_includes_totals): Define.
	(struct aout_link_includes_entry): Define.
	(aout_link_includes_lookup): Define macro.
	(struct aout_final_link_info): Add includes field.
	(aout_link_includes_newfunc): New static function.
	(NAME(aout,final_link)): Initialize includes hash table.
	(aout_link_write_symbols): Eliminate duplicate N_BINCL entries.
1995-12-13 20:47:36 +00:00
Ian Lance Taylor 58142f101d * libbfd.c (bfd_malloc, bfd_realloc): New functions.
(bfd_zmalloc): Return PTR, not char *.  Take size_t, not
	bfd_size_type.
	* libbfd-in.h (bfd_malloc, bfd_realloc): Declare.
	(bfd_zmalloc): Change declaration.
	* libbfd.h: Rebuild.
	* Many files: Use bfd_malloc and bfd_realloc rather than malloc
	and realloc.  Don't set bfd_error_no_memory if they fail.
1995-12-01 19:48:10 +00:00
Ian Lance Taylor a9713b91a7 * opncls.c (bfd_alloc_by_size_t): Set bfd_error_no_memory if
obstack_alloc fails.
	(bfd_alloc_finish): Set bfd_error_no_memory if obstack_finish
	fails.
	* libbfd.c (bfd_zmalloc): Set bfd_error_no_memory if malloc fails.
	* Many files: don't set bfd_error_no_memory if one of the above
	routines fails.
1995-11-29 22:05:37 +00:00
Ian Lance Taylor a1774c51f2 * aoutx.h (NAME(aout,set_section_contents)): If a section can not
be represented, report the name via _bfd_error_handler.
	(translate_to_native_sym_flags): Likewise.
	* elf32-mips.c (mips_elf_final_link): Likewise.
	* oasys.c (oasys_write_sections): Likewise.
1995-11-09 20:09:00 +00:00
Ken Raeburn 7ac847361b * configure.in: Added new option --with[out]-mmap. Set USE_MMAP if it is given
and mmep is available.
* acconfig.h: Undef USE_MMAP.
* configure, config.in: Regenerated.
* aoutx.h: If USE_MMAP is not defined, do all symbol and string table handling
the old way.
(aout_get_external_symbols): Don't complain if last byte of string table is
nonzero.
* libbfd.c [HAVE_MADVISE]: Include sys/types.h and sys/mman.h.
(bfd_free_window) [! USE_MMAP]: Don't define.
(bfd_get_file_window, _bfd_generic_get_section_contents_in_window)
 [! USE_MMAP]: Abort.
1995-11-09 09:14:01 +00:00
Ian Lance Taylor 0bb8ff191e * libbfd.c (bfd_get_file_window): Change writable parameter from
int to boolean; update all callers.  Pass MAP_SHARED if not
	writable--it's required on Solaris.  Cast fprintf argument to
	avoid warning.
	* bfd-in.h (bfd_get_file_window): Update declaration.
	* bfd-in2.h: Rebuild.
	* aoutx.h: Update calls to bfd_get_file_window.
1995-11-08 21:24:33 +00:00
Ken Raeburn 4fe6d901bd Changes for mmap; details in change log.
Added some new interfaces, and a new entry in the target vector.  Under the new
interfaces, mmap will be used if available, otherwise malloc/seek/read, as
before.  Old interfaces all still intact.

Most configurations (including all used by "--enable-targets=all") simply
changed to call the default routine for that entry in the target vector.  I
might've missed some targets only included in special configurations.

Support for a.out symbol and string table reading now goes through new
interfaces, and will use mmap when available.

Linker hooks (e.g., avoiding reallocation under malloc) not ready yet.
1995-11-06 10:08:03 +00:00
Niklas Hallqvist 34e9ffbccc Change PAGE_SIZE to TARGET_PAGE_SIZE 1995-10-28 00:26:12 +00:00
Ian Lance Taylor fcf490c05f * aoutx.h (translate_from_native_sym_flags): Don't try to stuff
pointers into value field for warning and indirect symbols; just
	leave the value field alone.
	* linker.c (generic_link_add_symbol_list): Use next symbol for
	warning and indirect symbols, rather than looking in symbol value.
	* ecoff.c (ecoff_set_symbol_info): Remove indirect_ptr_ptr
	parameter.  Change all callers.  Remove support for indirect
	symbols; it didn't work anyhow.
	(_bfd_ecoff_slurp_symbol_table): Remove indirect_ptr variable.
	* syms.c: Change comments about BSF_WARNING and BSF_INDIRECT.
	* bfd-in2.h: Rebuild.
1995-09-26 16:56:28 +00:00
Ian Lance Taylor f1c6dd5d16 * libaout.h (struct aoutdata): Add line_buf field.
* aoutx.h (NAME(aout,find_nearest_line)): Remove statics buffer
	and filename_buffer.  Instead, use a malloc buffer stored in the
	new line_buf field.  Remove length restrictions.
1995-09-25 20:55:50 +00:00
Ian Lance Taylor f69e888e4d * aoutx.h (NAME(aout,swap_ext_reloc_out)): Don't set r_extern for
a reloc against a local symbol, even if it's not a section.
1995-09-20 16:10:18 +00:00
Ian Lance Taylor 396aaeb2b6 * sunos.c (sunos_slurp_dynamic_symtab): New static function,
broken out of sunos_canonicalize_dynamic_symtab.
	(sunos_canonicalize_dynamic_symtab): Call new function
	sunos_slurp_dynamic_symtab.
	(sunos_add_dynamic_symbols): Add three new parameters.  Return the
	dynamic symbol table to the caller.
	* aoutx.h (aout_link_add_symbols): Permit add_dynamic_symbols
	callback to override the symbols being read.
	* libaout.h (struct aout_backend_data): Add three new parameters
	to add_dynamic_symbols callback.
1995-09-12 18:59:24 +00:00
Ian Lance Taylor ae115e5114 Extensive minor changes to avoid various gcc warnings. Also:
* Makefile.in (BFD32_BACKENDS): Remove coff-arm.o.
	* archures.c (bfd_arch_info_type): Change mach field from long to
	unsigned long.
	(bfd_lookup_arch): Change machine parameter from long to unsigned
	long.
1995-09-12 16:23:25 +00:00
Ian Lance Taylor 3fe22b980b * aoutx.h (NAME(aout,slurp_reloc_table)): Cast argument to size_t
for malloc.
	* coff-mips.c (mips_relocate_section): Likewise, for memmove.
	(mips_relax_section): Likewise, for malloc.
	* cofflink.c (process_embedded_commands): Likewise.
	(_bfd_coff_final_link): Likewise.
	* ecoff.c (_bfd_ecoff_write_object_contents): Likewise.
	(ecoff_final_link_debug_accumulate): Likewise.
	(ecoff_indirect_link_order): Likewise, for memcpy and malloc.
	(ecoff_reloc_link_order): Likewise, for malloc.
	* ecofflink.c (ecoff_align_debug): Likewise, for memset.
	(ecoff_write_symhdr): Likewise, for malloc.
	* elf32-hppa.c (elf32_hppa_read_symext_info): Likewise.
	* elf.c (assign_file_positions_except_relocs): Likewise, for
	qsort.
	* elf32-mips.c (mips_elf_read_ecoff_info): Likewise, for malloc.
	* elfcode.h (elf_slurp_reloc_table): Likewise.
	* elfcore.h (elf_corefile_note): Likewise.
	* elflink.h (elf_link_add_object_symbols): Likewise.
	(elf_link_read_relocs): Likewise.
	(NAME(bfd_elf,size_dynamic_sections)): Likewise, for memset.
	* i386linux.c (bfd_linux_size_dynamic_sections): Likewise.
	* ieee.c (do_with_relocs): Likewise.
	* linker.c (default_indirect_link_order): Likewise, for malloc.
	* nlmcode.h (nlm_object_p): Likewise.
	(nlm_write_object_contents): Likewise.
	* oasys.c (oasys_set_section_contents): Likewise, for memcpy.
	* reloc.c (bfd_generic_get_relocated_section_contents): Likewise,
	for malloc.
	* section.c (bfd_get_section_contents): Likewise, for memcpy.
	* srec.c (srec_get_section_contents): Likewise.
	(srec_set_section_contents): Likewise.
	* sunos.c (bfd_sunos_size_dynamic_sections): Likewise, for
	realloc and memset.
	(sunos_scan_relocs): Likewise, for malloc.
	(sunos_scan_dynamic_symbol): Likewise, for realloc.
	* syms.c (_bfd_generic_read_minisymbols): Likewise, for malloc.
	* versados.c (versados_get_section_contents): Likewise, for
	memcpy.
1995-07-13 18:14:45 +00:00
Ian Lance Taylor c3246d9b00 * targets.c (bfd_target): Add fields _read_minisymbols and
_minisymbol_to_symbol.
	(BFD_JUMP_TABLE_SYMBOLS): Add _read_minisymbols and
	_minisymbol_to_symbol.
	(bfd_read_minisymbols): Define.
	(bfd_minisymbol_to_symbol): Define.
	* syms.c (_bfd_generic_read_minisymbols): Define.
	(_bfd_generic_minisymbol_to_symbol): Define.
	* libbfd-in.h (_bfd_nosymbols_read_minisymbols): Define.
	(_bfd_nosymbols_minisymbol_to_symbol): Define.
	(_bfd_generic_read_minisymbols): Declare.
	(_bfd_generic_minisymbol_to_symbol): Declare.
	* bfd-in2.h: Rebuild.
	* libbfd.h: Rebuild.
	* aoutx.h (MINISYM_THRESHOLD): Define.
	(NAME(aout,read_minisymbols)): New function.
	(NAME(aout,minisymbol_to_symbol)): New function.
	* libaout.h (NAME(aout,read_minisymbols)): Declare.
	(NAME(aout,minisymbol_to_symbol)): Declare.
	* aout-target.h (MY_read_minisymbols): Define.
	(MY_minisymbol_to_symbol): Define.
	* All targets: Define read_minisymbols and minisymbol_to_symbol.
PR 5332.
1995-07-13 14:46:06 +00:00
Ken Raeburn 943fbd5bd5 fsf address update, but not in COPYING files 1995-07-07 22:49:42 +00:00
Ian Lance Taylor 2f6754271f * aoutx.h (NAME(aout,swap_ext_reloc_in)): Add symcount parameter,
and use it instead of bfd_get_symcount.  Check r_index after
	setting r_extern based on whether this is a base relative reloc.
	(NAME(aout,swap_std_reloc_IN)): Add symcount parameter, and use it
	instead of bfd_get_symcount.
	(NAME(aout,slurp_reloc_table)): Pass bfd_get_symcount to reloc
	swap routines.
	* libaout.h (NAME(aout,swap_ext_reloc_in)): Add symcount parameter
	to declaration.
	(NAME(aout,swap_std_reloc_in)): Likewise.
	* sunos.c (sunos_canonicalize_dynamic_reloc): Pass
	info->dynsym_count to reloc swap routines.
	* aout-ns32k.c (MY_swap_std_reloc_in): Add symcount parameter.
	* hp300hpux.c (MY(swap_std_reloc_in)): Likewise.
	(MY(slurp_reloc_table)): Pass bfd_get_symcount to reloc swap
	routine.
	* i386lynx.c (NAME(lynx,swap_ext_reloc_in)): Add symcount
	parameter.
	(NAME(lynx,swap_std_reloc_in)): Likewise.
	(NAME(lynx,slurp_reloc_table)): Pass bfd_get_symcount to reloc
	swap routines.
1995-03-09 20:14:04 +00:00
Ian Lance Taylor 773033d2d2 * aoutx.h (NAME(aout,set_section_contents)): Double check that the
caller is writing to a valid section.
PR 5996 cleanup.
1995-03-02 21:00:39 +00:00
Ian Lance Taylor 6c97aedf26 Distinguish a weak defined symbol from a regular defined symbol.
* linker.c (enum link_action): Add DEFW.
	(link_action): Add bfd_link_hash_defweak column.
	(_bfd_generic_link_add_one_symbol): Add DEFW case.  Handle
	bfd_link_hash_defweak in a few other cases.
	* Many files (bfd_link_hash_undefweak): Renamed from
	bfd_link_hash_weak.
	* aoutx.h (aout_link_write_symbols): Handle bfd_link_hash_defweak.
	(aout_link_write_other_symbol): Likewise.
	(aout_link_input_section_std): Likewise.
	(aout_link_input_section_ext): Likewise.
	* bout.c (get_value): Likewise.
	* coff-a29k.c (coff_a29k_relocate_section): Likewise.
	* coff-alpha.c (alpha_convert_external_reloc): Likewise.
	(alpha_relocate_section): Likewise.
	* coff-mips.c (mips_relocate_section): Likewise.
	(mips_relax_section): Likewise.
	(bfd_mips_ecoff_create_embedded_relocs): Likewise.
	* cofflink.c (coff_write_global_sym): Likewise.
	(_bfd_coff_generic_relocate_section): Likewise.
	* ecoff.c (ecoff_link_add_externals): Likewise.
	(ecoff_link_write_external): LIkewise.
	* elf32-hppa.c (elf32_hppa_relocate_section): Likewise.
	(elf32_hppa_size_stubs): Likewise.
	* elf32-i386.c (elf_i386_adjust_dynamic_symbol): Likewise.
	(elf_i386_relocate_section): Likewise.
	(elf_i386_finish_dynamic_symbol): Likewise.
	* elf32-mips.c (mips_elf_output_extsym): Likewise.
	(mips_elf_relocate_section): Likewise.
	* elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Likewise.
	(elf32_sparc_relocate_section): Likewise.
	* elfcode.h (elf_link_add_object_symbols): Likewise.
	(elf_adjust_dynamic_symbol): Likewise.
	(elf_bfd_final_link): Likewise.
	(elf_link_output_extsym): Likewise.
	* i386linux.c (linux_add_one_symbol): Likewise.
	(linux_tally_symbols): Likewise.
	(linux_finish_dynamic_link): Likewise.
	* linker.c (_bfd_generic_link_output_symbols): Likewise.
	(set_symbol_from_hash): Likewise.
	* reloc16.c (bfd_coff_reloc16_get_value): Likewise.
	(bfd_perform_slip): Likewise.
	* sunos.c (sunos_add_one_symbol): Likewise.
	(sunos_scan_std_relocs): Likewise.
	(sunos_scan_ext_relocs): Likewise.
	(sunos_scan_dynamic_symbol): Likewise.
	(sunos_write_dynamic_symbol): Likewise.
1995-02-06 20:01:08 +00:00
Ian Lance Taylor 51fbf4548f update copyright dates 1995-01-24 19:48:50 +00:00
Ken Raeburn 82b1edf7b9 Change "reloc_howto_type" typedef to be "const", since all uses of it are (or
should be) anyways.
1995-01-12 02:41:04 +00:00
Ian Lance Taylor 875e471661 * aoutx.h (aout_link_input_section): Don't bother to read or write
the relocs if there aren't any.
1994-10-26 05:17:08 +00:00
Ian Lance Taylor 7494246592 * aoutx.h (NAME(aout,slurp_symbol_table)): Don't return an error
if there are no symbols.
	* coffgen.c (coff_get_normalized_symtab): Likewise.
	* hp300hpux.c (MY(slurp_symbol_table)): Likewise.
1994-10-19 05:30:15 +00:00
Ian Lance Taylor ab0434c26d * aoutx.h (aout_link_write_symbols): Rename skip_indirect to
skip_next.  If we find an N_WARNING symbol which has already been
	written out, set skip_next.
PR 5634.
1994-09-14 23:28:25 +00:00
Ian Lance Taylor 204ba9e37e * aoutx.h (NAME(aout,final_link)): Don't assume that all the input
files are a.out.
1994-09-13 20:25:46 +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 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 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 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
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
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 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
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
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 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