aboutsummaryrefslogtreecommitdiff
path: root/bfd
AgeCommit message (Collapse)AuthorFilesLines
2015-08-12Remove trailing spaces in bfdH.J. Lu42-238/+238
2015-08-11Properly skip IFUNC relocations in debug sectionsH.J. Lu3-2/+8
Use "continue" instead of "break" to skip IFUNC relocations in debug sections. * elf32-i386.c (elf_i386_relocate_section): Properly skip IFUNC relocations in debug sections. * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
2015-08-12Automatic date update in version.inGDB Administrator1-1/+1
2015-08-11[AArch64] Improve BFD overflow warning message for -fpicJiong Wang2-0/+18
2015-08-11 Jiong Wang <jiong.wang@arm.com> bfd/ * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Improve warning message for R_AARCH64_LD64_GOTPAGE_LO15/R_AARCH64_LD32_GOTPAGE_LO14.
2015-08-11[AArch64]Speed up linking speed by skipping unncessary TLS reloc type checkJiong Wang2-1/+20
2015-08-11 Jiong Wang <jiong.wang@arm.com> bfd/ * elfnn-aarch64.c (IS_AARCH64_TLS_RELAX_RELOC): New. (aarch64_can_relax_tls): Use the new IS_AARCH64_TLS_RELAX_RELOC.
2015-08-11[AArch64] Long branch veneer support far symbol defined by --defsymJiong Wang2-2/+10
2015-08-11 Jiong Wang <jiong.wang@arm.com> bfd/ * bfd/elfnn-aarch64.c (aarch64_type_of_stub): New parameter "sym_sec". Loose the check for symbol from ABS section. (elfNN_aarch64_size_stubs): Pass sym_sec. ld/testsuite/ * ld-aarch64/farcall-b-defsym.s: New test. * ld-aarch64/farcall-bl-defsym.s: Likewise. * ld-aarch64/farcall-b-defsym.d: New expectation. * ld-aarch64/farcall-bl-defsym.d: Likewise.
2015-08-11[AArch64] PR18668, repair long branch veneer for plt stubJiong Wang2-31/+28
2015-08-11 Jiong Wang <jiong.wang@arm.com> bfd/ PR ld/18668 * elfnn-aarch64.c (aarch64_type_of_stub): Update destination for calls go through plt stub. (elfNN_aarch64_final_link_relocate): Adjust code logic for CALL26, JUMP26 relocation to support inserting veneer for call to plt stub. ld/testsuite/ * ld-aarch64/farcall-b-gsym.s: New test. * ld-aarch64/farcall-b-plt.s: Likewise. * ld-aarch64/farcall-bl-plt.s: Likewise. * ld-aarch64/farcall-b-gsym.d: New expect file. * ld-aarch64/farcall-b-plt.d: Likewise. * ld-aarch64/farcall-bl-plt.d: Likewise.
2015-08-11[AArch64][8/8] LD support BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12Jiong Wang3-0/+20
2015-08-11 Jiong Wang <jiong.wang@arm.com> bfd/ * elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12. (aarch64_reloc_got_type): Likewise. (elfNN_aarch64_final_link_relocate): Likewise. (elfNN_aarch64_relocate_section): Likewise. * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise. (_bfd_aarch64_elf_resolve_relocation): Likewise. ld/testsuite/ * ld-aarch64/emit-relocs-529.s: New testcase. * ld-aarch64/emit-relocs-529-overflow.s: Likewise. * ld-aarch64/emit-relocs-86.s: Likewise. * ld-aarch64/emit-relocs-86-overflow.s: Likewise. * ld-aarch64/emit-relocs-529.d: New expectation file. * ld-aarch64/emit-relocs-529-overflow.d: Likewise. * ld-aarch64/emit-relocs-86.d: Likewise. * ld-aarch64/emit-relocs-86-overflow.d: Likewise. * ld-aarch64/aarch64-elf.exp: Run new testcases.
2015-08-11[AArch64][7/8] GAS support BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12Jiong Wang5-0/+31
2015-08-11 Jiong Wang <jiong.wang@arm.com> include/elf/ * aarch64.h (R_AARCH64_P32_TLSLD_ADD_DTPREL_LO12): Define. bfd/ * reloc.c (BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12): New entry. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12. gas/ * config/tc-aarch64.c (reloc_table): New relocation modifiers "dtprel_lo12". (md_apply_fix): Support BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12. (aarch64_force_relocation): Likewise. gas/testsuite/ * gas/aarch64/reloc-dtprel_lo12-1.s: New testcase. * gas/aarch64/reloc-dtprel_lo12-ilp32-1.s: Likewise. * gas/aarch64/reloc-dtprel_lo12-1.d: New expectation file. * gas/aarch64/reloc-dtprel_lo12-ilp32-1.d: Likewise.
2015-08-11[AArch64][6/8] LD support BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NCJiong Wang3-1/+21
2015-08-11 Jiong Wang <jiong.wang@arm.com> bfd/ * elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC. (aarch64_reloc_got_type): Likewise. (elfNN_aarch64_final_link_relocate): Likewise. (elfNN_aarch64_relocate_section): Likewise. (elfNN_aarch64_gc_sweep_hook): Likewise. (elfNN_aarch64_check_relocs): Likewise. * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise. (_bfd_aarch64_elf_resolve_relocation): Likewise. ld/testsuite/ * ld-aarch64/tls-small-ld.s: Update testcase.
2015-08-11[AArch64][5/8] GAS support BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NCJiong Wang5-0/+35
2015-08-11 Jiong Wang <jiong.wang@arm.com> bfd/ * reloc.c (BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC): New entry. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC. gas/ * config/tc-aarch64.c (reloc_table): New relocation modifiers. (md_apply_fix): Support BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC. (aarch64_force_relocation): Likewise. gas/testsuite/ * gas/aarch64/reloc-tlsldm_lo12_nc-1.s: New testcase. * gas/aarch64/reloc-tlsldm_lo12_nc-ilp32-1.s: Likewise. * gas/aarch64/reloc-tlsldm_lo12_nc-1.d: New expectation file. * gas/aarch64/reloc-tlsldm_lo12_nc-ilp32-1.d: Likewise.
2015-08-11[AArch64][3/8] LD support BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21Jiong Wang3-2/+25
2015-08-11 Jiong Wang <jiong.wang@arm.com> bfd/ * elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21. (aarch64_reloc_got_type): Likewise. (elfNN_aarch64_final_link_relocate): Likewise. (elfNN_aarch64_relocate_section): Likewise. (elfNN_aarch64_gc_sweep_hook): Likewise. (elfNN_aarch64_check_relocs): Likewise. * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise. (_bfd_aarch64_elf_resolve_relocation): Likewise. ld/testsuite/ * ld-aarch64/tls-small-ld.s: New file. * ld-aarch64/tls-small-ld.d: Likewise. * ld-aarch64/aarch64-elf.exp: Run new test.
2015-08-11[AArch64][2/8] GAS support BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21Jiong Wang5-0/+34
2015-08-11 Jiong Wang <jiong.wang@arm.com> bfd/ * reloc.c (BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21): New entry. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21. gas/ * config/tc-aarch64.c (reloc_table): New relocation modifiers. (md_apply_fix): Support BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21. (aarch64_force_relocation): Likewise. gas/testsuite/ * gas/aarch64/reloc-tlsldm-page-1.s: New testcase. * gas/aarch64/reloc-tlsldm-page-ilp32-1.s: Likewise. * gas/aarch64/reloc-tlsldm-page-1.d: New expectation file. * gas/aarch64/reloc-tlsldm-page-ilp32-1.d: Likewise.
2015-08-11Skip IFUNC relocations in debug sectionsH.J. Lu3-4/+27
Skip IFUNC relocations in debug sections ignored by ld.so. bfd/ PR ld/18808 * elf32-i386.c (elf_i386_relocate_section): Skip IFUNC relocations in debug sections. * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise. ld/testsuite/ PR ld/18808 * ld-ifunc/ifunc.exp: Add a test for PR ld/18808. * ld-ifunc/pr18808.out: New file. * ld-ifunc/pr18808a.c: Likewise. * ld-ifunc/pr18808b.c: Likewise.
2015-08-11Fix encoding or OpenRisk1000 PC relative relocations.Peter Zotov2-3/+10
PR ld/18759 * elf32-or1k.c (R_OR1K_32_PCREL): Set pcrel_offset to TRUE. (R_OR1K_16_PCREL): Likewise. (R_OR1K_8_PCREL): Likewise.
2015-08-11Fix typo in coff-sh.c.Nick Clifton2-1/+5
PR binutils/18747 * coff-sh.c (_bfd_sh_align_load_span): Fix typo when setting opcode count.
2015-08-11Fix memory access problems discovered when running some binary tools on ↵Nick Clifton3-2/+56
corrupt files. PR binutils/18758 * elf.c (_bfd_elf_setup_sections): Add checks for corrupt section group information. * peicode.h (pe_ILF_make_a_section): Ensure alignment of the used_by_bfd pointer. (pe_ILF_build_a_bfd): Ensure alignment of vars.data pointer.
2015-08-11Fix a typo in _bfd_elf_copy_private_bfd_dataH.J. Lu2-2/+6
* elf.c (_bfd_elf_copy_private_bfd_data): Fix a typo.
2015-08-11Automatic date update in version.inGDB Administrator1-1/+1
2015-08-10Replace hidden with versioned in elf_link_hash_entryH.J. Lu3-47/+107
This patch replaces the "hidden" field with the "versioned" field in elf_link_hash_entry so that we can avoid calling strchr and strrchr if the symbol is unversioned. * elf-bfd.h (elf_symbol_version): New enum. (elf_link_hash_entry): Replace hidden with versioned. * elflink.c (_bfd_elf_merge_symbol): Don't look for symbol version if the symbol is unversioned. Initialize versioned. (_bfd_elf_add_default_symbol): Don't look for symbol version if the symbol is unversioned or hidden. Initialize versioned. (elf_collect_hash_codes): Don't look for symbol version if the symbol is unversioned. (elf_collect_gnu_hash_codes): Likewise. (bfd_elf_gc_mark_dynamic_ref_symbol): Likewise. (_bfd_elf_link_hash_copy_indirect): Check versioned instead of hidden. (elf_link_output_extsym): Likewise.
2015-08-10Automatic date update in version.inGDB Administrator1-1/+1
2015-08-09Automatic date update in version.inGDB Administrator1-1/+1
2015-08-08Automatic date update in version.inGDB Administrator1-1/+1
2015-08-07Check sh_type/sh_flags/sh_addralign/sh_entsize when copying sh_link/sh_infoH.J. Lu2-1/+18
When copying the sh_link and sh_info fields in stripped section headers, we also check if the sh_type, sh_flags, /sh_addralign and sh_entsize fields of the output section match the output. Since --only-keep-debug turns all non-debug sections into SHT_NOBITS sections, the output SHT_NOBITS type matches any input type. bfd/ PR binutils/18785 * elf.c (_bfd_elf_copy_private_bfd_data): When copying the sh_link and sh_info fields in stripped section headers, we also check if the sh_type, sh_flags, /sh_addralign and sh_entsize fields of the output section match the output. Since --only-keep-debug turns all non-debug sections into SHT_NOBITS sections, the output SHT_NOBITS type matches any input type. binutils/testsuite/ PR binutils/18785 * binutils-all/objcopy.exp: Run strip-12. * binutils-all/strip-12.d: New file. * binutils-all/strip-12.s: Likewise.
2015-08-07Properly merge hidden versioned symbolH.J. Lu2-35/+121
The hidden versioned symbol can only be merged with the versioned symbol with the same symbol version. _bfd_elf_merge_symbol should check the symbol version before merging the new hidden versioned symbol with the existing symbol. _bfd_elf_link_hash_copy_indirect can't copy any references to the hidden versioned symbol. We need to bind a symbol locally when linking executable if it is locally defined, hidden versioned, not referenced by shared library and not exported. bfd/ PR ld/18720 * elflink.c (_bfd_elf_merge_symbol): Add a parameter to indicate if the new symbol matches the existing one. The new hidden versioned symbol matches the existing symbol if they have the same symbol version. Update the existing symbol only if they match. (_bfd_elf_add_default_symbol): Update call to _bfd_elf_merge_symbol. (_bfd_elf_link_assign_sym_version): Don't set the hidden field here. (elf_link_add_object_symbols): Override a definition only if the new symbol matches the existing one. (_bfd_elf_link_hash_copy_indirect): Don't copy any references to the hidden versioned symbol. (elf_link_output_extsym): Bind a symbol locally when linking executable if it is locally defined, hidden versioned, not referenced by shared library and not exported. Turn on VERSYM_HIDDEN only if the hidden vesioned symbol is defined locally. ld/testsuite/ PR ld/18720 * ld-elf/indirect.exp: Run tests for PR ld/18720. * ld-elf/pr18720.out: New file. * ld-elf/pr18720a.c: Likewise. * ld-elf/pr18720b.c: Likewise. * ld-elf/pr18720c.c: Likewise.
2015-08-07Automatic date update in version.inGDB Administrator1-1/+1
2015-08-06Automatic date update in version.inGDB Administrator1-1/+1
2015-08-05Change the behaviour of the --only-keep-debug option to objcopy and strip so ↵Nick Clifton2-0/+63
that the sh_link and sh_info fields in stripped section headers are preserved. bfd * elf.c (_bfd_elf_copy_private_bfd_data): Copy the sh_link and sh_info fields of sections whose type has been changed to SHT_NOBITS. bin * doc/binutils.texi: Document that the --only-keep-debug option to strip and objcopy preserves the section headers of stripped sections. tests * binutils-all/objcopy.exp (keep_debug_symbols_and_check_links): New proc. Checks that debug-info-only binaries retain the sh_link field in stripped sections.
2015-08-05Automatic date update in version.inGDB Administrator1-1/+1
2015-08-04Fix stack buffer overflows when parsing corrupt ihex files.Yuriy M. Kaminskiy3-4/+16
PR binutils/18750 * ihex.c (ihex_scan): Fixes incorrect escape sequence in error message and stack overflow when char is signed and \200-\376 was in place of hex digit; also fixes \377 was handled as EOF instead of "incorrect character". (ihex_read_section): Changed for consistency. (ihex_bad_byte): Prevent (now impossible to trigger) stack overflow and incorrect escape sequence handling. * srec.c (srec_bad_byte): Likewise. * readelf.c (process_mips_specific): Fix incorrect escape sequence handling.
2015-08-04Automatic date update in version.inGDB Administrator1-1/+1
2015-08-03Fix ChangeLog for "FAIL: -Bsymbolic-functions" for cris-linux in ldHans-Peter Nilsson1-1/+1
It's bfd_link_info, not elf_link_hash_entry, for the old reference: * elf32-cris.c (cris_elf_relocate_section) (elf_cris_finish_dynamic_symbol, cris_elf_check_relocs) (elf_cris_discard_excess_dso_dynamics): Use SYMBOLIC_BIND, not just bfd_link_info->symbolic, to check if a symbol should be bound symbolically.
2015-08-03Fix "FAIL: -Bsymbolic-functions" for cris-linux in ldHans-Peter Nilsson2-7/+15
* elf32-cris.c (cris_elf_relocate_section) (elf_cris_finish_dynamic_symbol, cris_elf_check_relocs) (elf_cris_discard_excess_dso_dynamics): Use SYMBOLIC_BIND, not just h->symbolic, to check if a symbol should be bound symbolically.
2015-08-03Automatic date update in version.inGDB Administrator1-1/+1
2015-08-02Automatic date update in version.inGDB Administrator1-1/+1
2015-08-01Automatic date update in version.inGDB Administrator1-1/+1
2015-07-31Automatic date update in version.inGDB Administrator1-1/+1
2015-07-30Don't change the default symbol for relocatable linkH.J. Lu2-9/+23
We should change the default symbol for the versioned symbol only when not performing a relocatable link. bfd/ PR ld/18735 * elflink.c (_bfd_elf_add_default_symbol): Add the default symbol if not performing a relocatable link. (elf_link_add_object_symbols): Adjust the default symbol if not performing a relocatable link. ld/testsuite/ PR ld/18735 * ld-elf/pr18735.d: New file. * ld-elf/pr18735.s: Likewise.
2015-07-30Automatic date update in version.inGDB Administrator1-1/+1
2015-07-29Don't set link_info.executable for "ld -r"H.J. Lu2-4/+11
This patch changes "ld -r" not to set link_info.executable. It removes !info->relocatable check for info->executable and adds it for !info->executable in elflink.c. bfd/ * elflink.c (elf_link_add_object_symbols): Remove !info->relocatable check for info->executable. Add !info->relocatable check for !info->executable. (elf_link_output_extsym): Remove !info->relocatable check for info->executable. ld/ * lexsup.c (parse_args): Don't set link_info.executable to TRUE for link_info.relocatable.
2015-07-29bfd/mmo.c (MMIX): Fix massive gcc LTO testsuite failures.Hans-Peter Nilsson2-47/+58
* mmo.c (mmo_write_symbols_and_terminator): Skip symbol-type assignment loop for bfd plugin objects.
2015-07-29Automatic date update in version.inGDB Administrator1-1/+1
2015-07-28Fallout from "Reorder more powerpc64 sections for -z relro"Alan Modra2-4/+17
Commit 23283c1b changed the layout of some bss style sections on powerpc64, but neglected to add a page gap before the third PT_LOAD segment created by this reording. Without a page gap we get two PT_LOAD headers that overlap by one page in memory. That shouldn't be allowed because the dynamic loader will load garbage from the first page of the last segment over the last page of the previous segment. bfd/ * elf.c (_bfd_elf_map_sections_to_segments): Do not make a new segment for loaded sections after nonloaded sections if the sections are on the same page. ld/testsuite/ * ld-powerpc/elfv2so.d: Update
2015-07-28Check for asprintf and vasprintf during configure stage.Iain Buclaw4-0/+37
This should fix some build errors seen on AIX, MinGW, and possibly other non-GNU systems too due to missing asprintf(). bfd/ * configure.in: Add asprintf and vasprintf to AC_CHECK_DECLS. * config.in, configure: Regenerate.
2015-07-28Automatic date update in version.inGDB Administrator1-1/+1
2015-07-27Regenerate configure filesH.J. Lu2-2/+6
bfd/ * configure: Regenerated. binutils/ * configure: Regenerated. gas/ * configure: Regenerated. gold/ * configure: Regenerated. gprof/ * configure: Regenerated. ld/ * configure: Regenerated. opcodes/ * configure: Regenerated.
2015-07-27Fix the address size computation for the MSP430 port.Nick Clifton2-0/+28
* elf32-msp430.c (uses_large_model): New function. (msp430_elf_eh_frame_address_size): New function. (elf_backend_eh_frame_address_size): Define.
2015-07-27[AArch64] Fix extern protected data handlingSzabolcs Nagy2-0/+6
Emit *GLOB_DAT instead of *RELATIVE relocs for protected data in shared objects. This is needed for the fix of glibc bug 17711: https://sourceware.org/bugzilla/show_bug.cgi?id=17711 bfd: PR ld/18705 * elfnn-aarch64.c (elf_backend_extern_protected_data): Define. ld/testsuite: PR ld/18705 * ld-aarch64/protected-data.d: New. * ld-aarch64/protected-data.s: New. * ld-aarch64/aarch64-elf.exp: Add new test.
2015-07-27[ARM] Fix extern protected data handlingSzabolcs Nagy2-0/+6
Emit *GLOB_DAT instead of *RELATIVE relocs for protected data in shared objects. This is needed for the fix of glibc bug 17711: https://sourceware.org/bugzilla/show_bug.cgi?id=17711 bfd: PR ld/18705 * elf32-arm.c (elf_backend_extern_protected_data): Define. ld/testsuite: PR ld/18705 * ld-arm/protected-data.d: New. * ld-arm/protected-data.s: New. * ld-arm/arm-elf.exp: Add new test.
2015-07-27Automatic date update in version.inGDB Administrator1-1/+1