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.
* 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.
* 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.
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.
* 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.
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.
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.
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.
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.
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.
(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.
(_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.
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.
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.
* archures.c, reloc.c, section.c, tekhex.c: Use PARAMS in
declaring pointers to functions.
* cache.c, elf.c: Move static function decls to top, use PARAMS.
* seclet.h: Declare external function with PARAMS.
* libbfd.h: Update, based on changes in source code and chew.
Lints for bfd_reloc_code_type->bfd_reloc_code_real_type, and
correct calling of howto special functions and fixes from Raeburn
for gas<>bfdness
* archures.c: nuke bfd_reloc_code_type
* bout.c, cpu-h8300.c, coff-i960.c, coff-m88k.c: special function lint
* coffcode.h (styp_to_sec_flags): STYP_INFO is marked as
SEC_NEVER_LOAD, various other bfdgas newness
* reloc.c->libbfd.h: change protype of bfd_default_reloc_type_lookup
* targets.c: change jump table vector to above
its prototype will be included in libbfd.h. Change result type
to struct * (rather than equivalent typedef) so it can be used in
the prototype, where they typedef won't be known.
* libbfd.h: Updated version.