summaryrefslogtreecommitdiffstats
path: root/bfd/elflink.c
Commit message (Collapse)AuthorAgeFilesLines
* 2009-06-17 H.J. Lu <hongjiu.lu@intel.com>H.J. Lu2009-06-171-9/+9
| | | | | | | | | | | | | | | | | * elf32-arm.c (create_got_section): Get existing .rela.got section. * elf32-hppa.c (elf32_hppa_create_dynamic_sections): Likewise. * elf32-lm32.c (create_got_section): Likewise. * elf32-m32r.c (create_got_section): Likewise. * elf32-ppc.c (ppc_elf_create_got): Likewise. * elf32-s390.c (create_got_section): Likewise. * elf32-sh.c (create_got_section): Likewise. * elf32-xtensa.c (elf_xtensa_create_dynamic_sections): Likewise. * elf64-s390.c (create_got_section): Likewise. * elfxx-sparc.c (create_got_section): Likewise. * elflink.c (_bfd_elf_create_got_section): Properly initialize the GOT size.
* 2009-06-16 H.J. Lu <hongjiu.lu@intel.com>H.J. Lu2009-06-161-111/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.in (elf): Add elf-ifunc.lo. * configure: Regenerated. * Makefile.in: Likewise. * elf-bfd.h (elf_link_hash_table): Add sgot, sgotplt, srelgot, splt, srelplt, igotplt, iplt, irelplt and irelifunc. * elf32-i386.c (elf_i386_link_hash_table): Remove sgot, sgotplt, srelgot, splt, srelplt, igotplt, iplt, irelplt and irelifunc. (elf_i386_link_hash_table_create): Likewise. (elf_i386_create_dynamic_sections): Likewise. (elf_i386_check_relocs): Likewise. (elf_i386_allocate_dynrelocs): Likewise. (elf_i386_size_dynamic_sections): Likewise. (elf_i386_relocate_section): Likewise. (elf_i386_finish_dynamic_symbol): Likewise. (elf_i386_finish_dynamic_sections): Likewise. (elf_i386_create_got_section): Removed. * elf64-x86-64.c (elf64_x86_64_link_hash_table): Remove sgot, sgotplt, srelgot, splt, srelplt, igotplt, iplt, irelplt and irelifunc. (elf64_x86_64_compute_jump_table_size): Updated. (elf64_x86_64_link_hash_table_create): Likewise. (elf64_x86_64_create_dynamic_sections): Likewise. (elf64_x86_64_check_relocs): Likewise. (elf64_x86_64_allocate_dynrelocs): Likewise. (elf64_x86_64_size_dynamic_sections): Likewise. (elf64_x86_64_relocate_section): Likewise. (elf64_x86_64_finish_dynamic_symbol): Likewise. (elf64_x86_64_finish_dynamic_sections): Likewise. (elf64_x86_64_create_got_section): Removed. * elflink.c (_bfd_elf_create_got_section): Use log_file_align for pointer alignment. Set up section pointers. (_bfd_elf_create_dynamic_sections): Likewise. (_bfd_elf_create_ifunc_sections): Moved to ... * elf-ifunc.c: Here. New. * Makefile.am (BFD32_BACKENDS): Add elf-ifunc.lo. (BFD32_BACKENDS_CFILES): Add elf-ifunc.c. Run "make dep-am".
* bfd/H.J. Lu2009-06-061-50/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2009-06-06 H.J. Lu <hongjiu.lu@intel.com> * elf32-i386.c (elf_i386_link_hash_table): Add irelifunc. (elf_i386_link_hash_table_create): Initialize irelifunc. (elf_i386_check_relocs): Updated. Set up irelifunc for shared objects. (elf_i386_allocate_dynrelocs): Use irelifunc for dynamic relocation for non-GOT reference of STT_GNU_IFUNC symbol in shared objects. (elf_i386_relocate_section): Likewise. * elf64-x86-64.c (elf64_x86_64_link_hash_table): Add irelifunc. (elf64_x86_64_link_hash_table_create): Initialize irelifunc. (elf64_x86_64_check_relocs): Updated. Set up irelifunc for shared objects. (elf64_x86_64_allocate_dynrelocs): Use irelifunc for dynamic relocation for non-GOT reference of STT_GNU_IFUNC symbol in shared objects. (elf64_x86_64_relocate_section): Likewise. * elf-bfd.h (_bfd_elf_create_static_ifunc_sections): Renamed to ... (_bfd_elf_create_ifunc_sections): This. * elflink.c (_bfd_elf_create_static_ifunc_sections): Renamd to ... (_bfd_elf_create_ifunc_sections): This. Create .rel[a].ifunc for shared objects. ld/ 2009-06-06 H.J. Lu <hongjiu.lu@intel.com> * scripttempl/elf.sc: Add .rel.ifunc and .rela.ifunc.
* bfd/H.J. Lu2009-06-011-85/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2009-06-01 H.J. Lu <hongjiu.lu@intel.com> * elf-bfd.h (struct bfd_elf_section_data): Remove indirect_relocs. (_bfd_elf_make_ifunc_reloc_section): Removed. (_bfd_elf_is_ifunc_symbol): Likewise. (_bfd_elf_create_static_ifunc_sections): New. * elflink.c (_bfd_elf_adjust_dynamic_symbol): Move STT_GNU_IFUNC symbol check to ... (elf_link_add_object_symbols): Here. (_bfd_elf_link_hash_hide_symbol): Don't clean plt on STT_GNU_IFUNC symbol. (elf_link_output_extsym): Call elf_backend_finish_dynamic_symbol if a STT_GNU_IFUNC symbol is referenced in a non-shared object. (IFUNC_INFIX): Removed. (get_ifunc_reloc_section_name): Likewise. (_bfd_elf_make_ifunc_reloc_section): Likewise. (_bfd_elf_is_ifunc_symbol): Likewise. (_bfd_elf_create_static_ifunc_sections): New. ld/ 2009-06-01 H.J. Lu <hongjiu.lu@intel.com> * scripttempl/elf.sc (PLT): Add "*(.iplt)". (GOT): Add "*(.igot.plt)a" and "*(.igot)". (GOTPLT): Add "*(.igot)". (__rel_iplt_start): New. (__rel_iplt_end): Likewise. (__rela_iplt_start): Likewise. (__rela_iplt_end): Likewise.
* 2009-05-26 H.J. Lu <hongjiu.lu@intel.com>H.J. Lu2009-05-261-0/+19
| | | | | | | | | | | | | | * elf-bfd.h (_bfd_elf_is_ifunc_symbol): New. * elf32-i386.c (is_indirect_symbol): Renamed to ... * elflink.c (_bfd_elf_is_ifunc_symbol): This. * elf32-i386.c (allocate_dynrelocs): Updated. (elf_i386_relocate_section): Likewise. * elf64-x86-64.c (allocate_dynrelocs): Likewise. (elf64_x86_64_relocate_section): Likewise. * elf64-x86-64.c (is_indirect_symbol): Removed.
* * elflink.c (elf_link_input_bfd): Correct *pindex change in lastAlan Modra2009-05-211-2/+0
| | | | commit.
* * elf-bfd.h (struct elf_backend_dataAlan Modra2009-05-211-26/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | <elf_backend_link_output_symbol_hook>): Return an int. * elf64-ppc.c (ppc64_elf_output_symbol_hook): Return 2 to drop symbols on deleted .opd entries. * elflink.c (elf_link_output_sym): Return without outputting sym if output_symbol_hook returns 2. (elf_link_output_extsym): Don't assign h->indx when symbol discarded. Abort if we must not discard sym. (elf_link_input_bfd): Similarly, don't set finfo->indices for local syms. (bfd_elf_final_link): Adjust elf_link_output_sym calls. * elf-vxworks.c (elf_vxworks_link_output_symbol_hook): Adjust for elf_backend_link_output_symbol_hook return type change. * elf32-arm.c (output_arch_syminfo): Likewise. (elf32_arm_output_map_sym, elf32_arm_output_stub_sym): Likewise. (elf32_arm_output_arch_local_syms): Likewise. * elf32-cr16c.c (elf32_cr16c_link_output_symbol_hook): Likewise. * elf32-score.c (s3_bfd_score_elf_link_output_symbol_hook): Likewise. (bfd_score_elf_link_output_symbol_hook): Likewise. * elf32-score.h (s7_bfd_score_elf_link_output_symbol_hook): Likewise. * elf32-score7.c (s7_bfd_score_elf_link_output_symbol_hook): Likewise. * elf32-sh64.c (sh64_elf_link_output_symbol_hook): Likewise. * elf32-spu.c (spu_elf_output_symbol_hook): Likewise. * elf32-v850.c (v850_elf_link_output_symbol_hook): Likewise. * elf64-hppa.c (elf64_hppa_link_output_symbol_hook): Likewise. * elf64-mmix.c (mmix_elf_link_output_symbol_hook): Likewise. * elf64-sh64.c (sh64_elf64_link_output_symbol_hook): Likewise. * elf64-sparc.c (elf64_sparc_output_arch_syms): Likewise. * elfxx-mips.c (_bfd_mips_elf_link_output_symbol_hook): Likewise. * elfxx-mips.h (_bfd_mips_elf_link_output_symbol_hook): Likewise.
* bfd/ChangeLogDave Korn2009-05-041-76/+2
| | | | | | | | | | | | | | | | | | | | | | | | | * elflink.c (find_version_for_sym): Remove from here, ... * linker.c (bfd_find_version_for_sym): ... rename, replace here, make public and update all callers. * bfd-in2.h: Regenerate. ld/ChangeLog * NEWS: Mention new feature. * ld.texinfo (--version-script): Document extent of PE support. (WIN32): Mention --version-script. Extend auto-export description. * pe-dll.c (process_def_file): Use version script info to filter symbols from auto-export. * testsuite/ld-pe/vers-script-1.d: New file. * testsuite/ld-pe/vers-script-2.d: New file. * testsuite/ld-pe/vers-script-3.d: New file. * testsuite/ld-pe/vers-script-4.d: New file. * testsuite/ld-pe/vers-script-1.ver: New file. * testsuite/ld-pe/vers-script-2.ver: New file. * testsuite/ld-pe/vers-script-3.ver: New file. * testsuite/ld-pe/vers-script-4.ver: New file. * testsuite/ld-pe/vers-script-dll.c: New file. * testsuite/ld-pe/vers-script.exp: New test script.
* include/elfNick Clifton2009-04-301-0/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2009-04-30 Nick Clifton <nickc@redhat.com> * common.h (STT_GNU_IFUNC): Define. elfcpp 2009-04-30 Nick Clifton <nickc@redhat.com> * (enum STT): Add STT_GNU_IFUNC. gas 2009-04-30 Nick Clifton <nickc@redhat.com> * config/obj-elf.c (obj_elf_type): Add support for a gnu_indirect_function type. * config/tc-i386.c (tc_i386_fix_adjustable): Do not adjust fixups against indirect function symbols. * doc/as.texinfo (.type): Document the support for the gnu_indirect_function symbol type. * NEWS: Mention the new feature. gas/testsuite 2009-04-30 Nick Clifton <nickc@redhat.com> * gas/elf/elf.exp: Extend type test to include an ifunc symbol. Provide an alternative test for targets which do not support ifunc symbols. (type.s): Add entry for an ifunc symbol. (type.e): Add ifunc entry to expected symbol dump. (section2.e-armelf): Add entry for ifunc symbol. (type-noifunc.s): New file. (type-noifunc.e): New file. bfd/ 2009-04-30 Nick Clifton <nickc@redhat.com> * elf-bfd.h (struct bfd_elf_section_data): Add indirect_relocs section pointer. (struct elf_obj_data): Add has_ifunc_symbols boolean. * elf.c (swap_out_syms): Convert BSF_GNU_INDIRECT_FUNCTION flags into a STT_GNU_IFUNC symbol type. (_bfd_elf_is_function_type): Accept STT_GNU_IFUNC as a function type. (_bfd_elf_set_osabi): Set the osasbi field to ELFOSABI_LINUX if the binary contains ifunc symbols. * elfcode.h (elf_slurp_symbol_table): Translate the STT_GNU_IFUNC symbol type into a BSF_GNU_INDIRECT_FUNCTION flag. * elf32-i386.c (is_indirect_function): New function. (elf_i386_check_relocs): Create an ifunc output section. (allocate_dynrelocs): Create dynamic relocs in the ifunc output section if necessary. (elf_i386_relocate_section): Emit a reloc against an ifunc symbol if necessary. (elf_i386_add_symbol_hook): New function. Set the has_ifunc_symbols field of the elf_obj_data structure if an ifunc symbol is encountered. (elf_backend_post_process_headers): Define. (elf_backend_add_symbol_hook): Define. (elf_i386_post_process_headers): Rename to elf_i388_fbsd_post_process_headers. * elf64-x86_64.c (IS_X86_64_PCREL_TYPE): New macro. (is_indirect_function): New function. (elf64_x86_64_check_relocs): Create an ifunc output section. (allocate_dynrelocs): Create dynamic relocs in the ifunc output section if necessary. (elf64_x86_64_relocate_section): Emit a reloc against an ifunc symbol if necessary. (elf_i386_add_symbol_hook): Set the has_ifunc_symbols field of the elf_obj_data structure if an ifunc symbol is encountered. (elf_backend_post_process_headers): Define. * elflink.c (_bfd_elf_adjust_dynamic_symbol): Always create a PLT if we have ifunc symbols to handle. (get_ifunc_reloc_section_name): New function. Computes the name for an ifunc section. (_bfd_elf_make_ifunc_reloc_section): New function. Creates a section to hold ifunc relocs. * syms.c (BSF_GNU_INDIRECT_FUNCTION): Define. (bfd_print_symbol_vandf): Handle ifunc symbols. (bfd_decode_symclass): Likewise. * bfd-in2.h: Regenerate. binutils 2009-04-30 Nick Clifton <nickc@redhat.com> * readelf.c (dump_relocations): Display a relocation against an ifunc symbol as if it were a function invocation. (get_symbol_type): Handle STT_GNU_IFUNC. ld 2009-04-30 Nick Clifton <nickc@redhat.com> * NEWS: Mention support for IFUNC symbols. ld/testsuite 2009-04-30 Nick Clifton <nickc@redhat.com> * ld-ifunc: New directory. * ld-ifunc/ifunc.exp: New file: Run the IFUNC tests. * ld-ifunc/prog.c: New file. * ld-ifunc/lib.c: New file.
* bfd/H.J. Lu2009-04-081-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | 2009-04-08 H.J. Lu <hongjiu.lu@intel.com> * elflink.c (elf_link_add_object_symbols): Warn alternate ELF machine code. include/ 2009-04-08 H.J. Lu <hongjiu.lu@intel.com> * bfdlink.h (bfd_link_info): Add warn_alternate_em. ld/ 2009-04-08 H.J. Lu <hongjiu.lu@intel.com> * lexsup.c (option_values): Add OPTION_WARN_ALTERNATE_EM. (ld_options): Likewise. (parse_args): Likewise. * ld.texinfo: Document --warn-alternate-em. * NEWS: Mention --warn-alternate-em.
* 2009-04-07 H.J. Lu <hongjiu.lu@intel.com>H.J. Lu2009-04-071-1/+1
| | | | | | * elflink.c (_bfd_elf_section_already_linked): Add `\n' for info->callbacks->einfo. * linker.c (_bfd_generic_section_already_linked): Likewise.
* * elflink.c (elf_link_input_bfd): Don't try to resolve complexDJ Delorie2009-03-311-1/+2
| | | | relocs when doing a relocatable link.
* PR 9934Nick Clifton2009-03-131-4/+17
| | | | | | | | * elf-bfd.h (NUM_SHDR_ENTRIES): Cope with an empty section. * elflink.c (elf_link_read_relocs_from_section): Use NUM_SHDR_ENTRIES. Gracefully handle the case where there are relocs but no symbol table. * elf32-arm.c (elf32_arm_check_relocs): Likewise.
* PR 9827Nick Clifton2009-02-121-2/+7
| | | | | | * elflink.c (bfd_elf_final_link): When counting the relocations, if the header size has not been set yet then assume that it will match the output section's reloc type.
* binutils/Alan Modra2009-01-311-2/+15
| | | | | | | | | | * NEWS: Mention --as-needed change. ld/ * ld.texinfo (--as-needed): Update. bfd/ * elflink.c (on_needed_list): New function. (elf_link_add_object_symbols): Link in --as-needed libs if they satisfy undefined symbols in other libs.
* 2009-01-29 Daniel Jacobowitz <dan@codesourcery.com>Joseph Myers2009-01-291-1/+1
| | | | | | | Mark Shinwell <shinwell@codesourcery.com> Catherine Moore <clm@codesourcery.com> * elf-attrs.c, elflink.c, elfxx-mips.c: Correct typos in comments.
* PR 6022Alan Modra2009-01-241-92/+83
| | | | | | | * elflink.c (find_version_for_sym): New function split out from, but without export_dynamic test, .. (_bfd_elf_link_assign_sym_version): ..here. (_bfd_elf_export_symbol): Use it.
* * elf-bfd.h (struct elf_assign_sym_version_info): Delete.Alan Modra2009-01-231-21/+47
| | | | | | | | | | | | | | | | | (struct elf_info_failed, struct elf_find_verdep_info): Move to.. * elflink.c: ..here, somewhat modified. * elf-bfd.h (_bfd_elf_add_default_symbol, _bfd_elf_export_symbol, _bfd_elf_link_find_version_dependencies, _bfd_elf_link_assign_sym_version, _bfd_elf_link_size_reloc_section, _bfd_elf_fix_symbol_flags, _bfd_elf_adjust_dynamic_symbol, _bfd_elf_link_sec_merge_syms, bfd_elf_link_mark_dynamic_symbol): Don't declare.. * elflink.c: ..and make static here. (_bfd_elf_link_find_version_dependencies): Adjust for removal of output_bfd from struct elf_find_verdep_info. (_bfd_elf_link_assign_sym_version): Similarly adjust to use struct elf_info_failed. (bfd_elf_size_dynamic_sections): Adjust.
* bfd/H.J. Lu2009-01-141-4/+15
| | | | | | | | | | | | | | | | | | | | 2009-01-14 H.J. Lu <hongjiu.lu@intel.com> PR ld/9727 * elflink.c (elf_gc_sweep): Exclude the group section if the first member of the section group is excluded. ld/testsuite/ 2009-01-14 H.J. Lu <hongjiu.lu@intel.com> PR ld/9727 * ld-elf/group8.s: New. * ld-elf/group8a.d: Likewise. * ld-elf/group8b.d: Likewise. * ld-elf/group9.s: Likewise. * ld-elf/group9a.d: Likewise. * ld-elf/group9b.d: Likewise.
* bfd/Jan Kratochvil2009-01-111-0/+22
| | | | | | | | | * elflink.c (_bfd_elf_section_already_linked): Handle g++-3.4 relocations in `.gnu.linkonce.r.*' referencing its `.gnu.linkonce.t.*'. ld/testsuite/ * ld-elf/linkoncerdiff.d, ld-elf/linkoncerdiff1.s, ld-elf/linkoncerdiff2.s: New.
* 2009-01-03 H.J. Lu <hongjiu.lu@intel.com>H.J. Lu2009-01-031-1/+2
| | | | | | * coff-ppc.c: Add 2009 to Copyright. * elf32-cris.c: Likewise. * elflink.c: Likewise.
* bfd/H.J. Lu2009-01-021-37/+66
| | | | | | | | | | | | | | | | | | | | | 2009-01-02 H.J. Lu <hongjiu.lu@intel.com> PR ld/9679 * elflink.c (elf_merge_st_other): New. (_bfd_elf_merge_symbol): Use it on skipped weak definitions and hide them if needed. (elf_link_add_object_symbols): Updated. ld/testsuite/ 2009-01-02 H.J. Lu <hongjiu.lu@intel.com> PR ld/9679 * ld-elf/pr9679-1.c: New. * ld-elf/pr9679-2.c: Likewise. * ld-elf/pr9679.rd: Likewise. * ld-elf/shared.exp (build_tests): Add test for libpr9679.so.
* bfd/H.J. Lu2009-01-021-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 2009-01-02 H.J. Lu <hongjiu.lu@intel.com> PR ld/9676 * elflink.c (elf_link_add_object_symbols): Update def_dynamic, ref_dynamic and dynamic_def fields when setting def_regular to 1. ld/testsuite/ 2009-01-02 H.J. Lu <hongjiu.lu@intel.com> PR ld/9676 * ld-elf/pr9676-1.c: New. * ld-elf/pr9676-2.c: Likewiswe. * ld-elf/pr9676-3.c: Likewiswe. * ld-elf/pr9676-4.c: Likewiswe. * ld-elf/pr9676.rd: Likewiswe. * ld-elf/shared.exp (build_tests): Add tests for libpr9676-1.a, libpr9676-2.a, libpr9676-3.so, libpr9676-4.so and libpr9676-4a.so. * lib/ld-lib.exp (ar_simple_create): New. (run_ld_link_tests): Support archive. (run_cc_link_tests): Likewiswe.
* Remove STT_IFUNC support.Nick Clifton2008-12-231-74/+0
|
* include/elf/Nick Clifton2008-12-031-0/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * common.h (STT_IFUNC): Define. elfcpp/ * elfcpp.h (enum STT): Add STT_IFUNC. bfd/ * syms.c (struct bfd_symbol): Add new flag BSF_INDIRECT_FUNCTION. Remove redundant flag BFD_FORT_COMM_DEFAULT_VALUE. Renumber flags to remove gaps. (bfd_print_symbol_vandf): Return 'i' for BSF_INDIRECT_FUNCTION. (bfd_decode_symclass): Likewise. * elf.c (swap_out_syms): Translate BSF_INDIRECT_FUNCTION into STT_IFUNC. (elf_find_function): Treat STT_IFUNC in the same way as STT_FUNC. (_bfd_elf_is_function_type): Likewise. * elf32-arm.c (arm_elf_find_function): Likewise. (elf32_arm_adjust_dynamic_symbol): Likewise. (elf32_arm_swap_symbol_in): Likewise. (elf32_arm_additional_program_headers): Likewise. * elf32-i386.c (is_indirect_symbol): New function. (elf_i386_check_relocs): Also generate dynamic relocs for relocations against STT_IFUNC symbols. (allocate_dynrelocs): Likewise. (elf_i386_relocate_section): Likewise. * elf64-x86-64.c (is_indirect_symbol): New function. (elf64_x86_64_check_relocs): Also generate dynamic relocs for relocations against STT_IFUNC symbols. (allocate_dynrelocs): Likewise. (elf64_x86_64_relocate_section): Likewise. * elfcode.h (elf_slurp_symbol_table): Translate STT_IFUNC into BSF_INDIRECT_FUNCTION. * elflink.c (_bfd_elf_adjust_dynamic_reloc_section): Add support for STT_IFUNC symbols. (get_ifunc_reloc_section_name): New function. (_bfd_elf_make_ifunc_reloc_section): New function. * elf-bfd.h (struct bfd_elf_section_data): Add indirect_relocs field. * bfd-in2.h: Regenerate. gas/ * config/obj-elf.c (obj_elf_type): Add support for STT_IFUNC type. * doc/as.texinfo: Document new feature. * NEWS: Mention new feature. gas/testsuite/ * gas/elf/type.s: Add test of STT_IFUNC symbol type. * gas/elf/type.e: Update expected disassembly. * gas/elf/elf.exp: Update grep of symbol types. ld/ * NEWS: Mention new feature. * pe-dll.c (process_def_file): Replace use of redundant BFD_FORT_COMM_DEFAULT_VALUE with 0. * scripttempl/elf.sc: Add .rel.ifunc.dyn and .rela.ifunc.dyn sections. ld/testsuite/ * ld-mips-elf/reloc-1-n32.d: Updated expected output for reloc descriptions. * ld-mips-elf/reloc-1-n64.d: Likewise. * ld-i386/ifunc.d: New test. * ld-i386/ifunc.s: Source file for the new test. * ld-i386/i386.exp: Run the new test.
* include/Alan Modra2008-11-261-33/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | PR 7047 * bfdlink.h (struct bfd_elf_version_expr): Delete "symbol". Add "literal". bfd/ PR 7047 * configure.in: Bump version. * configure: Regenerate. * elflink.c (_bfd_elf_link_assign_sym_version): Continue matching against version nodes when a global match is a wildcard. Similarly continue matching on local wildcard matches, rather than only continuing for "*". Have any global wildcard match override a local wildcard match. Correct logic hiding unversioned symbol. (bfd_elf_size_dynamic_sections): Update for changes to struct bfd_elf_version_expr. ld/ PR 7047 * emultempl/ppc64elf.em (gld${EMULATION_NAME}_new_vers_pattern): Update for changes to struct bfd_elf_version_expr. * ldlang.c (lang_vers_match, version_expr_head_hash): Likewise. (version_expr_head_eq, lang_finalize_version_expr_head): Likewise. (lang_register_vers_node): Likewise. (lang_new_vers_pattern): Likewise. Ensure "literal" is set when no glob chars found in "pattern". (realsymbol): Correct backslash quote logic. * ld.texinfo (VERSION): Warn about global wildcards.
* * elflink.c (is_reloc_section): New function. Returns true if theNick Clifton2008-11-251-0/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | given name matches the name of the reloc-containing section associated with the given section. (get_dynamic_reloc_section_name): New function. Computes the name of the section that contains the dynamic relocs associated with the given section. (_bfd_elf_get_dynamic_reloc_section): New function. Returns a pointer to the section containing the dynamic relocs associated with the given section. (_bfd_elf_make_dynamic_reloc_section): New function. Creates a section to contain the dynamic relocs associated with a given section. * elf-bfd.h: Prototype the new functions. * elf-m10300.c (mn10300_elf_check_relocs): Use new functions. (mn10300_elf_final_link_relocs): Likewise. * elf32-arm.c (reloc_section_p): Delete - replaced by new functions. (elf32_arm_final_link_relocate): Use new functions. (elf32_arm_check_relocs): Likewise. * elf32-cris.c (cris_elf_relocate_section): Likewise. (elf_cris_check_relocs): Likewise. * elf32-hppa.c (elf32_hppa_check_relocs): Likewise. * elf32-i370.c (i370_elf_check_relocs): Likewise. (i370_elf_relocate_section): Likewise. * elf32-i386.c (elf_i386_check_relocs): Likewise. * elf32-m32r.c (m32r_elf_relocate_section): Likewise. (m32r_elf_check_relocs): Likewise. * elf32-m68k.c (elf_m68k_check_relocs): Likewise. * elf32_ppc.c (ppc_elf_check_relocs): Likewise. (ppc_elf_relocate_section): Likewise. * elf32-s390.c (elf_s390_check_relocs): Likewise. * elf32-sh.c (sh_elf_relocate_section): Likewise. (sh_elf_check_relocs): Likewise. * elf32-vax.c (elf_vax_check_relocs): Likewise. (elf_vax_relocate_section): Likewise. * elf64-alpha.c (elf64_alpha_check_relocs): Likewise. * elf64-ppc.c (ppc64_elf_check_relocs): Likewise. * elf64-s390.c (elf_s390_check_relocs): Likewise. * elf64-sh64.c (sh_elf64_relocate_section): Likewise. * elf64-x86-64.c (elf64_x86_64_check_relocs): Likewise. * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise. * elf32-bfin.c (bfin_check_relocs): Remove redundant local variable 'sreloc'. (bfin_relocate_section): Likewise. * elf32-v850.c (v850_elf_check_relocs): Likewise.
* * elf-bfd.h (struct elf_backend_data): New member got_elt_size.Hans-Peter Nilsson2008-11-211-5/+19
| | | | | | | | | | | | (_bfd_elf_default_got_elt_size): Declare. * elflink.c (struct alloc_got_off_arg): Replace member got_elt_size by new member info. (elf_gc_allocate_got_offsets): Adjust for calling bed->got_elt_size to get the element size instead of using a gofarg entry. (bfd_elf_gc_common_finalize_got_offsets): Similar. (_bfd_elf_default_got_elt_size): New function. * elfxx-target.h: New macro elf_backend_got_elt_size. (elfNN_bed): Use it.
* * elflink.c (bfd_elf_final_link): Move code reading relocs to..Alan Modra2008-10-201-16/+1
| | | | | | * elf32-spu.c (spu_elf_count_relocs): ..here. Adjust params. * elf-bfd.h (struct elf_backend_data): Update elf_backend_count_relocs params.
* * elflink.c (bfd_elf_final_link): Use d_ptr rather than d_valAlan Modra2008-10-201-6/+7
| | | | where Elf_Internal_Dyn holds an address.
* bfd/Alan Modra2008-10-031-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | * elf.c (bfd_elf_set_group_contents): Assign sh_info for ld -r when the signature symbol is global. * elflink.c (elf_link_input_bfd): Ensure group signature symbol is output when ld -r. Set group sh_info when local. * linker.c (default_indirect_link_order): Handle group sections specially. ld/ * ldemul.c (ldemul_place_orphan): Add "name" param. * ldemul.h (ldemul_place_orphan): Update prototype. (struct ld_emulation_xfer_struct <place_orphan>): Likewise. * ldlang.c (lang_place_orphans): Generate unique section names here.. * emultempl/elf32.em (place_orphan): ..rather than here. Don't directly use an existing output section statement that has no bfd section. * emultempl/pe.em (place_orphan): Likewise. * emultempl/pep.em (place_orphan): Likewise. * emultempl/beos.em (place_orphan): Adjust. * emultempl/spuelf.em (spu_place_special_section): Adjust place_orphan call. * emultempl/genelf.em (gld${EMULATION_NAME}_after_open): New function. (LDEMUL_AFTER_OPEN): Define.
* * elflink.c (elf_link_add_object_symbols): Don't ignore returnedAlan Modra2008-09-301-2/+3
| | | | value of check_directives.
* * elf.c (_bfd_elf_init_private_section_data): Tweak union copy.Alan Modra2008-09-281-3/+16
| | | | | | (bfd_section_from_shdr): Don't change SHT_GROUP section name. * elflink.c (section_signature): New function. (_bfd_elf_section_already_linked): Use it.
* bfd/H.J. Lu2008-09-161-12/+27
| | | | | | | | | | | | | | | | | | 2008-09-16 H.J. Lu <hongjiu.lu@intel.com> PR ld/6877 * elflink.c (_bfd_elf_merge_symbol): Allow a common symbol to override the function in a shared library. ld/testsuite/ 2008-09-16 H.J. Lu <hongjiu.lu@intel.com> PR ld/6877 * ld-elf/comm1.c: New. * ld-elf/func1.c: Likewise. * ld-elf/shared.exp: Add tests for libfunc1.so and comm1.
* bfd/Jan Kratochvil2008-08-221-1/+1
| | | | | | | | | | Fix PR ld/3290 regression for cross-files DW_FORM_ref_addr relocations. * elflink.c (elf_link_add_object_symbols): Make debug symbols local now only for non-RELOCATABLE targets. ld/testsuite/ * ld-x86-64/dwarfreloc.exp, ld-x86-64/dwarfreloc.rd, ld-x86-64/dwarfreloc1.s, ld-x86-64/dwarfreloc2.s: New test.
* * elf.c (bfd_elf_get_elf_syms): Don't leak memory on error.Alan Modra2008-08-081-6/+22
| | | | | | | * elflink.c (_bfd_elf_link_read_relocs): bfd_release on error. (elf_link_add_object_symbols): Don't leak memory on error. (bfd_elf_size_dynsym_hash_dynstr): Likewise. (elf_fixup_link_order): Free sections.
* bfd/Richard Sandiford2008-08-071-2/+2
| | | | | | | | | | | | | * elf-bfd.h (elf_backend_data): Add a "rela_plts_and_copies_p" field. * elfxx-target.h (elf_backend_rela_plts_and_copies_p): New macro. (elfNN_bed): Use it. * elf.c (_bfd_elf_get_synthetic_symtab): Use rela_plts_and_copies_p instead of default_use_rela_p to choose between ".rel.plt" and ".rela.plt". * elflink.c (_bfd_elf_create_dynamic_sections): Use rela_plts_and_copies_p instead of default_use_rela_p to choose between ".rel.plt" and ".rela.plt", and between ".rel.bss" and ".rela.bss".
* 2008-07-22 Simon Baldwin <simonb@google.com>Chris Demetriou2008-07-221-0/+9
| | | | | * elflink.c (elf_link_output_extsym): Set st_size to zero for symbols from dynamic libraries.
* 2008-07-21 H.J. Lu <hongjiu.lu@intel.com>H.J. Lu2008-07-211-2/+3
| | | | | | PR ld/4424 * elflink.c (_bfd_elf_merge_symbol): Call bed->relocs_compatible to check if 2 inputs are compatible.
* * elf.c (_bfd_elf_get_dynamic_reloc_upper_bound)Daniel Jacobowitz2008-04-291-5/+7
| | | | | | | | | | (_bfd_elf_canonicalize_dynamic_reloc): Find dynamic relocations even if they are not loaded. * elflink.c (_bfd_elf_init_2_index_sections): Set data_index_section first. * ld-arm/symbian-seg1.s, ld-arm/symbian-seg1.d: New files. * ld-arm/arm-elf.exp: Run symbian-seg1.
* * elflink.c (bfd_elf_size_dynamic_sections): Ignore GNU-stack noteAlan Modra2008-04-081-1/+1
| | | | in EXEC_P bfds.
* include/elf/Alan Modra2008-03-131-1/+1
| | | | | | | | | | | | | | | | | | * internal.h (Elf_Internal_Shdr): Change sh_link and sh_info from unsigned long to unsigned int. Change sh_addralign to bfd_vma. Order struct as for external version. bfd/ * elf.c (_bfd_elf_make_section_from_shdr): Remove unnecessary cast. (_bfd_elf_assign_file_position_for_section): Simplify align. (_bfd_elf_init_reloc_shdr): Ensure shift expression wide enough for sh_addralign. (elf_fake_sections, swap_out_syms): Likewise. * elflink.c (bfd_elf_final_link): Likewise. binutils/ * readelf.c: Use %u throughout when printing sh_link or sh_info, %lu when printing sh_addralign. (process_version_sections): Use identical formats when printing all offset and sh_link fields.
* include/elf/Alan Modra2008-03-121-12/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PR 5900 * common.h (SHN_BAD): Delete. (SHN_LORESERVE .. SHN_HIRESERVE): Move to.. * external.h: ..here. * internal.h (SHN_LORESERVE, SHN_HIRESERVE): Define. (SHN_LOPROC, SHN_HIPROC, SHN_LOOS, SHN_HIOS): Define. (SHN_ABS, SHN_COMMON, SHN_XINDEX, SHN_BAD): Define. bfd/ PR 5900 * elf-bfd.h: Include elf/internal.h after elf/external.h. * elfcode.h (elf_swap_symbol_in): Map reserved shndx range. (elf_swap_symbol_out): Adjust SHN_XINDEX test. (elf_swap_ehdr_out): Mask SHN_LORESERVE and SHN_XINDEX to values seen in external structs. (valid_section_index_p): Delete. (elf_object_p): Don't increment section numbers over reserved range. Simplify test for valid sh_link, sh_info and e_shstrndx fields. (elf_write_shdrs_and_ehdr): Mask SHN_LORESERVE and SHN_XINDEX to values seen in external structs. Don't increment section numbers over reserved range. * elf.c (bfd_elf_sym_name): Remove redundant tests on st_shndx. (bfd_section_from_shdr): Likewise. (group_signature): Range check before accessing elf_elfsections. (_bfd_elf_setup_sections): Likewise. (bfd_section_from_shdr): Likewise. (bfd_section_from_shdr): Don't increment section number over reserved sections. (assign_file_positions_for_non_load_sections): Likewise. (assign_file_positions_except_relocs): Likewise. (_bfd_elf_write_object_contents): Likewise. (assign_section_numbers): Likewise. Adjust for changed SHN_*. (prep_headers): Delete unused variable. * elflink.c (bfd_elf_link_record_local_dynamic_symbol): Adjust for changed SHN_* values. (check_dynsym, elf_link_input_bfd): Likewise. (bfd_elf_final_link): Likewise. Don't skip over reserved section range. (elf_fixup_link_order): Check that sh_link field is valid. * elf-hppa.h (elf_hppa_add_symbol_hook): Make "index" unsigned. * elf32-arm.c (elf32_arm_gc_mark_extra_sections): Range check before accesssing elf_elfsections. * elf32-avr.c (elf32_avr_size_stubs): Likewise. * elf32-hppa.c (elf32_hppa_size_stubs): Likewise. * elf32-m68hc1x.c (elf32_m68hc11_size_stubs): Likewise. * elf64-hppa.c (elf64_hppa_check_relocs): Adjust for changed SHN_* defines. Test for SHN_BAD return from _bfd_elf_section_from_bfd_section binutils/ PR 5900 * readelf.c (SECTION_HEADER_INDEX, SECTION_HEADER_NUM): Delete. Remove use throughout file. (SECTION_HEADER): Likewise. (dump_relocations): Don't adjust st_shndx for reserved range. (process_file_header): Mask SHN_XINDEX to values seen in external elf structs. Simplify valid section index tests. (get_32bit_elf_symbols, get_64bit_elf_symbols): Mask SHN_XINDEX. Map reserved st_shndx to internal form. (process_section_groups): Test that group symbol st_shndx is in range, not just non-zero. Delete reserved range check. (get_symbol_index_type): Mask "type" to 16 bits when printing PRC, OS or RSV. gdb/ PR 5900 * elfread.c (elf_symtab_read): Make shndx an unsigned int. * mipsread.c: Include elf/internal.h. (read_alphacoff_dynamic_symtab): Map external reserved sym_shndx to internal range. ld/testsuite/ PR 5900 * ld-elf/sec64k.exp: Update.
* * elf-bfd.h (_bfd_elf_section_from_bfd_section): Update prototype.Alan Modra2008-03-111-55/+42
| | | | | | | | | | | | | | | | | | | | * elf.c (_bfd_elf_section_from_bfd_section): Return unsigned int, SHN_BAD on error. (_bfd_elf_print_private_bfd_data): Test for SHN_BAD result from _bfd_elf_section_from_bfd_section, not -1. (swap_out_syms): Likewise. * elflink.c (elf_link_add_object_symbols): Likewise. (bfd_elf_get_bfd_needed_list): Likewise. (bfd_elf_match_symbols_in_sections): Likewise. (elf_link_add_object_symbols): Don't bother testing for symbols using normal sections before calling bfd_section_from_elf_index. (elf_link_input_bfd, bfd_elf_final_link): Likewise. (bfd_elf_reloc_symbol_deleted_p): Likewise. * elfcode.h (elf_slurp_symbol_table): Likewise. * elf32-spu.c (get_sym_h): Likewise. * elf32-xtensa.c (get_elf_r_symndx_section): Likewise. * elf64-ppc.c (opd_entry_value, get_sym_h, ppc64_elf_edit_toc): Ditto. * elf64-sh64.c (sh_elf64_get_relocated_section_contents): Likewise.
* 2008-03-02 H.J. Lu <hongjiu.lu@intel.com>H.J. Lu2008-03-021-4/+5
| | | | | | PR ld/5789 * elflink.c (_bfd_elf_symbol_refs_local_p): Always return true for hidden and local symbols.
* 2008-02-22 H.J. Lu <hongjiu.lu@intel.com>H.J. Lu2008-02-231-5/+8
| | | | | | PR ld/5788 * elflink.c (elf_create_symbuf): Correct buffer size and position.
* PR 868Nick Clifton2008-02-201-1/+2
| | | | | | | | | | | | | | | | | | | | | | | * libbfd.c (bfd_realloc_or_free): New function. Performs like bfd_realloc, but if the (re)allocation fails, the pointer is freed. * libbfd-in.h: Prototype. * libbfd.h: Regenerate. * bfdio.c (bfd_bwrite): Use the new function. (bfd_seek): Likewise. * bfdwin.c:(bfd_get_file_window): Likewise. * elf-strtab.c (_bfd_elf_strtab_add): Likewise. * elf32-ppc.c (ppc_elf_relax_section): Likewise. * elf32-xtensa.c (vsprintf_msg): Likewise. * mach-o.c (bfd_mach_o_core_fetch_environment): Likewise. * stabs.c (_bfd_link_seciton_stabs): Likewise. * vms-misc.c (_bfd_vms_get_record): Likewise. * vms-tir.c (check_section): Likewise. * vms.c (vms_new_section_hook): Likewise. * elf32-arm.c (elf32_arm_section_map_add): Check that the allocation of sec_data->map succeeded before using it. * elflink.c (elf_link_output_sym): Do not overwrite finfo-> symshndxbuf until it is known that the reallocation succeeded.
* include/Alan Modra2008-02-151-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bfdlink.h (struct bfd_link_hash_table): Delete creator field. (struct bfd_link_info): Add output_bfd. bfd/ * elflink.c: Replace all accesses to hash->creator field with output_bfd->xvec. * cofflink.c: Likewise. * coff-h8300.c: Likewise. * ecoff.c: Likewise. * elf32-m68hc1x.c: Likewise. * elf32-ppc.c: Likewise. * elf64-alpha.c: Likewise. * elf64-ppc.c: Likewise. * elf64-sparc.c: Likewise. * elfxx-mips.c: Likewise. * i386linux.c: Likewise. * m68klinux.c: Likewise. * sparclinux.c: Likewise. * sunos.c: Likewise. * xcofflink.c: Likewise. * linker.c: Likewise. (_bfd_link_hash_table_init): Don't store creator. ld/ * ldmain.h (output_bfd): Delete. * ldmain.c (output_bfd): Delete. Replace all occurrences of output_bfd with link_info.output_bfd. * ldcref.c: Likewise. * ldctor.c: Likewise. * ldemul.c: Likewise. * ldexp.c: Likewise. * ldfile.c: Likewise. * ldlang.c: Likewise. * ldmisc.c: Likewise. * ldwrite.c: Likewise. * pe-dll.c: Likewise. * emultempl/aix.em: Likewise. * emultempl/alphaelf.em: Likewise. * emultempl/armcoff.em: Likewise. * emultempl/armelf.em: Likewise. * emultempl/avrelf.em: Likewise. * emultempl/beos.em: Likewise. * emultempl/elf-generic.em: Likewise. * emultempl/elf32.em: Likewise. * emultempl/gld960.em: Likewise. * emultempl/hppaelf.em: Likewise. * emultempl/irix.em: Likewise. * emultempl/linux.em: Likewise. * emultempl/lnk960.em: Likewise. * emultempl/m68hc1xelf.em: Likewise. * emultempl/mmix-elfnmmo.em: Likewise. * emultempl/mmo.em: Likewise. * emultempl/pe.em: Likewise. * emultempl/pep.em: Likewise. * emultempl/ppc32elf.em: Likewise. * emultempl/ppc64elf.em: Likewise. * emultempl/scoreelf.em: Likewise. * emultempl/sh64elf.em: Likewise. * emultempl/spuelf.em: Likewise. * emultempl/sunos.em: Likewise. * emultempl/vanilla.em: Likewise. * emultempl/vxworks.em: Likewise. * emultempl/xtensaelf.em: Likewise. * emultempl/z80.em: Likewise. * ldlang.c (open_output): Don't return output, instead write link_info_output_bfd directly. * emultempl/alphaelf.em: Replace occurrences of link_info.hash->creator with link_info.output_bfd->xvec. * emultempl/hppaelf.em: Likewise. * emultempl/ppc32elf.em: Likewise. * emultempl/ppc64elf.em: Likewise. * emultempl/spuelf.em: Likewise.
* * elflink.c (compute_bucket_count): Warning fixes.Alan Modra2008-02-141-4/+6
|
* * elflink.c (_bfd_elf_link_output_relocs): Correct error return.Alan Modra2008-01-211-1/+1
|
OpenPOWER on IntegriCloud