aboutsummaryrefslogtreecommitdiff
path: root/bfd
AgeCommit message (Collapse)AuthorFilesLines
2011-03-14daily updateAlan Modra1-1/+1
2011-03-14include/elf/Richard Sandiford4-468/+1231
* arm.h (R_ARM_IRELATIVE): New relocation. bfd/ * reloc.c (BFD_RELOC_ARM_IRELATIVE): New relocation. * bfd-in2.h: Regenerate. * elf32-arm.c (elf32_arm_howto_table_2): Rename existing definition to elf32_arm_howto_table_3 and replace with a single R_ARM_IRELATIVE entry. (elf32_arm_howto_from_type): Update accordingly. (elf32_arm_reloc_map): Map BFD_RELOC_ARM_IRELATIVE to R_ARM_IRELATIVE. (elf32_arm_reloc_name_lookup): Handle elf32_arm_howto_table_3. (arm_plt_info): New structure, split out from elf32_arm_link_hash_entry with an extra noncall_refcount field. (arm_local_iplt_info): New structure. (elf_arm_obj_tdata): Add local_iplt. (elf32_arm_local_iplt): New accessor macro. (elf32_arm_link_hash_entry): Replace plt_thumb_refcount, plt_maybe_thumb_refcount and plt_got_offset with an arm_plt_info. Change tls_type to a bitfield and add is_iplt. (elf32_arm_link_hash_newfunc): Update accordingly. (elf32_arm_allocate_local_sym_info): New function. (elf32_arm_create_local_iplt): Likewise. (elf32_arm_get_plt_info): Likewise. (elf32_arm_plt_needs_thumb_stub_p): Likewise. (elf32_arm_get_local_dynreloc_list): Likewise. (create_ifunc_sections): Likewise. (elf32_arm_copy_indirect_symbol): Update after the changes to elf32_arm_link_hash_entry. Assert the is_iplt has not yet been set. (arm_type_of_stub): Add an st_type argument. Use elf32_arm_get_plt_info to get PLT information. Assert that all STT_GNU_IFUNC references are turned into PLT references. (arm_build_one_stub): Pass the symbol type to elf32_arm_final_link_relocate. (elf32_arm_size_stubs): Pass the symbol type to arm_type_of_stub. (elf32_arm_allocate_irelocs): New function. (elf32_arm_add_dynreloc): In static objects, use .rel.iplt for all R_ARM_IRELATIVE. (elf32_arm_allocate_plt_entry): New function. (elf32_arm_populate_plt_entry): Likewise. (elf32_arm_final_link_relocate): Add an st_type parameter. Set srelgot to null for static objects. Use separate variables to record which st_value and st_type should be used when generating a dynamic relocation. Use elf32_arm_get_plt_info to find the symbol's PLT information, setting has_iplt_entry, splt, plt_offset and gotplt_offset accordingly. Check whether STT_GNU_IFUNC symbols should resolve to an .iplt entry, and change the relocation target accordingly. Broaden assert to include .iplts. Don't set sreloc for static relocations. Assert that we only generate dynamic R_ARM_RELATIVE relocations for R_ARM_ABS32 and R_ARM_ABS32_NOI. Generate R_ARM_IRELATIVE relocations instead of R_ARM_RELATIVE relocations if the target is an STT_GNU_IFUNC symbol. Pass the symbol type to arm_type_of_stub. Conditionally resolve GOT references to the .igot.plt entry. (elf32_arm_relocate_section): Update the call to elf32_arm_final_link_relocate. (elf32_arm_gc_sweep_hook): Use elf32_arm_get_plt_info to get PLT information. Treat R_ARM_REL32 and R_ARM_REL32_NOI as call relocations in shared libraries and relocatable executables. Count non-call PLT references. Use elf32_arm_get_local_dynreloc_list to get the list of dynamic relocations for a local symbol. (elf32_arm_check_relocs): Always create ifunc sections. Set isym at the same time as setting h. Use elf32_arm_allocate_local_sym_info to allocate local symbol information. Treat R_ARM_REL32 and R_ARM_REL32_NOI as call relocations in shared libraries and relocatable executables. Record PLT information for local STT_GNU_IFUNC functions as well as global functions. Count non-call PLT references. Use elf32_arm_get_local_dynreloc_list to get the list of dynamic relocations for a local symbol. (elf32_arm_adjust_dynamic_symbol): Handle STT_GNU_IFUNC symbols. Don't remove STT_GNU_IFUNC PLTs unless all references have been removed. Update after the changes to elf32_arm_link_hash_entry. (allocate_dynrelocs_for_symbol): Decide whether STT_GNU_IFUNC PLT entries should live in .plt or .iplt. Check whether the .igot.plt and .got entries can be combined. Use elf32_arm_allocate_plt_entry to allocate .plt and .(i)got.plt entries. Detect which .got entries will need R_ARM_IRELATIVE relocations and use elf32_arm_allocate_irelocs to allocate them. Likewise other non-.got dynamic relocations. (elf32_arm_size_dynamic_sections): Allocate .iplt, .igot.plt and dynamic relocations for local STT_GNU_IFUNC symbols. Check whether the .igot.plt and .got entries can be combined. Detect which .got entries will need R_ARM_IRELATIVE relocations and use elf32_arm_allocate_irelocs to allocate them. Use stashed section pointers intead of strcmp checks. Handle iplt and igotplt. (elf32_arm_finish_dynamic_symbol): Use elf32_arm_populate_plt_entry to fill in .plt, .got.plt and .rel(a).plt entries. Point STT_GNU_IFUNC symbols at an .iplt entry if non-call relocations resolve to it. (elf32_arm_output_plt_map_1): New function, split out from elf32_arm_output_plt_map. Handle .iplt entries. Use elf32_arm_plt_needs_thumb_stub_p. (elf32_arm_output_plt_map): Call it. (elf32_arm_output_arch_local_syms): Add mapping symbols for local .iplt entries. (elf32_arm_swap_symbol_in): Handle Thumb STT_GNU_IFUNC symbols. (elf32_arm_swap_symbol_out): Likewise. (elf32_arm_add_symbol_hook): New function. (elf_backend_add_symbol_hook): Define for all targets. opcodes/ * arm-dis.c (get_sym_code_type): Treat STT_GNU_IFUNCs as code. gas/ * config/tc-arm.c (md_pcrel_from_section): Use S_FORCE_RELOC to determine whether a relocation is needed. (md_apply_fix, arm_apply_sym_value): Likewise. ld/testsuite/ * ld-arm/ifunc-1.s, ld-arm/ifunc-1.dd, ld-arm/ifunc-1.gd, ld-arm/ifunc-1.rd, ld-arm/ifunc-2.s, ld-arm/ifunc-2.dd, ld-arm/ifunc-2.gd, ld-arm/ifunc-2.rd, ld-arm/ifunc-3.s, ld-arm/ifunc-3.dd, ld-arm/ifunc-3.gd, ld-arm/ifunc-3.rd, ld-arm/ifunc-4.s, ld-arm/ifunc-4.dd, ld-arm/ifunc-4.gd, ld-arm/ifunc-4.rd, ld-arm/ifunc-5.s, ld-arm/ifunc-5.dd, ld-arm/ifunc-5.gd, ld-arm/ifunc-5.rd, ld-arm/ifunc-6.s, ld-arm/ifunc-6.dd, ld-arm/ifunc-6.gd, ld-arm/ifunc-6.rd, ld-arm/ifunc-7.s, ld-arm/ifunc-7.dd, ld-arm/ifunc-7.gd, ld-arm/ifunc-7.rd, ld-arm/ifunc-8.s, ld-arm/ifunc-8.dd, ld-arm/ifunc-8.gd, ld-arm/ifunc-8.rd, ld-arm/ifunc-9.s, ld-arm/ifunc-9.dd, ld-arm/ifunc-9.gd, ld-arm/ifunc-9.rd, ld-arm/ifunc-10.s, ld-arm/ifunc-10.dd, ld-arm/ifunc-10.gd, ld-arm/ifunc-10.rd, ld-arm/ifunc-11.s, ld-arm/ifunc-11.dd, ld-arm/ifunc-11.gd, ld-arm/ifunc-11.rd, ld-arm/ifunc-12.s, ld-arm/ifunc-12.dd, ld-arm/ifunc-12.gd, ld-arm/ifunc-12.rd, ld-arm/ifunc-13.s, ld-arm/ifunc-13.dd, ld-arm/ifunc-13.gd, ld-arm/ifunc-13.rd, ld-arm/ifunc-14.s, ld-arm/ifunc-14.dd, ld-arm/ifunc-14.gd, ld-arm/ifunc-14.rd, ld-arm/ifunc-15.s, ld-arm/ifunc-15.dd, ld-arm/ifunc-15.gd, ld-arm/ifunc-15.rd, ld-arm/ifunc-16.s, ld-arm/ifunc-16.dd, ld-arm/ifunc-16.gd, ld-arm/ifunc-16.rd, ld-arm/ifunc-dynamic.ld, ld-arm/ifunc-static.ld: New tests. * ld-arm/farcall-group.d, ld-arm/farcall-group-size2.d, ld-arm/farcall-mixed-lib-v4t.d, ld-arm/farcall-mixed-lib.d: Update for new stub hashes. * ld-arm/arm-elf.exp: Run them.
2011-03-14include/elf/Richard Sandiford10-102/+158
* internal.h (elf_internal_sym): Add st_target_internal. * arm.h (arm_st_branch_type): New enum. (ARM_SYM_BRANCH_TYPE): New macro. bfd/ * elf-bfd.h (elf_link_hash_entry): Add target_internal. * elf.c (swap_out_syms): Set st_target_internal for each Elf_Internal_Sym. * elfcode.h (elf_swap_symbol_in): Likewise. * elf32-i370.c (i370_elf_finish_dynamic_sections): Likewise. * elf32-sh-symbian.c (sh_symbian_relocate_section): Likewise. * elf64-sparc.c (elf64_sparc_output_arch_syms): Likewise. * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Likewise. * elflink.c (elf_link_output_extsym): Likewise. (bfd_elf_final_link): Likewise. (elf_link_add_object_symbols): Copy st_target_internal to the hash table if we see a definition. (_bfd_elf_copy_link_hash_symbol_type): Copy target_internal. * elf32-arm.c (elf32_arm_stub_hash_entry): Replace st_type with a branch_type field. (a8_erratum_fix, a8_erratum_reloc): Likewise. (arm_type_of_stub): Replace actual_st_type with an actual_branch_type parameter. (arm_build_one_stub): Use branch types rather than st_types to determine the type of branch. (cortex_a8_erratum_scan): Likewise. (elf32_arm_size_stubs): Likewise. (bfd_elf32_arm_process_before_allocation): Likewise. (allocate_dynrelocs_for_symbol): Likewise. (elf32_arm_finish_dynamic_sections): Likewise. (elf32_arm_final_link_relocate): Replace sym_flags parameter with a branch_type parameter. (elf32_arm_relocate_section): Update call accordingly. (elf32_arm_adjust_dynamic_symbol): Don't check STT_ARM_TFUNC. (elf32_arm_output_map_sym): Initialize st_target_internal. (elf32_arm_output_stub_sym): Likewise. (elf32_arm_symbol_processing): Delete. (elf32_arm_swap_symbol_in): Convert STT_ARM_TFUNCs into STT_FUNCs. Use st_target_internal to record the branch type. (elf32_arm_swap_symbol_out): Use st_target_internal to test for Thumb functions. (elf32_arm_is_function_type): Delete. (elf_backend_symbol_processing): Likewise. (elf_backend_is_function_type): Likewise. gas/ * config/tc-arm.c (arm_adjust_symtab): Set the branch type for Thumb symbols. ld/ * emultempl/armelf.em (gld${EMULATION_NAME}_finish): Check eh->target_internal. opcodes/ * arm-dis.c (get_sym_code_type): Don't check for STT_ARM_TFUNC. Use branch types instead. (print_insn): Likewise.
2011-03-14bfd/Richard Sandiford2-9/+15
* elf32-arm.c (elf32_arm_check_relocs): Always assign a dynobj. (elf32_arm_finish_dynamic_sections): Move sgot != NULL assertion into the PLT block. ld/ * emultempl/armelf.em (arm_elf_before_allocation): Check dynobj instead of dynamic_sections_created.
2011-03-14bfd/Richard Sandiford2-164/+198
* elf32-arm.c (elf32_arm_check_relocs): Use call_reloc_p, may_need_local_target_p and may_become_dynamic_p to classify the relocation type. Don't check info->symbolic or h->def_regular when deciding whether to record a potential dynamic reloc. Don't treat potential dynamic relocs as PLT references. (elf32_arm_gc_sweep_hook): Update to match. Assert that we don't try to make the PLT reference count go negative. ld/testsuite/ * ld-arm/arm-lib-plt-2a.s, ld-arm/arm-lib-plt-2b.s, ld-arm/arm-lib-plt-2.dd, ld-arm/arm-lib-plt-2.rd: New tests. * ld-arm/arm-elf.exp: Run them.
2011-03-14bfd/Richard Sandiford2-80/+69
* elf32-arm.c (elf32_arm_final_link_relocate): Always fill in the GOT entry here, rather than leaving it to finish_dynamic_symbol. Only create a dynamic relocation for local references if info->shared. (allocate_dynrelocs_for_symbol): Update dynamic relocation allocation accordingly. (elf32_arm_finish_dynamic_symbol): Don't initialise the GOT entry here. ld/testsuite/ * ld-arm/exec-got-1a.s, ld-arm/exec-got-1b.s, ld-arm/exec-got-1.d, ld-arm/unresolved-1.s, ld-arm/unresolved-1.d, ld-arm/unresolved-1-dyn.d: New tests. * ld-arm/arm-elf.exp: Run them.
2011-03-14bfd/Richard Sandiford2-47/+75
* elf32-arm.c (elf32_arm_allocate_dynrelocs): New function. (elf32_arm_add_dynreloc): Likewise. (elf32_arm_adjust_dynamic_symbol): Use elf32_arm_allocate_dynrelocs to allocate dynamic relocations. (elf32_arm_size_dynamic_sections): Likewise. (allocate_dynrelocs): Likewise. Rename to allocate_dynrelocs_for_symbol. (elf32_arm_final_link_relocate): Use elf32_arm_add_dynreloc to create dynamic relocations. (elf32_arm_finish_dynamic_symbol): Likewise.
2011-03-13daily updateAlan Modra1-1/+1
2011-03-12daily updateAlan Modra1-1/+1
2011-03-12Support TLS x32 GD->IE, GD->LE and LD->LE transitions.H.J. Lu2-20/+71
bfd/ 2011-03-12 H.J. Lu <hongjiu.lu@intel.com> * elf64-x86-64.c (elf_x86_64_check_tls_transition): Supprt TLS x32 GD->IE and GD->LE transitions. (elf_x86_64_relocate_section): Supprt TLS x32 GD->IE, GD->LE and LD->LE transitions. ld/testsuite/ 2011-03-12 H.J. Lu <hongjiu.lu@intel.com> * ld-x86-64/tlsgd4.dd: New. * ld-x86-64/tlsgd4.s: Likewise. * ld-x86-64/tlsgd5.dd: Likewise. * ld-x86-64/tlsgd5a.s: Likewise. * ld-x86-64/tlsgd5b.s: Likewise. * ld-x86-64/tlsgd6.dd: Likewise. * ld-x86-64/tlsgd6a.s: Likewise. * ld-x86-64/tlsgd6b.s: Likewise. * ld-x86-64/tlsld2.dd: Likewise. * ld-x86-64/tlsld2.s: Likewise. * ld-x86-64/x86-64.exp (x86_64tests): Add tlsgd4, libtlsgd5.so, tlsgd5, libtlsgd6.so, tlsgd6 and tlsld2.
2011-03-11daily updateAlan Modra1-1/+1
2011-03-10daily updateAlan Modra1-1/+1
2011-03-10 * elf64-ppc.c (ppc64_elf_relocate_section): Provide section/offsetAlan Modra2-3/+8
for LO_DS error message and correct multiple.
2011-03-10 * elf64-ppc.c (bfd_elf64_bfd_link_just_syms): Define.Alan Modra2-12/+85
(ppc64_elf_link_just_syms): New function. (opd_entry_value): Don't assume big-endian host. (get_r2off): New function. (ppc_build_one_stub, ppc_size_one_stub): Use it here.
2011-03-09daily updateAlan Modra1-1/+1
2011-03-08daily updateAlan Modra1-1/+1
2011-03-07daily updateAlan Modra1-1/+1
2011-03-06daily updateAlan Modra1-1/+1
2011-03-062011-03-05 Michael Snyder <msnyder@vmware.com>Michael Snyder2-0/+5
* compress.c (bfd_compress_section_contents): Check for out of mem.
2011-03-062011-03-06 Michael Snyder <msnyder@vmware.com>Michael Snyder2-1/+5
* elf64-x86-64.c (elf_x86_64_relocate_section): Document that case statement falls through intentionally.
2011-03-062011-03-06 Michael Snyder <msnyder@vmware.com>Michael Snyder2-1/+5
* elf32-i386.c (elf_i386_relocate_section): Document fall through.
2011-03-05daily updateAlan Modra1-1/+1
2011-03-04daily updateAlan Modra1-1/+1
2011-03-04 * archive.c (bsd_write_armap): Don't call stat in deterministicAlan Modra2-16/+18
mode, and don't use st_mtime if stat returns error.
2011-03-042011-03-03 Michael Snyder <msnyder@vmware.com>Michael Snyder2-12/+2
* elf64-x86-64.c (elf_x86_64_relocate_section): Remove dead code.
2011-03-032011-03-03 Michael Snyder <msnyder@vmware.com>Michael Snyder2-1/+3
* coff-x86_64.c (coff_amd64_rtype_to_howto): Fencepost error.
2011-03-032011-03-03 Michael Snyder <msnyder@vmware.com>Michael Snyder2-1/+5
* aoutx.h (aout_final_link): Use sizeof int not sizeof int*. (aout_link_write_other_symbol): Missing break statement.
2011-03-032011-03-03 Michael Snyder <msnyder@vmware.com>Michael Snyder2-1/+3
* dwarf2.c (scan_unit_for_symbols): Stop memory leak.
2011-03-032011-03-03 Michael Snyder <msnyder@vmware.com>Michael Snyder2-1/+7
* archive.c (_bfd_slurp_extended_name_table): Fail if bfd_seek fails.
2011-03-03daily updateAlan Modra1-1/+1
2011-03-03Supprt TLS x32 IE->LE transition.H.J. Lu2-8/+36
bfd/ 2011-03-03 H.J. Lu <hongjiu.lu@intel.com> * elf64-x86-64.c (elf_x86_64_check_tls_transition): Supprt TLS x32 IE->LE transition. (elf_x86_64_relocate_section): Likewise. ld/testsuite/ 2011-03-03 H.J. Lu <hongjiu.lu@intel.com> * ld-x86-64/tlsie4.dd: New. * ld-x86-64/tlsie4.s: Likewise. * ld-x86-64/x86-64.exp (x86_64tests): Add tlsie4.
2011-03-02daily updateAlan Modra1-1/+1
2011-03-02 * elflink.c (is_reloc_section): Remove function.Bernd Schmidt2-31/+11
(get_dynamic_reloc_section_name): Construct string manually.
2011-03-01daily updateAlan Modra1-1/+1
2011-02-28daily updateAlan Modra1-1/+1
2011-02-28ChangeLog libiberty/Kai Tietz9-21/+36
2011-02-28 Kai Tietz <kai.tietz@onevision.com> * filename_cmp.c (filename_ncmp): New function. * functions.texi: Regenerated. ChangeLog include/ 2011-02-28 Kai Tietz <kai.tietz@onevision.com> * filenames.h (filename_ncmp): New prototype. ChangeLog bfd/ 2011-02-28 Kai Tietz <kai.tietz@onevision.com> * archive.c (_bfd_find_nested_archive): Use filename_(n)cmp. (adjust_relative_path): Likewise. (_bfd_construct_extended_name_table): Likewise. * corefile.c (generic_core_file_matches_executable_p): Likewise. * elf32-bfin.c (bfinfdpic_relocate_section): Likewise. * elf32-frv.c (elf32_frv_relocate_section): Likewise. * elf32-spu.c (sort_bfds): Likewise. (spu_elf_auto_overlay): Likewise. * syms.c (_bfd_stab_section_find_nearest_line): Likewise. * xcofflink.c (xcoff_set_import_path): Likewise. * xtensa-isa.c (xtensa_regfile_lookup): Likewise. (xtensa_regfile_lookup_shortname): Likewise.
2011-02-28 PR 12513Alan Modra2-14/+25
* archive.c (bfd_slurp_bsd_armap_f2): Sanity check parsed_size and stringsize. Properly sanity check symdef_count. Remove redundant bfd_release.
2011-02-27daily updateAlan Modra1-1/+1
2011-02-26daily updateAlan Modra1-1/+1
2011-02-262011-02-25 Rafael Ávila de Espíndola <respindola@mozilla.com>Rafael Ávila de Espíndola2-3/+24
* plugin.c (bfd_plugin_object_p): Correctly set the filesize and handle claim_file seeking. Only try to load the plugin once.
2011-02-25daily updateAlan Modra1-1/+1
2011-02-24daily updateAlan Modra1-1/+1
2011-02-23daily updateAlan Modra1-1/+1
2011-02-22daily updateAlan Modra1-1/+1
2011-02-22* elf32-m68k.c (elf_m68k_finish_dynamic_symbol): For a TLS_GDAndreas Schwab2-1/+11
relocation read the value from the second GOT slot.
2011-02-21daily updateAlan Modra1-1/+1
2011-02-20daily updateAlan Modra1-1/+1
2011-02-19daily updateAlan Modra1-1/+1
2011-02-18daily updateAlan Modra1-1/+1
2011-02-17daily updateAlan Modra1-1/+1