aboutsummaryrefslogtreecommitdiff
path: root/bfd/elflink.h
AgeCommit message (Collapse)AuthorFilesLines
1998-07-21 * elf-bfd.h (struct elf_backend_data): Add got_ & plt_header_size.Richard Henderson1-4/+2
* elf32-i386.c (elf_backend_got_header_size): Define. (elf_backend_plt_header_size): Define. * elf32-m68k.c, elf32-mips.c, elf32-ppc.c: Likewise. * elf32-sparc.c, elf64-alpha.c, elf64-sparc.c: Likewise. * elfxx-target.h: Provide a default of zero. * elflink.c (_bfd_elf_create_got_section): Use got_header_size. * elflink.h (elf_gc_common_finalize_got_offsets): Likewise. * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Don't remove a PLT entry from an executable, even if the plt refcount goes to 0.
1998-07-14Tue Jul 14 11:22:21 1998 Andreas Schwab ↵Ian Lance Taylor1-34/+69
<schwab@issan.informatik.uni-dortmund.de> * elf32-m68k.c (elf_m68k_check_relocs): Also reference count R_68K_PCxx and R_68K_xx relocations. Make sure that ELF_LINK_HASH_NEEDS_PLT is always set for a PLT reloc reference. (elf_m68k_gc_sweep_hook): Also reference count R_68K_PCxx and R_68K_xx relocations. (elf_m68k_adjust_dynamic_symbol): Reset the plt offset of a symbol that has no plt entry. (elf_m68k_relocate_section): Ignore the plt offset in a static link. * elflink.h (elf_adjust_dynamic_symbol): Reset the plt offset for an ignored symbol. (elf_gc_common_finalize_got_offsets): Set the got offsets also in a static link. * elf32-m68k.c (R_68K_GNU_VTINHERIT, R_68K_GNU_VTENTRY): New reloc types. (howto_table, reloc_map): Add entries for them. (elf_m68k_check_relocs): Handle them. Implement reference counting for got and plt entries. (elf_m68k_gc_mark_hook, elf_m68k_gc_sweep_hook): New functions. (elf_m68k_adjust_dynamic_symbol): Handle unreferenced plt symbols. (rtype_to_howto_rel, elf_info_to_howto_rel): Delete. (elf_m68k_relocate_section): Handle the new reloc types. (bfd_elf32_bfd_final_link, elf_backend_gc_mark_hook, elf_backend_gc_sweep_hook, elf_backend_can_gc_sections): Define. * elflink.h (elf_link_add_object_symbols): When creating an indirect reference for symbol versioning also copy the plt offset. (elf_fix_symbol_flags): When clearing the ELF_LINK_HASH_NEEDS_PLT flag also reset the plt offset. (elf_link_assign_sym_version): Likewise. (elf_gc_common_finalize_got_offsets): Increment the got offset by the size of the entry in bytes. (elf_gc_allocate_got_offsets): Likewise. Tue Jul 14 11:18:14 1998 Ian Lance Taylor <ian@cygnus.com> * elflink.h (elf_gc_sections): Return true rather than falling off the bottom.
1998-07-01"propogate" -> "propagate"Richard Henderson1-4/+4
1998-06-30ELF Section-level Garbage Collection.Richard Henderson1-9/+553
1998-06-24 * elflink.h (elf_bfd_final_link): Loop over input_bfds using theIan Lance Taylor1-1/+1
link_next field, not the next field.
1998-06-19 * elflink.h (elf_link_output_extsym): Print an error message ifIan Lance Taylor1-0/+5
_bfd_elf_section_from_bfd_section fails.
1998-06-02 * elflink.h (elf_merge_symbol): Don't always set type_change_okIan Lance Taylor1-2/+4
and size_change_ok. (elf_link_add_object_symbols): Set type_change_ok and size_change_ok before calling elf_merge_symbol.
1998-04-22 * Many files: Added gettext invocations around user-visibleTom Tromey1-6/+6
strings. * libbfd-in.h: Added gettext includes and defines. * acconfig.h (ENABLE_NLS, HAVE_CATGETS, HAVE_GETTEXT, HAVE_STPCPY, HAVE_LC_MESSAGES): Define. * configure.in: Call CY_GNU_GETTEXT. Create po/Makefile.in and po/Makefile. * Makefile.am (SUBDIRS): Added po. (POTFILES): New macro. (po/POTFILES.in): New target. (SOURCE_HFILES): New macro. (HFILES): Use it. * po/Make-in, po/POTFILES.in, po/bfd.pot: New files.
1998-03-27Fix gcc -Wall warnings. See ChangeLog for details.Ian Lance Taylor1-6/+6
1997-12-29 * elflink.h (elf_link_assign_sym_version): Change error messageIan Lance Taylor1-1/+1
from "undefined version name" to "undefined versioned symbol name".
1997-12-11 * elflink.h (elf_link_input_bfd): Handle a relocateable link inIan Lance Taylor1-3/+9
which a relocation refers to an indirect or warning symbol.
1997-11-10Mon Nov 10 14:32:40 1997 Andreas Schwab ↵Ian Lance Taylor1-1/+8
<schwab@issan.informatik.uni-dortmund.de> * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Don't crash if a version dependency could not be found.
1997-10-23 * config.bfd (sparc64-*-linux*): New target.Richard Henderson1-2/+2
* elf-bfd.h (struct elf_backend_data): Add plt_alignment member. * elflink.c (_bfd_elf_create_got_section): Set .got alignment based on arch_size. (_bfd_elf_create_dynamic_sections): Likewise for .rel* sections. Set .plt alignment from new plt_alignment. * elflink.h (elf_link_create_dynamic_sections): Set version section alignment to LOG_FILE_ALIGN. * elfxx-target.h (elf_backend_plt_alignment): Provide default. (elfXX_bed): Init plt_alignment. * elf64-sparc.c (sparc64_elf_check_relocs, sparc64_elf_adjust_dynamic_symbol, sparc64_elf_size_dynamic_sections, sparc64_elf_adjust_dynindx, sparc64_elf_finish_dynamic_symbol, sparc64_elf_finish_dynamic_sections): New functions. (sparc64_elf_howto_table): Fix a few name strings. (ELF_DYNAMIC_INTERPRETER): New definition. (sparc64_elf_relocate_section): Handle shared libraries. * elf64-sparc.c (struct plt_template, plt_*_header, plt_*_entry, sparc64_elf_build_plt_entry, sparc64_elf_finish_dynamic_symbol): PLT definitions sparc64-linux originally choose. These will go away soon in favour of the official abi definitions.
1997-10-17 * elflink.h (elf_link_assign_sym_version): For explicitly versionedRichard Henderson1-16/+26
symbols, check globals list before matching on locals.
1997-09-25 * elflink.h (elf_merge_symbol): Don't check the hash creator untilIan Lance Taylor1-5/+5
after we have set *sym_hash.
1997-07-31Wed Jul 30 21:30:35 1997 Andreas Schwab ↵Ian Lance Taylor1-2/+11
<schwab@issan.informatik.uni-dortmund.de> * elflink.h (NAME(bfd_elf,record_link_assignment)): Remove any version info if this symbol came from a dynamic object. (elf_link_add_object_symbols): Set the version info of a symbol only if the object actually contains version definitions and defines this symbol.
1997-06-26 * elflink.h (elf_link_add_object_symbols): When a versionIan Lance Taylor1-0/+4
indirection symbol is overridden, make the original symbol point at the real overriding symbol.
1997-06-26 * elflink.h (elf_link_output_extsym): Use the right section for aIan Lance Taylor1-1/+1
common symbol. * elf32-mips.c (mips_elf_link_output_symbol_hook): If a common symbol was in .scommon, mark it as SHN_MIPS_SCOMMON. PR 12697.
1997-06-25Wed Jun 25 12:43:10 1997 H.J. Lu <hjl@gnu.ai.mit.edu>Ian Lance Taylor1-6/+6
* elflink.h (elf_merge_symbols): Resolve indirect and warning symbols before checking for new symbols.
1997-06-24comment fixIan Lance Taylor1-1/+2
1997-06-24 * elflink.h (elf_merge_symbol): In the case of a new definedIan Lance Taylor1-56/+115
symbol overriding an old defined symbol, return the hash table entry which we modify, even if it is the target of an indirection. (elf_link_add_object_symbols): If the real name of the symbol gets overridden, convert the versioned symbol into an indirect symbol to the real symbol.
1997-06-23 * elflink.h (elf_merge_symbol): New static function, broken out ofIan Lance Taylor1-287/+379
elf_link_add_object_symbols. (elf_link_add_object_symbols): Call it.
1997-06-18revert last patchIan Lance Taylor1-9/+2
1997-06-18 * elflink.h (elf_link_add_object_symbols): Don't let a commonIan Lance Taylor1-2/+9
symbol in a regular object override a common symbol in a shared object if the latter was found via an indirect symbol.
1997-06-16 * elflink.h (NAME(bfd_elf,size_dynamic_sections)): CallIan Lance Taylor1-52/+81
elf_link_assign_sym_version before elf_adjust_dynamic_symbol. (elf_fix_symbol_flags): New static function, broken out of elf_adjust_dynamic_symbol. (elf_adjust_dynamic_symbol): Call elf_fix_symbol_flags. (elf_link_assign_sym_version): Likewise. Permit a symbol to be forced local even if NEEDS_PLT is set. When forcing a symbol to be local, clear NEEDS_PLT. (elf_link_output_extsym): Remove unused local bed.
1997-06-11 * elflink.h (elf_link_output_extsym): Call finish_dynamic_symbolIan Lance Taylor1-11/+18
for a symbol which is being forced to be local. * elf32-i386.c (elf_i386_relocate_section): Write out the relocation value for a GOT reloc for a symbol which is turning into a local symbol. (elf_i386_finish_dynamic_symbol): If a symbol is turning into a local symbol, write out a RELATIVE reloc rather than a GLOB_DAT reloc. * elf32-m68k.c, elf32-sparc.c: Corresponding changes.
1997-06-10(elf_link_add_object_symbols): Also read verneedUlrich Drepper1-63/+58
information by calling `_bfd_elf_slurp_version_tables'. (elf_link_add_object_symbols): For undefined symbols look for version informaiton in the verneed records. (elf_link_add_object_symbols): Use soname of shared object for verneed record if it is available.
1997-06-09Mon Jun 9 12:34:21 1997 Andreas Schwab ↵Ian Lance Taylor1-1/+2
<schwab@issan.informatik.uni-dortmund.de> * elflink.h (elf_link_add_object_symbols): Ignore relocations of sections that will be discarded.
1997-06-06(elf_link_find_version_dependencies): When searchingUlrich Drepper1-1/+1
for known version symbol skip non-matching verdef records, not matching records.
1997-05-16 * elflink.h (elf_link_add_object_symbols): Don't decrease theIan Lance Taylor1-8/+98
alignment of a common symbol. If two symbols that look like common symbols are found in two shared libraries, and the size is different, use the larger size, and warn if --warn-common. If a common symbol overrides a definition in a shared library, set the size to the larger size, and warn if --warn-common.
1997-05-15 * elflink.h (elf_link_add_object_symbols): Consistently treatIan Lance Taylor1-19/+9
uninitialized symbols in shared objects as common symbols.
1997-05-15 * elflink.h (elf_link_add_object_symbols): Force ELF symbol sizeIan Lance Taylor1-0/+9
to common symbol size.
1997-04-17 * elflink.h (elf_link_add_object_symbols): Only subtract theIan Lance Taylor1-3/+3
section VMA from the symbol value if this is a fully linked file.
1997-04-15 * elflink.h (elf_link_add_object_symbols): Don't call check_relocsIan Lance Taylor1-1/+3
if this is a debugging section which we are stripping.
1997-04-03tweak last patchIan Lance Taylor1-9/+33
1997-04-02Revert last patch, and:Ian Lance Taylor1-12/+14
* elflink.h (elf_link_add_object_symbols): Let a common symbol override an uninitialized symbol from a shared library with a smaller size.
1997-04-02 * elflink.h (elf_link_add_object_symbols): When there is a sizeIan Lance Taylor1-5/+9
change, use the larger size. From H.J. Lu <hjl@gnu.ai.mit.edu>.
1997-03-25 * stabs.c (_bfd_link_section_stabs): Copy over the first headerIan Lance Taylor1-3/+3
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-20 * elflink.h (elf_bfd_final_link): Set the value of a sectionIan Lance Taylor1-1/+4
symbol to the section address unless doing a relocateable link.
1997-03-13 * elflink.h (elf_link_add_object_symbols): Don't warn about typeIan Lance Taylor1-2/+4
or size changes because of a weak symbol. PR 11827.
1997-03-13 * elflink.h (elf_link_add_object_symbols): Use extsymoff whenIan Lance Taylor1-34/+146
setting ever. Sanity check the version number. Sort out copying flags and other information when adding an indirect symbol. (NAME(bfd_elf,size_dynamic_sections)): Preserve any dynamic symbols added by the backend. Clear the entire contents of the versym section. (elf_export_symbol): Ignore indirect symbols. (elf_link_output_extsym): Accept a section without an owner in an assert. * elfcode.h (elf_slurp_symbol_table): Add a sanity check on the version count. Correct the allocation of x_versymp.
1997-03-11 From Eric Youngdale <eric@andante.jic.com>:Ian Lance Taylor1-46/+197
* elf-bfd.h (ELF_LINK_FORCED_LOCAL): Define. * elf.c (bfd_elf_print_symbol): Correct errors in last change. * elflink.h (elf_link_add_object_symbols): Handle cases in which a versioned symbol appears in both a regular and a shared object. (elf_link_assign_sym_version): Set ELF_LINK_FORCED_LOCAL when appropriate. Improve error message. (struct elf_outext_info): Rename from elf_finfo_failed. Change all uses. Add localsyms field. (elf_bfd_final_link): When generating a shared library, call elf_link_output_extsym to output all local symbols. (elf_link_output_extsym): Handle symbols which were forced to become local.
1997-03-10 From Eric Youngdale <eric@andante.jic.com>:Ian Lance Taylor1-42/+147
* elf-bfd.h (elf_symbol_type): Add version field. * elfcode.h (elf_slurp_symbol_table): Set version field. * elflink.h (elf_link_add_object_symbols): When creating an indirect symbol for a default version symbol, set DEF_DYNAMIC if appropriate. Set up an indirection from the nondefault version of the symbol as well. (NAME(bfd_elf,size_dynamic_sections)): Call elf_link_assign_sym_version before checking whether there are any versions. Always record the version name as a dynamic symbol. Initialize counters. (elf_link_assign_sym_version): After finding a version, see if a symbol should be forced to local scope. Create a new version definition if appropriate. (elf_link_output_extsym): Correct indirect symbol handling. * elf.c (bfd_elf_print_symbol): Print version information. (bfd_section_from_shdr): Turn version sections into BFD sections. (elf_fake_sections): Only copy cverdefs and cverrefs into sh_info if sh_info is not already set. (_bfd_elf_copy_private_section_data): Copy sh_info for version sections. * elflink.c (_bfd_elf_link_record_dynamic_symbol): Tell _bfd_stringtab_add to copy the name into permanent memory if appropriate.
1997-03-03(elf_link_add_object_symbols): Use correct sh_sizeUlrich Drepper1-4/+4
entry for reading verdef records. Use correct braces for computing increments of extverdaux and exteverdef record pointers.
1997-03-03 * elflink.h (elf_link_find_version_dependencies): Check thatIan Lance Taylor1-0/+1
DEF_REGULAR is not set as well as checking that DEF_DYNAMIC is set.
1997-02-28 * aoutx.h (aout_link_write_symbols): Use bfd_is_local_label_nameIan Lance Taylor1-2/+1
rather than comparing against info->lprefix. * cofflink.c (_bfd_coff_link_input_bfd): Likewise. * elflink.h (elf_link_input_bfd): Likewise. * linker.c (_bfd_generic_link_output_symbols): Likewise. * xcofflink.c (xcoff_link_input_bfd): Likewise.
1997-02-26 * elflink.h (elf_link_input_bfd): Don't skip symbols from sectionsIan Lance Taylor1-3/+5
that have no contents merely because linker_mark is not set.
1997-02-24 From Eric Youngdale <eric@andante.jic.com>:Ian Lance Taylor1-74/+1025
* elflink.h (elf_link_add_archive_symbols): If a default symbol is not found, try looking it up again without the version name. (elf_link_add_object_symbols): Always link against the dynamic symbol table of a dynamic object. When linking against a dynamic object, include version strings in symbol names, and set up version information. Add indirect symbols for default versions. (elf_link_create_dynamic_sections): Add special version sections. (struct elf_assign_sym_version_info): Define. (struct elf_find_verdep_info): Define. (NAME(bfd_elf,size_dynamic_sections)): Add verdefs parameter. Set up version sections. (elf_adjust_dynamic_symbol): Ignore indirect symbols. (elf_link_find_version_dependencies): New static function. (elf_link_assign_sym_version): New static function. (elf_link_renumber_dynsyms): New static function. (struct elf_final_link_info): Add symver_sec field. (elf_bfd_final_link): Initialize finfo.symver_sec. Don't count local symbols of a dynamic object. Handle DT_VER* constants. (elf_link_output_extsym): Simplify BFD_ASSERT checking for a dynamic object. Skip indirect symbols from ELF objects. Remove the version name before choosing a hash bucket. Write out the version information if appropriate. (elf_link_input_bfd): Check for DYNAMIC, not ET_DYN. * bfd-in.h (bfd_elf32_size_dynamic_sections): Update declaration. (bfd_elf64_size_dynamic_sections): Likewise. * bfd-in2.h: Rebuild. * elf-bfd.h (struct elf_link_hash_entry): Add verinfo field. Change elf_link_hash_flags to unsigned short. (ELF_LINK_HIDDEN): Define. (struct elf_obj_tdata): Add fields dynversym_hdr, dynverref_hdr, dynverdef_hdr, dynversym_section, dynverdef_section, dynverref_section, cverdefs, cverrefs, verdef, verref. (elf_dynversym, elf_dynverdef, elf_dynverref): Define. (_bfd_elf_swap_verdef_in, _bfd_elf_swap_verdef_out): Declare. (_bfd_elf_swap_verdaux_in, _bfd_elf_swap_verdaux_out): Declare. (_bfd_elf_swap_verneed_in, _bfd_elf_swap_verneed_out): Declare. (_bfd_elf_swap_vernaux_in, _bfd_elf_swap_vernaux_out): Declare. (_bfd_elf_swap_versym_in, _bfd_elf_swap_versym_out): Declare. (_bfd_elf_slurp_version_tables): Declare. * elf.c (_bfd_elf_swap_verdef_in): New function. (_bfd_elf_swap_verdef_out): Likewise. (_bfd_elf_swap_verdaux_in, _bfd_elf_swap_verdaux_out): Likewise. (_bfd_elf_swap_verneed_in, _bfd_elf_swap_verneed_out): Likewise. (_bfd_elf_swap_vernaux_in, _bfd_elf_swap_vernaux_out): Likewise. (_bfd_elf_swap_versym_in, _bfd_elf_swap_versym_out): Likewise. (_bfd_elf_print_private_bfd_data): Add DT_VER* constants. Print version information if there is any. (_bfd_elf_link_hash_newfunc): Initialize verinfo field. (bfd_section_from_shdr): Handle SHT_GNU_ver* section types. (elf_fake_sections): Handle .gnu.version* section names. (assign_section_numbers): Handle SHT_GNU_ver* section types. (_bfd_elf_slurp_version_tables): New function. * elflink.c (_bfd_elf_link_record_dynamic_symbol): Don't include version name in string entered in dynamic hash table. * elfcode.h: Include fnmatch.h. * elf32-i386.c (elf_i386_relocate_section): Handle a dynamic symbol which was forced to become local. * elf32-m68k.c (elf_m68k_relocate_section): Likewise. * elf32-ppc.c (ppc_elf_relocate_section): Likewise. * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. * elf64-alpha.c (alpha_elf_dynamic_symbol_p): Likewise.
1997-02-15 * elflink.h (elf_link_add_object_symbols): Don't issue a warningIan Lance Taylor1-4/+34
about a symbol defined in a dynamic object if it has already been defined in a regular object.
1997-02-07 * elflink.h (elf_link_input_bfd): If we've discarded a section,Ian Lance Taylor1-2/+7
the output section will be the absolute section; don't print an assertion message for that case when doing a relocateable link. PR 11647.