Commit Graph

82 Commits

Author SHA1 Message Date
David Edelsohn 76af94b9a4 Remove ARC sanitization. 1997-08-15 12:08:52 +00:00
Nick Clifton 48e509bf2c Merged in changes made in armT-970328-branch 1997-06-04 00:07:07 +00:00
Ian Lance Taylor 3cd5cf3d40 * stabs.c (_bfd_link_section_stabs): Copy over the first header
symbol.  Check for memory allocation failure of *psinfo.
	(_bfd_write_section_stabs): Add psinfo parameter.  Change all
	callers.  Set the value of the header symbol.
	* libbfd-in.h (_bfd_write_section_stabs): Update declaration.
	* libbfd.h: Rebuild.
1997-03-25 19:46:12 +00:00
David Edelsohn 37bdd624bd Remove m32r sanitization. 1997-03-21 20:59:30 +00:00
Ian Lance Taylor 062a1b96e0 * opncls.c (bfd_alloc_grow, bfd_alloc_finish): Remove.
* libbfd-in.h (bfd_alloc_grow, bfd_alloc_finish): Don't declare.
	* libbfd.h: Rebuild.
	* ieee.c (ieee_archive_p): Rewrite to not use bfd_alloc_grow.
	* sunos.c (sunos_add_dynamic_symbols): Likewise.
1997-03-17 17:51:20 +00:00
Ian Lance Taylor 50ede03d76 * opncls.c (bfd_alloc): Rename from bfd_alloc_by_size_t. Remove
old version of bfd_alloc.
	* libbfd-in.h (bfd_alloc_by_size_t): Don't declare.
	* libbfd.h: Rebuild.
	* Several files: Call bfd_alloc rather than bfd_alloc_by_size_t.
1997-03-17 16:36:08 +00:00
Ian Lance Taylor 35a3e78edb * targets.c (BFD_JUMP_TABLE_SYMBOLS): Change _bfd_is_local_label
to _bfd_is_local_label_name.
	(bfd_target): Likewise.
	* syms.c (bfd_is_local_label): Define as function, not macro.
	(bfd_is_local_name): Define.
	* libbfd.c (bfd_generic_is_local_label_name): Rename from
	bfd_generic_is_local_label, and take a string rather than a
	symbol.
	* libbfd-in.h (_bfd_nosymbols_bfd_is_local_label): Don't define.
	(_bfd_nosymbols_bfd_is_local_label_name): Define.
 	(bfd_generic_is_local_label): Don't declare.
	(bfd_generic_is_local_label_name): Declare.
	* bfd-in2.h, libbfd.h: Rebuild.
	* All backends: Change local_label to local_label_name.
1997-02-28 02:07:54 +00:00
Michael Meissner c6c7035cfb Since d10v is public now, remove all sanitization statements 1997-02-20 16:05:18 +00:00
Martin Hunt fd8d7c31c0 Tue Feb 18 17:22:59 1997 Martin M. Hunt <hunt@pizza.cygnus.com>
* Makefile.in, archures.c, config.bfd, configure.in, elf.c,
	reloc.c, targets.c: New target, elf-*-D30V.

	* bfd-in2.h, configure, libbfd.h: Rebuilt.

	* cpu-d30v.c, elf32-d30v.c: New files.
1997-02-19 01:29:29 +00:00
Ian Lance Taylor a4183ba5c9 * elf32-mips.c (reloc_type): Add R_MIPS16_GPREL.
(elf_mips16_gprel_howto): New static variable.
	(mips16_gprel_reloc): New static function.
	(bfd_elf32_bfd_reloc_type_lookup): Handle BFD_RELOC_MIPS16_GPREL.
	(mips_info_to_howto_rel): Handle R_MIPS16_GPREL.
	(mips_elf_relocate_section): Handle R_MIPS16_GPREL.
	* reloc.c (BFD_RELOC_MIPS16_GPREL): Define.
	* bfd-in2.h, libbfd.h: Rebuild.
1997-02-11 20:30:12 +00:00
David Edelsohn 1d5c6cfdf0 * reloc.c: Add relocs BFD_RELOC_M32R_{HI16_[US]LO,LO16}.
* bfd-in2.h, libbfd.h: Regenerated.
	* elf32-m32r.c: Add support for them.
1997-01-27 20:35:24 +00:00
Ian Lance Taylor c7f8d0a524 update copyright 1997-01-16 22:48:24 +00:00
Jeff Law b6d08fce22 * elf32-v850.c (enum reloc_type): Add R_V850_SDA_OFFSET,
R_V850_TDA_OFFSET and R_V850_ZDA_OFFSET.
        (elf_v850_howto_table): Corresponding changes.
        (elf_v850_reloc_map): Corresponding changes.
        * reloc.c: Add additional V850 relocations.
        * bfd-in2.h, libbfd.h: Rebuilt.
1996-10-17 04:45:29 +00:00
Ian Lance Taylor 6b31fd3af3 Mon Oct 14 11:17:24 1996 Richard Henderson <rth@tamu.edu>
* reloc.c: Create a new BFD_RELOC_ALPHA_ELF_LITERAL.  It was a
	mistake to have reused the ECOFF LITERAL for ELF since they have
	different semantics.
	* elf64-alpha.c (elf_reloc_map): Map from ELF_LITERAL.
	* bfd-in2.h, libbfd.h: Rebuild.

	* elf64-alpha.c (elf64_alpha_size_dynamic_sections): Trap .got
	section overflow.

	* elf64-alpha.c (elf64_alpha_relocate_section): Do not emit a
	dynamic relocation for an undefweak symbol when we are building
	a static executable.
1996-10-14 15:21:54 +00:00
Ian Lance Taylor c86158e591 Add SH ELF support.
* elf32-sh.c: New file.
	* elf.c (prep_headers): Handle bfd_arch_sh.
	* elfcode.h (write_relocs): Handle absolute symbol.
	* elf-bfd.h (_bfd_elf32_link_read_relocs): Declare.
	(_bfd_elf64_link_read_relocs): Declare.
	* elflink.h (NAME(_bfd_elf,link_read_relocs)): Rename from
	elf_link_read_relocs.  Make globally visible.  Change all
	callers.
	(elf_link_input_bfd): Get external symbols from cache in
	symtab_hdr->contents.  Get contents from cache in
	elf_section_data.
	* elfxx-target.h (bfD_elfNN_bfd_relax_section): Only define if not
	already defined.
	* reloc.c: Define BFD_RELOC_SH_* relocs.
	* libbfd-in.h (_bfd_sh_align_load_span): Declare.
	* coff-sh.c (sh_insns_conflict): Fix a return value.
	(_bfd_sh_align_load_span): New globally visible function, broken
	out of sh_align_load.
	(sh_align_load): Call _bfd_sh_align_load_span.
	(sh_swap_insns): Change relocs parameter to PTR.
	* bfd-in2.h, libbfd.h: Rebuild.
	* targets.c (bfd_elf32_sh_vec): Declare.
	(bfd_elf32_shl_vec): Declare.
	* config.bfd (sh-*-elf*): New target.
	* configure.in (bfd_elf32_sh_vec): New target vector.
	(bfd_elf32_shl_vec): New target vector.
	* configure: Rebuild.
	* Makefile.in: Rebuild dependencies.
 	(BFD32_BACKENDS): Add elf32-sh.o.
	(BFD32_BACKENDS_CFILES): Add elf32-sh.c.

	* elf.c (map_sections_to_segments): Check that LMA does not skip a
	page before checking D_PAGED.
1996-08-30 22:09:51 +00:00
Ian Lance Taylor 8612a388f7 Thu Aug 8 12:21:56 1996 Klaus Kaempf <kkaempf@progis.de>
* evax-alpha.c (evax_alpha_vec): Corrected flags, cleanup.
	(evax_initialize): Remove evax_reloc_table.
	(evax_close_and_cleanup): Ditto.
	(reloc_nil): Ditto.
	(alpha_howto_table): Remove ALPHA_R_SWREL32 and ALPHA_R_SWREL64
	entries.
	(evax_bfd_reloc_type_lookup): Ditto.
	* evax-egsd.c (_bfd_evax_slurp_egsd): Add a few casts; set
	cooked_size == raw_size.
	* evax-emh.c (_bfd_evax_register_filename): Remove.
	* evax-etir.c (etir_stc): Allow ETIR_S_C_STC_xx commands.
	* evax-misc.c (add_new_contents): Malloc section at full size.
	(_bfd_save_evax_section): Memcpy section contents directly.
	* evax.h (ALPHA_R_SWREL32, ALPHA_R_SWREL64): Remove.
	(evax_reloc_table): Remove.

	* hosts/alphavms.h (O_ACCMODE): Define if needed.

	* makefile.vms: Add better support for DEC C compilation
	Add evax.h dependencies

	* reloc.c (bfd_get_reloc_size): Add case for 16 byte reloc.
	(BFD_RELOC_SWREL32,BFD_RELOC_SWREL64): Remove.
	(BFD_RELOC_ALPHA_BASEREG): Remove.
	* bfd-in2.h, libbfd.h: Rebuild.
1996-08-08 16:27:21 +00:00
Jackie Smith Cashion d1b40d8eeb Wed Jul 31 15:00:12 1996 James G. Smith <jsmith@cygnus.co.uk>
* reloc.c: (BFD_RELOC_ARM_OFFSETIMM8, BFD_RELOC_ARM_HWLITERAL):
 	Added, for internal use by the ARM gas.
	* libbfd.h: Rebuilt
	* bfd-in2.h: Rebuilt
1996-07-31 14:34:21 +00:00
Ian Lance Taylor 0f61272947 rebuild 1996-07-19 00:46:50 +00:00
Martin Hunt 50bd50d48f start-sanitize-d10v
Wed Jul 17 14:51:52 1996  Martin M. Hunt  <hunt@pizza.cygnus.com>
        * Makefile.in (ALL_MACHINES): Add cpu-d10v.o
        (BFD32_BACKENDS) Add elf32-d10v.o
        * archures.c: Add bfd_d10v_arch.
        * bfd-in2.h: Add bfd_d10v_arch.
        * config.bfd (d10v-*-*): New target.
        * configure: (bfd_elf32_d10v_vec) New vector.
        * configure.in: (bfd_elf32_d10v_vec) New vector.
        * cpu-d10v.c: New file.
        * elf.c (prep_headers): Added case bfd_arch_d10v.
        * elf32-d10v.c: New file.
        * libbfd.h: Rebuild.
        * reloc.c (BFD_RELOC_D10V_10_PCREL_R, BFD_RELOC_D10V_10_PCREL_L, BFD_RELOC_D10V_18,
          BFD_RELOC_D10V_18_PCREL): Define.
        * targets.c (bfd_elf32_d10v_vec): New vector.
end-sanitize-d10v
1996-07-18 00:47:05 +00:00
Jeff Law ca4e2190ce * linker.c (_bfd_generic_link_hash_newfunc): Renamed from
generic_link_hash_newfunc.  All references changed.
        * genlink.h (_bfd_generic_link_hash_newfunc): Declaration
        moved here from libbfd-in.h.
        * libbfd-in.h: Corresponding changes.
        * libbfd.h: Regenerated.
Minor changes suggested by Ian.
1996-04-01 17:50:13 +00:00
Jeff Law 39f2796643 * libbfd-in.h (generic_link_hash_newfunc): Add declaration.
* libbfd.h: Rebuilt.
        * linker.c (generic_link_hash_newfunc): No longer static.
        * coffcode.h (coff_bfd_link_hash_create): Allow specific targets
        to override.
        * coff-h8300.c: Add two derived hash tables and their associated
        funtions and #defines for use by the h8300 linker.
        (h8300_reloc16_extra_cases, case R_MEM_INDIRECT): Create entries in
        the function vector as needed.  Place the address of the function
        vector entry in the location specified by the R_MEM_INDIRECT reloc.
        Rewrite the vectors section contents as necessary.
        (h8300_bfd_link_add_symbols): New function for the h8300 linker.
        (coff_bfd_link_add_symbols): Define to use h8300 specific version.
        (coff_bfd_link_hash_table_create): Likewise.

Linker changes for function vectors.  HMSE.
1996-03-29 06:56:02 +00:00
Ian Lance Taylor b7384d226b Add reloc.c entries MIPS_CALL_HI16/MIPS_CALL_LO16. 1996-02-14 01:36:01 +00:00
Ian Lance Taylor e9f03cd450 * reloc.c (BFD_RELOC_MIPS_GOT_HI16): Define.
(BFD_RELOC_MIPS_GOT_LO16): Define.
	* bfd-in2.h, libbfd.h: Rebuild.
	* elf32-mips.c (mips_reloc_map): Map new relocs.
1996-02-13 22:08:52 +00:00
Michael Meissner 83f4323e5a Add support for SHT_ORDERED and SHF_EXCLUDE 1996-01-11 22:47:04 +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 c53fac125a * targets.c (bfd_target): Add _bfd_read_ar_hdr field. Modify
BFD_JUMP_TABLE_ARCHIVE accordingly.
	* libbfd-in.h (_bfd_snarf_ar_hdr): Don't declare.
	(_bfd_compute_and_write_armap): Declare.
	(_bfd_generic_read_ar_hdr): Declare.
	(_bfd_read_ar_hdr): Define.
	(_bfd_noarchive_read_ar_hdr): Define.
	(_bfd_archive_bsd_read_ar_hdr): Define.
	(_bfd_archive_coff_read_ar_hdr): Define.
	* archive.c: Change all callers of _bfd_snarf_ar_hdr to call
	_bfd_read_ar_hdr instead.
	(_bfd_generic_read_ar_hdr): Rename from _bfd_snarf_ar_hdr.
	(_bfd_compute_and_write_armap): Rename from
	compute_and_write_armap.  Make non-static.  Change all callers.
	* ecoff.c (_bfd_ecoff_slurp_armap): Call _bfd_read_ar_hdr rather
	than _bfd_snarf_ar_hdr.
	* aout-target.h (MY_read_ar_hdr): Define if not defined.
	* ieee.c (ieee_read_ar_hdr): Define.
	* libecoff.h (_bfd_ecoff_read_ar_hdr): Define.
	* oasys.c (oasys_read_ar_hdr): Define.
	* som.c (som_read_ar_hdr): Define.
	* bfd-in2.h, libbfd.h: Rebuild.
1995-10-06 16:15:35 +00:00
Ian Lance Taylor 81449d47c5 * init.c (initialized): Remove static variable.
(bfd_init): Don't bother setting initialized.
	(bfd_check_init): Remove.
	* opncls.c (_bfd_new_bfd): Don't call bfd_check_init.
	* libbfd.h: Rebuild.
1995-09-25 15:50:25 +00:00
Ian Lance Taylor 2ffbb79ae4 Change arch info to be const, initialized at compile time.
* archures.c: Reindent many functions.  Change CONST to const.
	(bfd_arch_info_type): Make arch_name const.  Remove disassemble;
	nothing set it anyhow.  Make next const.
	(bfd_arch_info_list): Remove.
	(bfd_archures_list): Rename from archures_init_table.  Change from
	a table of function pointers to a table of bfd_arch_info_type
	structure addresses.
	(bfd_scan_arch): Rewrite accordingly.  Return a const pointer.
	(bfd_lookup_arch): Likewise.
	(bfd_set_arch_info): Rewrite accordingly.  Change argument to be a
	const pointer.
	(bfd_default_arch_struct): Make const.
	(bfd_arch_init, bfd_arch_linkin): Remove.
	(bfd_get_arch_info): Return a const pointer.
	* init.c (bfd_init): Don't call bfd_arch_init.
	* bfd.c (struct _bfd): Make arch_info const.
	* bfd-in2.h: Rebuild.
	* libbfd.h: Rebuild.
	* configure.in: Put & before everything in $selarchs.
	* configure: Rebuild.
	* cpu-*.c: Change bfd_*_arch from a function which calls
	bfd_arch_linkin to a const structure.
	* ieee.c (ieee_object_p): Make arch const.
1995-09-22 22:06:51 +00:00
Michael Meissner 02f85cda33 Start work to all full PowerPC V.4 reloc support. 1995-09-22 20:30:18 +00:00
Steve Chamberlain 4e98461f60 Thu Aug 31 16:00:53 1995 steve chamberlain <sac@slash.cygnus.com>
* Makefile.in: Update dependencies.
	* aout-target.h (MY_bfd_print_private_bfd_data): New.
	* bfd-in.h (PE STUFF): Deleted.
	* bfd.c (tdata->pe_obj_data): New.
	(bfd_print_private_bfd_data): New.
	* coff-i386.c, coff-arm.c (coff_*-rtype_to_howto): Get image base from
	new place.
	* libcoff.h, libbfd.h, bfd-in2.h: Rebuilt.
	* coffcode.h (pe_value): Delete
	(coff_mkobject, coff_mkobject_hook): Conditionally build.
	(coff_compute_section_file_positions): Look in new place.
	(add_data_entry, fill_pe_header_info): Deleted.
	(coff_write_object_contents): Remove PE stuff.
	(coff_bfd_print_private_bfd_data): New.
	* coffswap.h: Remove PE stuff.
	* elfxx-target.h (bfd_elfNN_bfd_print_private_bfd_data): New.
	* libbfd-in.h (_bfd_generic_bfd_print_private_bfd_data): New.
	* libcoff-in.h (pe_data_type): New.
	* libecoff.h (_bfd_ecoff_bfd_print_private_bfd_data): New.
	* targets.c (_bfd_print_private_bfd_data): New.
	* peicode.h: New file.
1995-08-31 23:33:37 +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
Ken Raeburn fca2b81b88 * reloc.c (bfd_reloc_code_type): Add new value BFD_RELOC_12_PCREL.
* bfd-in2.h, libbfd.h: Rebuilt.
1994-11-17 22:46:22 +00:00
Ken Raeburn 0443af3189 * reloc.c (enum bfd_reloc_code_real): Rewrote definition to use new "chew"
commands for simultaneous definition of enumerator and enumerator name table.
(bfd_get_reloc_code_name): New function, for retrieving a symbolic name
associated with an enumerator.

* libbfd.h, bfd-in2.h: Regenerated.
1994-09-02 18:21:41 +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
Jeff Law 4ee3b9beb1 * libbfd.h (bfd_realloc): Change last arg to "size_t size". 1994-06-03 17:01:17 +00:00
Ian Lance Taylor 6812b6077e * targets.c (bfd_target): Rearranged fields in target vector.
Removed _bfd_debug_info_start, _bfd_debug_info_end and
	_bfd_debug_info_accumulate, which were never used.
	(BFD_JUMP_TABLE_GENERIC, BFD_JUMP_TABLE_COPY): Defined.
	(BFD_JUMP_TABLE_CORE, BFD_JUMP_TABLE_ARCHIVE): Defined.
	(BFD_JUMP_TABLE_SYMBOLS, BFD_JUMP_TABLE_RELOCS): Defined.
	(BFD_JUMP_TABLE_WRITE, BFD_JUMP_TABLE_LINK): Defined.
	* All backends: Changed to use the new BFD_JUMP_TABLE_* macros
	rather than the single JUMP_TABLE macro.  Removed many of the
	weird macro definitions needed to support the monolithic
	JUMP_TABLE.
	* bfd-in.h (JUMP_TABLE): Removed.
	* libbfd-in.h: Define a bunch of macros, and declare a few
	functions, for use with the new BFD_JUMP_TABLE_* macros.
	* libbfd.c (_bfd_dummy_new_section_hook): Removed.
	(bfd_false): Set bfd_error_invalid_operation.
	(bfd_nullvoidptr): Likewise.
	(bfd_n1): New function.
	(_bfd_nocore_core_file_matches_executable_p): Renamed from
	_bfd_dummy_core_file_matches_executable_p.
	(_bfd_nocore_core_file_failing_command): Similar rename.  Set
	bfd_error_invalid_operation.
	(_bfd_nocore_core_file_failing_signal): Likewise.
	(_bfd_generic_get_section_contents): Renamed from
	bfd_generic_get_section_contents.  Changed all callers.
	(_bfd_generic_set_section_contents): Similar rename.
	* ieee.c: #if 0 out ieee_bfd_debug_info_start,
	ieee_bfd_debug_info_end, ieee_bfd_debug_info_accumulate.  They
	were never called.
	* bfd-in2.h: Rebuilt.
	* libbfd.h: Rebuilt.
1994-04-06 22:00:40 +00:00
Ian Lance Taylor 326e32d7ce Wed Mar 30 16:25:41 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
Changes to let BFD return an error indication from
	get_symtab_upper_bound, bfd_canonicalize_symtab,
	bfd_get_reloc_upper_bound, and bfd_canonicalize_reloc.  They now
	return long instead of unsigned int, and use -1 to indicate an
	error.  Along the way, rename get_symtab_upper_bound to
	bfd_get_symtab_upper_bound.
	* bfd.c (bfd_get_reloc_upper_bound): Return long, and -1 on
	errors.
	(bfd_canonicalize_reloc): Likewise.
	* syms.c (bfd_get_symtab_upper_bound): Renamed from
	get_symtab_upper_bound.
	* targets.c (bfd_target): Renamed _get_symtab_upper_bound to
	_bfd_get_symtab_upper_bound, and changed it and
	_bfd_canonicalize_symtab and _get_reloc_upper_bound and
	_bfd_canonicalize_reloc to all return long.
	* aoutx.h (NAME(aout,get_symtab)): Return long, and -1 on errors.
	(NAME(aout,canonicalize_reloc)): Likewise.
	(NAME(aout,get_reloc_upper_bound)): Likewise.
	(NAME(aout,get_symtab_upper_bound)): Likewise.
	* bout.c (b_out_canonicalize_reloc): Likewise.
	(b_out_get_reloc_upper_bound): Likewise.
	* coffcode.h (coff_canonicalize_reloc): Likewise.
	* coffgen.c (coff_get_symtab_upper_bound): Likewise.
	(coff_get_symtab): Likewise.
	(coff_get_reloc_upper_bound): Likewise.
	* ecoff.c (ecoff_get_symtab_upper_bound): Likewise.
	(ecoff_get_symtab): Likewise.
	(ecoff_canonicalize_reloc): Likewise.
	* elfcode.h (elf_get_symtab_upper_bound): Likewise.
	(elf_get_reloc_upper_bound): Likewise.
	(elf_canonicalize_reloc): Likewise.
	(elf_get_symtab): Likewise.
	* hp300hpux.c (MY(get_symtab)): Likewise.
	(MY(get_symtab_upper_bound)): Likewise.
	(MY(canonicalize_reloc)): Likewise.
	* i386lynx.c (NAME(lynx,canonicalize_reloc)): Likewise.
	* ieee.c (ieee_slurp_external_symbols): Change return type to
	boolean.  Check for errors from get_symbol.
	(ieee_slurp_symbol_table): Change return type to boolean.  Check
	for errors from ieee_slurp_external_symbols.
	(ieee_get_symtab_upper_bound): Return long, and -1 on errors.
	(ieee_get_symtab): Likewise.
	(ieee_get_reloc_upper_bound): Likewise.
	(ieee_canonicalize_reloc): Likewise.
	* mipsbsd.c (MY(canonicalize_reloc)): Likewise.
	* nlmcode.h (nlm_get_symtab_upper_bound): Likewise.
	(nlm_get_symtab): Likewise.
	(nlm_get_reloc_upper_bound): Likewise.
	(nlm_canonicalize_reloc): Likewise.
	* oasys.c (oasys_get_symtab_upper_bound): Likewise.
	(oasys_get_symtab): Likewise.
	(oasys_get_reloc_upper_bound): Likewise.
	(oasys_canonicalize_reloc): Likewise.
	* som.c (som_get_symtab_upper_bound): Likewise.
	(som_get_symtab): Likewise.
	(som_get_reloc_upper_bound): Likewise.
	(som_canonicalize_reloc): Likewise.
	* srec.c (srec_get_symtab_upper_bound): Likewise.
	(srec_get_symtab): Likewise.
	(srec_get_reloc_upper_bound): Define as bfd_0l.
	(srec_canonicalize_reloc): Likewise.
	* tekhex.c (tekhex_get_symtab): Return long, and -1 on errors.
	(tekhex_get_symtab_upper_bound): Likewise.
	(tekhex_get_reloc_upper_bound): Define as bfd_0l.
	(tekhex_canonicalize_reloc): Likewise.
	* libaout.h (NAME(aout,get_symtab_upper_bound)): Change
	declaration to return long.
	(NAME(aout,get_symtab)): Likewise.
	(NAME(aout,canonicalize_reloc)): Likewise.
	(NAME(aout,get_reloc_upper_bound)): Likewise.
	* libcoff-in.h (coff_get_symtab_upper_bound): Likewise.
	(coff_get_symtab): Likewise.
	(coff_get_reloc_upper_bound): Likewise.
	* libecoff.h (ecoff_get_symtab_upper_bound): Likewise.
	(ecoff_get_symtab): Likewise.
	(ecoff_canonicalize_reloc): Likewise.
	* libelf.h (bfd_elf32_get_symtab_upper_bound): Likewise.
	(bfd_elf32_get_symtab): Likewise.
	(bfd_elf32_get_reloc_upper_bound): Likewise.
	(bfd_elf32_canonicalize_reloc): Likewise.
	(bfd_elf64_get_symtab_upper_bound): Likewise.
	(bfd_elf64_get_symtab): Likewise.
	(bfd_elf64_get_reloc_upper_bound): Likewise.
	(bfd_elf64_canonicalize_reloc): Likewise.
	* libnlm.h (nlmNAME(get_symtab_upper_bound)): Likewise.
	(nlmNAME(get_symtab)): Likewise.
	(nlmNAME(get_reloc_upper_bound)): Likewise.
	(nlmNAME(canonicalize_reloc)): Likewise.
	* archive.c (compute_and_write_armap): Use error_return and
	no_memory_return labels rather than freeing information in various
	places.  Change storage, symcount and src_count to long.  Check
	errors from bfd_get_symtab_upper_bound and
	bfd_canonicalize_symtab.
	* bout.c (b_out_relax_section): Change reloc_size to long.  Check
	for errors from bfd_get_reloc_upper_bound and
	bfd_canonicalize_reloc.
	(b_out_get_relocated_section_contents): Likewise.
	* coff-alpha.c (alpha_ecoff_get_relocated_section_contents):
	Likewise.
	* elf32-mips.c: Likewise.
	* elf32-hppa.c (hppa_elf_stub_finish): Likewise.
	(hppa_look_for_stubs_in_section): Check for errors from
	bfd_get_symtab_upper_bound, bfd_canonicalize_symtab, and
	bfd_canonicalize_reloc.
	* ecofflink.c (bfd_ecoff_debug_accumulate_other): Check for errors
	from bfd_get_symtab_upper_bound and bfd_canonicalize_symtab.
	* linker.c (generic_link_read_symbols): Likewise.
	(_bfd_generic_final_link): Check for errors from
	bfd_get_reloc_upper_bound and bfd_canonicalize_reloc.
	* reloc.c (bfd_generic_get_relocated_section_contents): Likewise.
	* reloc16.c (bfd_coff_reloc16_relax_section): Likewise.
	(bfd_coff_reloc16_get_relocated_section_contents): Likewise.
	* libbfd.c (bfd_0l): New function.
	* libbfd-in.h (bfd_0l): Declare.
	* aix386-core.c: Change get_symtab_upper_bound, get_symtab,
	get_reloc_upper_bound, and canonicalize_reloc to use bfd_0l rather
	than bfd_0u.
	* cisco-core.c, hppabsd-core.c, hpux-core.c: Likewise.
	* irix-core.c, osf-core.c, ptrace-core.c, trad-core.c: Likewise.
	* bfd-in2.h: Rebuilt.
	* libbfd.h: Rebuilt.
	* libcoff.h: Rebuilt.

	* nlm32-sparc.c (nlm_sparc_read_reloc): Remove unused variables
	temp and name.
1994-03-30 22:15:07 +00:00
Ian Lance Taylor 4335ce642d * linker.c (_bfd_generic_final_link): Set reloc_count to 0 before
counting relocs.  Set SEC_RELOC flag for any section which has
	relocs.

	* linker.c (_bfd_default_link_order): Handle bfd_data_link_order.

	* linker.c (_bfd_generic_link_add_symbols): Just call
	generic_link_add_symbols.
	(_bfd_generic_link_add_symbols_collect): New function, like
	_bfd_generic_link_add_symbols but also collect constructors and
	destructors by name as collect2 does.
	(generic_link_add_symbols): New function, like old
	_bfd_generic_link_add_symbols but with collect argument.
	(generic_link_add_object_symbols): Take collect argument.
	(generic_link_check_archive_element_no_collect): New function.
	(generic_link_check_archive_element_collect): New function.
	(generic_link_check_archive_element): Take collect argument.
	(generic_link_add_symbol_list): Take collect argument.
	(_bfd_generic_link_add_one_symbol): Rename constructor argument to
	collect.
	* libbfd-in.h (_bfd_generic_link_add_symbols_collect): Declare.
	* libbfd.h: Rebuilt.
1994-03-22 18:18:40 +00:00
Ian Lance Taylor f1cca64780 Support for link_order types which generate relocs in order to
support -Ur in the linker.
	* linker.c (generic_link_add_symbol_list): Remove bitsize argument
	from call to _bfd_generic_link_add_one_symbol.
	(_bfd_generic_link_add_one_symbol): Remove bitsize argument.
	Don't pass bitsize to constructor call back.  Pass BFD_RELOC_CTOR
	instead of bitsize to add_to_set call back.
	(_bfd_generic_final_link): Account for link_order relocs when
	allocating space for relocations.  Handle them in link_order loop.
	(_bfd_generic_reloc_link_order): New function.
	(_bfd_default_link_order): If a reloc_link_order is seen here,
	abort.
	(_bfd_count_link_order_relocs): New function.
	* libbfd-in.h (_bfd_generic_link_add_one_symbol): Remove bitsize
	argument from declaration.
	(_bfd_generic_reloc_link_order): Declare.
	(_bfd_count_link_order_relocs): Declare.
	* libbfd.h: Rebuilt.
	* aoutx.h (aout_link_add_symbols): Remove bitsize argument from
	call to _bfd_generic_link_add_one_symbol.
	(NAME(aout,final_link)): Account for link_order relocs when
	allocating space for relocations.  Handle them after handling all
	input BFDs.
	(aout_link_reloc_link_order): New function.
	* ecoff.c (ecoff_link_add_externals): Remove bitsize argument from
	call to _bfd_generic_link_add_one_symbol.
	(ecoff_bfd_final_link): Account for link_order relocs when
	allocating space for relocations.  Handle them in link_order loop.
	(ecoff_link_write_external): Set the storage class of a defined
	linker created symbol based on the section it is in.  Correct
	bfd_link_hash_weak case to use .sc rather than .st.
	(ecoff_reloc_link_order): New function.
	* coff-alpha.c (alpha_bfd_reloc_type_lookup): Handle
	BFD_RELOC_CTOR.
	* coff-mips.c (mips_bfd_reloc_type_lookup): Likewise.
1994-03-22 00:27:05 +00:00
David MacKenzie 57a1867e6c * Most files:
Replace DEFUN and DEFUN_VOID with K&R-style function definition.
	Indent some of them to GNU standards.

	* aout32.c, archures.c, core.c, cpu-h8300.c, cpu-i960.c,
	cpu-m68k.c, cpu-m88k.c, cpu-mips.c, cpu-vax.c, ctor.c, demo64.c,
	elf32-hppa.h, gen-aout.c, host-aout.c, init.c, libhppa.h,
	libieee.h, liboasys.h, newsos3.c, som.h, stab-syms.c, sunos.c:
	Update copyright years.
1994-03-15 15:13:13 +00:00
Jim Kingdon 80425e6c82 * libbfd-in.h: Remove alloca cruft. It was missing some necessary
cruft (like the #pragma alloca for AIX).
	In addition to that problem, the C alloca calls xmalloc, which
	means checking for being out of memory can't work right.  The
	following changes remove all uses of alloca from BFD.
	* hosts/solaris2.h: Remove alloca cruft.
	* som.c: Replace alloca with a fixed size auto array.
	* aoutx.h, elfcode.h, nlmcode.h, bout.c, coff-alpha.c, ecoff.c,
	ecofflink.c, elf32-hppa.c, elf32-mips.c, linker.c, reloc.c, som.c:
	Replace alloca with malloc and appropriate error checking and
	freeing.
	* linker.c: Replace alloca with obstack_alloc.
	* libbfd.h: Rebuilt.
1994-03-10 02:09:10 +00:00
David MacKenzie 6a5439a91f Eliminate arg from bfd_xmalloc_by_size_t macro, allowing
undoing of obstack parts of last change.
1994-02-05 03:02:32 +00:00
David MacKenzie 0ee3427297 * libbfd.c (bfd_zmalloc): Call bfd_xmalloc instead of malloc.
(bfd_xmalloc, bfd_xmalloc_by_size_t): Functions deleted.
	* libbfd-in.h: Define them as macros calling xmalloc and declare
	xmalloc.
	* libbfd.h: Rebuilt.
	* ecofflink.c hash.c ieee.c opncls.c (obstack_chunk_alloc): Define
	to be xmalloc, not bfd_xmalloc_by_size_t.
1994-02-05 02:46:12 +00:00
David MacKenzie f4bd7a8f0e * opncls.c (_bfd_new_bfd, _bfd_new_bfd_contained_in): Add
"_bfd_" to function names.
	* archive.c (_bfd_create_empty_archive_element_shell),
	libbfd-in.h: Change callers.

	* libbfd.c (bfd_zmalloc): Renamed from zalloc.
	* libbfd.c (bfd_add_to_string_table),
	trad-core.c (trad_unix_core_file_p),
	targets.c (bfd_target_list),
	ptrace-core.c (ptrace_unix_core_file_p),
	opncls.c (new_bfd), libbfd-in.h,
	ieee.c (ieee_make_empty_symbol),
	elf32-hppa.c (hppa_elf_stub_branch_reloc),
	(hppa_elf_stub_reloc): Change callers.
	* libbfd.h: Regenerated.

	* archive.c (_bfd_look_for_bfd_in_cache): Add "_bfd_" to name.
	(_bfd_get_elt_at_filepos),
	coff-rs6000.c (rs6000coff_get_elt_at_filepos), libbfd-in.h:
	Change callers.

	* format.c (bfd_check_format_matches), libbfd-in.h, targets.c,
	elfcode.h (elf_object_p): Rename target_vector to bfd_target_vector
	and default_vector to bfd_default_vector.
	* libbfd.h: Regenerated.
1994-01-25 13:25:26 +00:00
Ian Lance Taylor b59f0276fa * libbfd-in.h (struct artdata): Added tdata field.
(_bfd_add_bfd_to_archive_cache): Declare.
	(_bfd_snarf_ar_hdr): Renamed from snarf_ar_hdr.
	* libbfd.h: Rebuilt.
	* archive.c: Cleaned up some more.
	(_bfd_generic_mkarchive, bfd_generic_archive_p): Initialize
	pointer elements of artdata.
	(_bfd_add_bfd_to_archive_cache): Renamed from add_bfd_to_cache.
	(_bfd_snarf_ar_hdr): Renamed from snarf_ar_hdr.
	(get_extended_arelt_filename, get_elt_at_filepos,
	bfd_construct_extended_name_table, bfd_ar_hdr_from_filesystem,
	compute_and_write_armap): Made static.
	* ecoff.c: Some comment changes.
	(ecoff_slurp_armap): Handle rename of snarf_ar_hdr.  Set
	ardata->tdata to raw_armap.
	(ecoff_archive_p): Initialize pointer elements of artdata.
	* coff-rs6000.c (rs6000coff_get_elt_at_filepos): Handle rename of
	add_bfd_to_cache.
1994-01-03 18:05:19 +00:00
Ian Lance Taylor 2975f1f04f Rebuilt after removal of seclet.c from doc/Makefile.in. 1993-12-30 22:14:19 +00:00
Ian Lance Taylor 4c3721d514 Extensive changes to move the bulk of the linker into BFD so that
more efficient backend code can be written for specific object
	files.  Only existing efficient backend is a.out.
	* seclet.c, seclet.h: Removed.
	* hash.c, linker.c, genlink.h: New files.
	* bfd-in.h: Removed bfd_error_vector.  Declared hash table
	structures and functions.
	(JUMP_TABLE): Removed bfd_seclet_link, added
	bfd_link_hash_table_create, bfd_link_add_symbols and
	bfd_final_link.
	* All backends: Changed accordingly.
	* bfd-in2.h: Rebuilt.
	* bfd.c (struct _bfd): Added link_next and archive_pass fields.
	Removed ld_symbols field.
	(bfd_nonrepresentable_section, bfd_undefined_symbol,
	bfd_reloc_value_truncated, bfd_reloc_is_dangerous,
	bfd_error_vector): Removed.
	(bfd_default_error_trap, bfd_error_trap,
	bfd_error_nonrepresentabltrap): Removed.
	(bfd_get_relocated_section_contents): Pass link_info.  Pass
	link_order instead of seclet.  Pass symbols.
	(bfd_relax_section): Pass link_info.
	(bfd_seclet_link): Removed.
	(bfd_link_hash_table_create, bfd_link_add_symbols,
	bfd_final_link): New macros.
	* libbfd-in.h: If __GNUC__ is defined and alloca is not, define
	alloca as __builtin_alloca.  Declare internal linking functions.
	* libbfd.h: Rebuilt.
	* libbfd.c (bfd_seek): Comment out fseek assertion.  It's worked
	for months.
	* reloc.c (reloc_howto_type): Added error_message argument to
	special_function field.  Changed all callers and all definitions.
	(bfd_get_reloc_size): Make argument a const pointer.
	(bfd_perform_relocation): Add error_message argument to hold
	string set if return value if bfd_reloc_dangerous.  Changed all
	callers.
	(_bfd_final_link_relocate, _bfd_relocate_contents): New functions.
	* section.c (asection): Renamed seclets_head and seclets_tail to
	link_order_head and link_order_tail.
	* targets.c (bfd_target): Replaced seclet argument with link_info
	and link_order and symbols arguments in
	bfd_get_relocated_section_contents.  Added symbols argument to
	bfd_relax_section.  Removed bfd_seclet_link.  Added
	bfd_link_hash_table_create, bfd_link_add_symbols and
	bfd_final_link.
	* libaout.h (struct aoutdata): Added external_syms,
	external_sym_count, external_strings, sym_hashes fields.
	(obj_aout_external_syms, obj_aout_external_sym_count,
	obj_aout_external_strings, obj_aout_sym_hashes): New accessor
	macros.
	(WRITE_HEADERS): Only output symbols if outsymbols is not NULL.
	* aoutx.h: Wrote new back end linker routines.
	(translate_to_native_sym_flags): Return boolean value.  Don't use
	bfd_error_vector.
	(NAME(aout,write_syms)): Return boolean value.  Check return value
	of translate_to_native_sym_flags and bfd_write.
	* aout-target.h (final_link_callback): New function.
	(MY_bfd_final_link): New function.
	* aout-adobe.c (aout_adobe_write_object_contents): Check return
	value of aout_32_write_syms.
	* hp300hpux.c (MY(write_object_contents)): Likewise.
	* i386lynx.c (WRITE_HEADERS): Likewise.
	* libaout.h (WRITE_HEADERS): Likewise.
	* bout.c: Changed functions to use link_info->callbacks rather
	than bfd_error_vector, and link_orders rather than seclets.
	* coff-alpha.c: Likewise.
	* coff-h8300.c: Likewise.
	* coff-h8500.c: Likewise.
	* coff-sh.c: Likewise.
	* coff-z8k.c: Likewise.
	* elf32-hppa.c: Likewise.
	* reloc16.c: Likewise.
	* coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Look
	up _gp in the hash table rather than in outsymbols.
	* coff-a29k.c (a29k_reloc): Pass errors back in new error_message
	argument rather than printing them.
	* coffcode.h (bfd_coff_reloc16_extra_cases): Take link_info and
	link_order arguments rather than seclet.  Changed all uses and
	definitions.
	(bfd_coff_reloc16_estimate): Pass link_info arguments.  Changed
	all uses and definitions.
	* libcoff.h: Rebuilt.
	* ecoff.c (ecoff_get_extr): If symbol is defined by linker, but
	not by ECOFF, make it scAbs.
	(ecoff_bfd_final_link): Renamed from ecoff_bfd_seclet_link and
	rewritten.
	* elf32-mips.c (mips_elf_final_link): Renamed from
	mips_elf_seclet_link and rewritten.
	* elf32-hppa.c (elf32_hppa_stub_description): Added link_info
	field.
	(new_stub, add_stub_by_name, hppa_elf_build_arg_reloc_stub,
	hppa_elf_build_long_branch_stub, hppa_look_for_stubs_in_section):
	Added link_info arguments.  Changed all callers.
	* elfcode.h (elf_slurp_symbol_table): Don't quit if outsymbols is
	not NULL.
	* oasys.c (oasys_write_sections): Return boolean value rather than
	using bfd_error_vector.
	(oasys_write_object_contents): Check return value of
	oasys_write_sections.
	* hosts/std-host.h: Don't declare qsort or strtol.
	* Makefile.in: Rebuild dependencies.
	(BFD_LIBS): Removed seclet.o.  Added hash.o and linker.o.
	(CFILES): Removed seclet.c.  Added hash.c and linker.c.
	(HFILES): Removed seclet.h.  Added genlink.h.
1993-12-30 19:56:50 +00:00
Ian Lance Taylor e2756048da * reloc.c: Use const instead of CONST.
(bfd_perform_relocation): Make variable howto a const pointer.
	* bfd-in2.h, libbfd.h: Rebuilt.
1993-11-08 23:22:49 +00:00
David MacKenzie c188b0bec3 doc cleanup 1993-11-05 19:51:52 +00:00
John Gilmore b5b4294e65 Improve timestamp support in BSD archive files to avoid linker
warnings.

* libbfd.h (struct artdata):  Add armap_timestamp and armap_datepos.
(bfd_flush, bfd_stat):  Add prototypes.
* libbfd.c (bfd_flush):  Add, does fflush on a BFD.
(bfd_stat):  Add, does fstat on a BFD.

* archive.c (_bfd_write_archive_contents): At end of file writing,
verify and possibly update the timestamp in the armap, if a BSD
archive.  FIXME!  Kludge recognizes BSD archive, rather than
vectoring properly.  Should add to xvec.
(compute_and_write_armap):  Move prototype to top, avoid PROTO.
(bsd_write_armap): Save timestamp and file location thereof, when
writing the armap in a BSD file.
(bsd_update_armap_timestamp):  New function to check and
rewrite the timestamp.
1993-09-14 04:13:43 +00:00