aboutsummaryrefslogtreecommitdiff
path: root/bfd
AgeCommit message (Collapse)AuthorFilesLines
2017-09-05Automatic date update in version.inGDB Administrator1-1/+1
2017-09-05Missing relocation R_PPC_VLE_ADDR20 and add VLE flag to details in readelfAlexander Fedotov-B556132-0/+45
include/ * elf/ppc.h (R_PPC_VLE_ADDR20): New relocation. bfd/ * elf32-ppc.c (ppc_elf_howto_raw): Add R_PPC_VLE_ADDR20. (ppc_elf_check_relocs): Handle it. (ppc_elf_vle_split20): New function. (ppc_elf_relocate_section): Handle R_PPC_VLE_ADDR20. binutils/ * readelf.c (get_elf_section_flags): Add VLE. (process_section_headers): Add VLE key to details. gas/ * config/tc-ppc.c (md_parse_option): Handle "mno-vle" flag. (ppc_elf_section_letter): New function. * config/tc-ppc.h (md_elf_section_letter): New. * testsuite/gas/elf/section10.d: Adjust for VLE.
2017-09-04Automatic date update in version.inGDB Administrator1-1/+1
2017-09-03x86-64: Set tlsdesc_plt if GOT_TLS_GDESC_P is trueH.J. Lu2-1/+11
We need to set tlsdesc_plt for x86-64 if GOT_TLS_GDESC_P is true when allocating dynamic relocations so that _bfd_x86_elf_size_dynamic_sections will generate TLSDESC_PLT and TLSDESC_GOT in x86-64 output. bfd/ PR ld/22071 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Set tlsdesc_plt for x86-64 if GOT_TLS_GDESC_P is true. ld/ PR ld/22071 * testsuite/ld-x86-64/pr22071.d: New file. * testsuite/ld-x86-64/pr22071.s: Likewise. * testsuite/ld-x86-64/x86-64.exp: Run pr22071.
2017-09-03PR22067, x86 check_relocs invalid readAlan Modra2-1/+7
PR 22067 * elfxx-x86.h (elf_x86_hash_table): Check is_elf_hash_table first.
2017-09-02Initialize tls_get_addr for x86-64 in one placeH.J. Lu2-2/+6
* elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize tls_get_addr for x86-64 in one place.
2017-09-02Add missing ChangeLog entriesH.J. Lu1-0/+29
2017-09-02Add elf64-x86-64.lo together with elfxx-x86.lo for 64-bit BFDH.J. Lu3-4/+10
Since elfxx-x86.lo needs elf64-x86-64.lo with 64-bit BFD now, add elf64-x86-64.lo together with elfxx-x86.lo to bfd_backends for 64-bit BFD. * configure.ac (bfd_backends): Add elf64-x86-64.lo together with elfxx-x86.lo for 64-bit BFD. * configure: Regenerated.
2017-09-03Automatic date update in version.inGDB Administrator1-1/+1
2017-09-02x86: Add _bfd_x86_elf_size_dynamic_sectionsH.J. Lu4-815/+483
elf_i386_size_dynamic_sections and elf_x86_64_size_dynamic_sections are very similar, except for the followings: 1. elf_i386_size_dynamic_sections checks GOT_TLS_IE and GOT_TLS_IE_BOTH. elf_x86_64_size_dynamic_sections checks only GOT_TLS_IE. Since GOT_TLS_IE_BOTH is never true for x86-64, it is OK to check GOT_TLS_IE for both i386 and x86-64. 2, x86-64 sets tlsdesc_plt, but i386 doesn't. We set tlsdesc_plt only if target_id == X86_64_ELF_DATA. 3. x86-64 has if (s != htab->elf.srelplt) s->reloc_count = 0; and i386 has s->reloc_count = 0; i386 did have if (s != htab->srelplt) s->reloc_count = 0; in the original commit: commit 67a4f2b710581acc83afecff55424af285ecbc28 Author: Alexandre Oliva <aoliva@redhat.com> Date: Wed Jan 18 21:07:51 2006 +0000 But it was removed by commit 5ae0bfb60a576344d7f701605346282c1144499e Author: Richard Sandiford <rdsandiford@googlemail.com> Date: Tue Feb 28 07:16:12 2006 +0000 bfd/ * elf32-i386.c (elf_i386_link_hash_table): Add next_tls_desc_index. (elf_i386_link_hash_table_create): Initialize it. (elf_i386_compute_jump_table_size): Use it instead of srelplt->reloc_count. (allocate_dynrelocs): Likewise. (elf_i386_size_dynamic_sections): Likewise. (elf_i386_relocate_section): Likewise. A later commit: commit e1f987424b7b3f5ac63a2a6ae044a202a44b8ff8 Author: H.J. Lu <hjl.tools@gmail.com> Date: Fri Oct 21 15:13:37 2011 +0000 Put IRELATIVE relocations after JUMP_SLOT. bfd/ 2011-10-21 H.J. Lu <hongjiu.lu@intel.com> PR ld/13302 * elf32-i386.c (elf_i386_link_hash_table): Add next_jump_slot_index and next_irelative_index. (elf_i386_link_hash_table_create): Initialize next_jump_slot_index and next_irelative_index. (elf_i386_allocate_dynrelocs): Increment reloc_count instead of next_tls_desc_index. (elf_i386_size_dynamic_sections): Set next_tls_desc_index and next_irelative_index from reloc_count. (elf_i386_finish_dynamic_symbol): Put R_386_IRELATIVE after R_386_JUMP_SLOT. changed it back to use reloc_count again. So it is correct to use if (s != htab->elf.srelplt) s->reloc_count = 0; for both i386 and x86-64 now. 4. i386 and x86-64 use different DT_XXXs. They are handled by adding them to elf_x86_link_hash_table. With these changes, we can share _bfd_x86_elf_size_dynamic_sections in elf32-i386.c and elf64-x86-64.c. * elf32-i386.c (elf_i386_convert_load): Renamed to ... (_bfd_i386_elf_convert_load): This. Remove static. (elf_i386_size_dynamic_sections): Removed. (elf_backend_size_dynamic_sections): Likewise. * elf64-x86-64.c (elf_x86_64_convert_load): Renamed to ... (_bfd_x86_64_elf_convert_load): This. Remove static. (elf_x86_64_size_dynamic_sections): Removed. (elf_backend_size_dynamic_sections): Likewise. * elfxx-x86.c (_bfd_x86_elf_allocate_dynrelocs): Renamed to ... (elf_x86_allocate_dynrelocs): This. Make it static. (_bfd_x86_elf_allocate_local_dynrelocs): Renamed to ... (elf_x86_allocate_local_dynreloc): This. Make it static. (elf_i386_is_reloc_section): New function. (elf_x86_64_is_reloc_section): Likewise. (_bfd_x86_elf_link_hash_table_create): Initialize convert_load, is_reloc_section, dt_reloc, dt_reloc_sz and dt_reloc_ent. Rearrange got_entry_size initialization. (_bfd_x86_elf_size_dynamic_sections): New function. * elfxx-x86.h (elf_x86_link_hash_table): Add convert_load, is_reloc_section, dt_reloc, dt_reloc_sz and dt_reloc_ent. (_bfd_i386_elf_convert_load): New. (_bfd_x86_64_elf_convert_load): Likewise. (_bfd_x86_elf_size_dynamic_sections): Likewise. (elf_backend_size_dynamic_sections): Likewise. (_bfd_x86_elf_allocate_dynrelocs): Removed. (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
2017-09-02x86: Rearrange fields and update commentsH.J. Lu2-8/+14
* elfxx-x86.h (elf_x86_link_hash_table): Rearrange fields and update comments.
2017-09-02i386: Update sgotplt_jump_table_size settingH.J. Lu2-1/+7
elf_i386_size_dynamic_sections has htab->next_tls_desc_index = htab->elf.srelplt->reloc_count; htab->sgotplt_jump_table_size = htab->next_tls_desc_index * 4; This patch changes it to htab->sgotplt_jump_table_size = elf_x86_compute_jump_table_size (htab) Since elf_x86_compute_jump_table_size is defined as ((htab)->elf.srelplt->reloc_count * (htab)->got_entry_size) there is no change in output. It makes elf_i386_size_dynamic_sections the same as elf_x86_64_size_dynamic_sections. * elf32-i386.c (elf_i386_size_dynamic_sections): Set sgotplt_jump_table_size with elf_x86_compute_jump_table_size.
2017-09-02x86: Define PLT_CIE_LENGTH and PLT_FDE_* in elfxx-x86.hH.J. Lu4-8/+14
Since PLT_CIE_LENGTH, PLT_FDE_LENGTH, PLT_FDE_START_OFFSET and PLT_FDE_LEN_OFFSET are identical in elf32-i386.c and elf64-x86-64.c, they can be defined in elfxx-x86.h. * elf32-i386.c (PLT_CIE_LENGTH, PLT_FDE_LENGTH, PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Moved to ... * elfxx-x86.h (PLT_CIE_LENGTH, PLT_FDE_LENGTH, PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Here. * elf64-x86-64.c (PLT_CIE_LENGTH, PLT_FDE_LENGTH, PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Removed.
2017-09-02x86: Add _bfd_x86_elf_allocate_dynrelocsH.J. Lu5-862/+502
Share _bfd_x86_elf_allocate_dynrelocs in elf32-i386.c and elf64-x86-64.c. * elf32-i386.c (elf_i386_allocate_dynrelocs): Removed. (elf_i386_allocate_local_dynrelocs): Likewise. (elf_i386_size_dynamic_sections): Replace elf_i386_allocate_dynrelocs/elf_i386_allocate_local_dynrelocs with _bfd_x86_elf_allocate_dynrelocs and _bfd_x86_elf_allocate_local_dynrelocs. * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Removed. (elf_x86_64_allocate_local_dynrelocs): Likewise. (elf_x86_64_size_dynamic_sections): Replace elf_x86_64_allocate_dynrelocs/elf_x86_64_allocate_local_dynrelocs with _bfd_x86_elf_allocate_dynrelocs and _bfd_x86_elf_allocate_local_dynrelocs. * elfxx-x86.c (_bfd_x86_elf_allocate_dynrelocs): New function. (_bfd_x86_elf_allocate_local_dynrelocs): Likewise. * elfxx-x86.h (_bfd_x86_elf_allocate_dynrelocs): New prototype. (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
2017-09-02x86: Add is_x86_elfH.J. Lu5-20/+35
Share is_x86_elf in elf32-i386.c and elf64-x86-64.c. * elf32-i386.c (is_i386_elf): Removed. (elf_i386_check_relocs): Replace is_i386_elf with is_x86_elf. (elf_i386_size_dynamic_sections): Likewise. (elf_i386_relocate_section): Likewise. * elf64-x86-64.c (is_x86_64_elf): Removed. (elf_x86_64_check_relocs): Replace is_x86_64_elf with is_x86_elf. (elf_x86_64_size_dynamic_sections): Likewise. (elf_x86_64_relocate_section): Likewise. * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize target_id. * elfxx-x86.h (elf_x86_link_hash_table): Add target_id. (is_x86_elf): New.
2017-09-02x86: Add elf_x86_compute_jump_table_sizeH.J. Lu5-11/+29
Share elf_x86_compute_jump_table_size in elf32-i386.c and elf64-x86-64.c. * elf32-i386.c (elf_i386_compute_jump_table_size): Removed. (elf_i386_allocate_dynrelocs): Replace elf_i386_compute_jump_table_size with elf_x86_compute_jump_table_size. (elf_i386_size_dynamic_sections): Likewise. * elf64-x86-64.c (elf_x86_64_compute_jump_table_size): Removed. (elf_x86_64_allocate_dynrelocs): Replace elf_x86_64_compute_jump_table_size with elf_x86_compute_jump_table_size. (elf_x86_64_size_dynamic_sections): Likewise. * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize got_entry_size. * elfxx-x86.h (elf_x86_link_hash_table): Add got_entry_size. (elf_x86_compute_jump_table_size): New.
2017-09-02x86: Add sizeof_reloc to elf_x86_link_hash_tableH.J. Lu3-3/+12
Initialize htab->sizeof_reloc once, instead of computing it every time. * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize sizeof_reloc. (_bfd_x86_elf_adjust_dynamic_symbol): Use sizeof_reloc. * elfxx-x86.h (elf_x86_link_hash_table): Add sizeof_reloc.
2017-09-02i386: Check VxWorks with htab->is_vxworksH.J. Lu2-15/+17
* elf32-i386.c (elf_i386_allocate_dynrelocs): Check VxWorks with htab->is_vxworks. (elf_i386_size_dynamic_sections): Likewise. (elf_i386_relocate_section): Likewise. (elf_i386_finish_dynamic_symbol): Likewise. (elf_i386_finish_dynamic_sections): Likewise.
2017-09-02x86: Move GOT_TLS_* in elf32-i386.c to elfxx-x86.hH.J. Lu4-28/+25
elf64-x86-64.c can use GOT_TLS_* definitions in elf32-i386.c with GOT_TLS_IE_POS, GOT_TLS_IE_NEG and GOT_TLS_IE_BOTH unused. * elf32-i386.c (GOT_TLS_IE, GOT_TLS_IE_POS, GOT_TLS_IE_NEG, GOT_TLS_IE_BOTH, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P, GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Moved to ... * elfxx-x86.h (GOT_TLS_IE, GOT_TLS_IE_POS, GOT_TLS_IE_NEG, GOT_TLS_IE_BOTH, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P, GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Here. * elf64-x86-64.c (GOT_TLS_IE, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P, GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Removed.
2017-09-01x86-64: Check ELF_COMMON_DEF_P for common symbolsH.J. Lu2-1/+7
bfd/ PR ld/22064 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Check ELF_COMMON_DEF_P for common symbols. ld/ PR ld/22064 * testsuite/ld-x86-64/pr22064a.S: New file. * testsuite/ld-x86-64/pr22064b.c: Likewise. * testsuite/ld-x86-64/x86-64.exp: Run PR ld/22064 test.
2017-09-02-Og warning fixesAlan Modra4-3/+9
Found when building with gcc 4.9.4 using -Og. bfd/ * elf-eh-frame.c (offset_adjust): Avoid false positive gcc warning. * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Likewise. * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise. ld/ * emultempl/msp430.em (eval_upper_either_sections): Make base_sec_name a const char*. (eval_lower_either_sections): Likewise. (msp430_elf_after_allocation): Likewise, and don't needlessly concat and free. Warning fix.
2017-09-02Automatic date update in version.inGDB Administrator1-1/+1
2017-09-01x86: Add _bfd_x86_elf_gc_mark_hookH.J. Lu5-44/+44
Since R_X86_64_GNU_VTINHERIT == R_386_GNU_VTINHERIT and R_X86_64_GNU_VTENTRY == R_386_GNU_VTENTRY, we can share _bfd_x86_elf_gc_mark_hook in elf32-i386.c and elf64-x86-64.c. * elf32-i386.c (elf_i386_gc_mark_hook): Removed. (elf_backend_gc_mark_hook): Likewise. * elf64-x86-64.c (elf_x86_64_gc_mark_hook): Likewise. (elf_backend_gc_mark_hook): Likewise. * elfxx-x86.c (_bfd_x86_elf_gc_mark_hook): New function. * elfxx-x86.h (_bfd_x86_elf_gc_mark_hook): New. (elf_backend_gc_mark_hook): Likewise.
2017-09-01x86: Add _bfd_x86_elf_adjust_dynamic_symbolH.J. Lu5-389/+228
Share _bfd_x86_elf_adjust_dynamic_symbol in elf32-i386.c and elf64-x86-64.c. * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Removed. (elf_backend_adjust_dynamic_symbol): Likewise. * elf64-x86-64.c (elf_x86_64_adjust_dynamic_symbol): Likewise. (elf_backend_adjust_dynamic_symbol): Likewise. * elfxx-x86.c (_bfd_x86_elf_adjust_dynamic_symbol): New function. (_bfd_x86_elf_link_setup_gnu_properties): Copy is_vxworks. * elfxx-x86.h (elf_x86_link_hash_table): Add is_vxworks. (_bfd_x86_elf_adjust_dynamic_symbol): New. (elf_backend_adjust_dynamic_symbol): Likewise.
2017-09-01Correct ChangeLog entryH.J. Lu1-1/+1
2017-09-01elfxx-x86.h: Fix a typo in commentsH.J. Lu2-1/+6
* elfxx-x86.h (elf_x86_plt_layout_table): Fix a typo in comments.
2017-09-01x86: Add _bfd_x86_elf_mkobjectH.J. Lu5-20/+27
Share _bfd_x86_elf_mkobject in elf32-i386.c and elf64-x86-64.c. * elf32-i386.c (elf_i386_mkobject): Removed. (bfd_elf32_mkobject): Likewise. * elf64-x86-64.c (elf_x86_64_mkobject): Likewise. (bfd_elf64_mkobject): Likewise. (bfd_elf32_mkobject): Likewise. * elfxx-x86.c (_bfd_x86_elf_mkobject): New function. (_bfd_x86_elf_mkobject): New. (bfd_elf64_mkobject): Likewise. (bfd_elf32_mkobject): Likewise.
2017-09-01x86: Add _bfd_x86_elf_link_setup_gnu_propertiesH.J. Lu5-717/+494
Extract the common parts of elf_i386_link_setup_gnu_properties and elf_x86_64_link_setup_gnu_properties into a new function. For x86-64, since PIC PLT layouts are the same as non-PIC PLT layouts, initialize pic_plt0_entry and pic_plt_entry fields in PLT layouts with the non-PIC PLT entries. * elf32-i386.c (elf_i386_link_setup_gnu_properties): Updated. Call _bfd_x86_elf_link_setup_gnu_properties. * elf64-x86-64.c (elf_x86_lazy_plt_layout): Initialize pic_plt0_entry and pic_plt_entry fields with the non-PIC PLT entries. (elf_x86_64_non_lazy_plt): Likewise. (elf_x86_64_lazy_bnd_plt): Likewise. (elf_x86_64_non_lazy_bnd_plt): Likewise. (elf_x86_64_lazy_ibt_plt): Likewise. (elf_x32_lazy_ibt_plt): Likewise. (elf_x86_64_non_lazy_ibt_plt): Likewise. (elf_x32_non_lazy_ibt_plt): Likewise. (elf_x86_64_nacl_plt): Likewise. (elf_x86_64_link_setup_gnu_properties): Updated. Call _bfd_x86_elf_link_setup_gnu_properties. * elfxx-x86.c: Include elf-vxworks.h". (_bfd_x86_elf_link_setup_gnu_properties): New function. * elfxx-x86.h (elf_x86_lazy_plt_layout): Remove "for i386 only" comments for pic_plt0_entry and pic_plt_entry. (elf_x86_non_lazy_plt_layout): Likewise. (elf_x86_plt_layout_table): New. (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
2017-09-01x86: Correct unwind information for the second PLTH.J. Lu3-2/+25
For i386, generate unwind information for the second PLT. For x32, correct alignment of .eh_frame section for the second PLT. bfd/ PR ld/22061 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Create .eh_frame section for the second PLT. * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Correct alignment of .eh_frame section for the second PLT. ld/ PR ld/22061 * testsuite/ld-i386/ibt-plt-1.d: Updated. * testsuite/ld-i386/ibt-plt-2a.d: Likewise. * testsuite/ld-i386/ibt-plt-2c.d: Likewise. * testsuite/ld-i386/ibt-plt-3a.d: Likewise. * testsuite/ld-i386/ibt-plt-3c.d: Likewise. * testsuite/ld-x86-64/ibt-plt-1-x32.d: Likewise. * testsuite/ld-x86-64/ibt-plt-2a-x32.d: Likewise. * testsuite/ld-x86-64/ibt-plt-2c-x32.d: Likewise. * testsuite/ld-x86-64/ibt-plt-3a-x32.d: Likewise. * testsuite/ld-x86-64/ibt-plt-3c-x32.d: Likewise. * testsuite/ld-i386/ibt-plt-2b.d: Pass --hash-style=sysv to ld and dump unwind information. * testsuite/ld-i386/ibt-plt-2d.d: Likewise. * testsuite/ld-i386/ibt-plt-3b.d: Likewise. * testsuite/ld-i386/ibt-plt-3d.d: Likewise. * testsuite/ld-x86-64/ibt-plt-2b-x32.d: Likewise. * testsuite/ld-x86-64/ibt-plt-2b.d: Likewise. * testsuite/ld-x86-64/ibt-plt-2d-x32.d: Likewise. * testsuite/ld-x86-64/ibt-plt-2d.d: Likewise. * testsuite/ld-x86-64/ibt-plt-3b-x32.d: Likewise. * testsuite/ld-x86-64/ibt-plt-3b.d: Likewise. * testsuite/ld-x86-64/ibt-plt-3d-x32.d: Likewise. * testsuite/ld-x86-64/ibt-plt-3d.d: Likewise.
2017-09-01Prevent an address violation parsing corrupt DWARF information by fixing the ↵Nick Clifton2-3/+9
test for an overlong debug line info structure. PR 22059 * dwarf2.c (decode_line_info): Fix test for an overlong line info structure.
2017-09-01Fix buffer overrun when parsing an ELF attribute string that is not NUL ↵Nick Clifton2-1/+9
terminated. PR 22058 * elf-attrs.c (_bfd_elf_parse_attributes): Ensure that the attribute buffer is NUL terminated.
2017-09-01Automatic date update in version.inGDB Administrator1-1/+1
2017-08-31Fix buffer read overrun by ensuring that DWARF sections containing strings ↵Nick Clifton2-0/+29
always end in a NUL byte. PR 22047 * dwarf2.c (read_section): If necessary add a terminating NUL byte to dwarf string sections.
2017-08-31Regen SRC-POTFILES.inAlan Modra2-0/+6
* po/SRC-POTFILES.in: Regenerate.
2017-08-31Remove .eh_frame zero terminatorsAlan Modra3-42/+44
The machinery to do this was there, but not enabled if the terminator was the only thing in the section. bfd/ * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Don't exit early for a section containing just a terminator. Allow multiple terminators at end of section. * elflink.c (bfd_elf_discard_info): Iterate over .eh_frame sections when not adding alignment. Assert on terminator in the middle of FDEs. ld/ * testsuite/ld-elf/eh3.d: Update. * testsuite/ld-elf/eh4.d: Update.
2017-08-31PR22048, Incorrect .eh_frame section in libc.soAlan Modra2-10/+22
PR 21441 PR 22048 * elflink.c (bfd_elf_discard_info): Don't pad embedded zero terminators.
2017-08-30Add elf64.lo together with elfxx-x86.lo for 64-bit BFDH.J. Lu3-0/+20
Since elfxx-x86.lo needs elf64.lo with 64-bit BFD, add elf64.lo together with elfxx-x86.lo to bfd_backends for 64-bit BFD. * configure.ac (bfd_backends): Add elf64.lo together with elfxx-x86.lo for 64-bit BFD. * configure: Regenerated.
2017-08-30FT32: Permit R_FT32_18 overflowJames Bowman2-1/+6
The howto for R_FT32_18 was using complain_overflow_signed. But some valid address calculations exceed the range of this reloc. Changing it to complain_overflow_dont allows them. bfd/ChangeLog: * elf32-ft32.c (ft32_elf_howto_table): Use complain_overflow_dont for R_FT32_18.
2017-08-31bfd_close_all_done calling _close_and_cleanupAlan Modra2-15/+10
elf64_vms_close_and_cleanup calls bfd_get_size, which calls iovec->bstat. cache_bstat ends up adding the bfd to the cache lru list, negating the bfd_cache_close call in bfd_close_all_done. So there is a dangling pointer into the freed and then reused bfd. Thus, bfd_cache_close must be called after _close_and_cleanup, or better, via iovec->bclose. PR binutils/22032 * opncls.c (bfd_close_all_done): Don't call bfd_cache_close before _close_and_cleanup. Call iovec->bclose after. (bfd_close): Remove code common to, and call, bfd_close_all_done.
2017-08-31Automatic date update in version.inGDB Administrator1-1/+1
2017-08-30x86: Add _bfd_x86_elf_get_synthetic_symtabH.J. Lu5-383/+303
Move the common codes in elf_i386_get_synthetic_symtab and elf_x86_64_get_synthetic_symtab to _bfd_x86_elf_get_synthetic_symtab. * elf32-i386.c (elf_i386_plt_type): Removed. (elf_i386_plt): Likewise. (elf_i386_get_synthetic_symtab): Updated. Call _bfd_x86_elf_get_synthetic_symtab. * elf64-x86-64.c (elf_x86_64_plt_type): Removed. (elf_x86_64_plt): Likewise. (elf_x86_64_get_synthetic_symtab): Updated. Call _bfd_x86_elf_get_synthetic_symtab. * elfxx-x86.c (elf_i386_get_plt_got_vma): New function. (elf_x86_64_get_plt_got_vma): Likewise. (elf_i386_valid_plt_reloc_p): Likewise. (elf_x86_64_valid_plt_reloc_p): Likewise. (_bfd_x86_elf_get_synthetic_symtab): Likewise. * elfxx-x86.h (elf_x86_plt_type): New. (elf_x86_plt): Likewise. (_bfd_x86_elf_get_synthetic_symtab): Likewise.
2017-08-30x86: Check target_id instead of elf_machine_codeH.J. Lu2-1/+6
Since both elf32-i386.c and elf64-x86-64.c support targets with different ELF_MACHINE_CODEs, _bfd_x86_elf_link_hash_table_create should check target_id instead of elf_machine_code. * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Check target_id instead of elf_machine_code.
2017-08-30x86: Add _bfd_x86_elf_link_hash_table_createH.J. Lu5-604/+515
Share _bfd_x86_elf_link_hash_table_create in elf32-i386.c and elf64-x86-64.c by: 1. Replace elf_i386_lazy_plt_layout, elf_i386_non_lazy_plt_layout, elf_i386_plt_layout, elf_x86_64_lazy_plt_layout, elf_x86_64_non_lazy_plt_layout and elf_x86_64_plt_layout with elf_x86_lazy_plt_layout, elf_x86_non_lazy_plt_layout and elf_x86_plt_layout. 2. Move plt, lazy_plt, non_lazy_plt, srelplt2 and next_tls_desc_index from elf_i386_link_hash_table to elf_x86_link_hash_table. 3. Remove elf_i386_link_hash_table and elf_x86_64_link_hash_table. * elf32-i386.c (ELF_DYNAMIC_INTERPRETER): Removed. (elf_i386_lazy_plt_layout): Likewise. (elf_i386_non_lazy_plt_layout): Likewise. (elf_i386_plt_layout): Likewise. (elf_i386_link_hash_table): Likewise. (elf_i386_next_tls_desc_index): Likewise. (elf_i386_srelplt2): Likewise. (elf_i386_plt): Likewise. (elf_i386_lazy_plt): Likewise. (elf_i386_non_lazy_plt): Likewise. (elf_i386_link_hash_table_create): Likewise. (bfd_elf32_bfd_link_hash_table_create): Likewise. (elf_i386_lazy_plt): Updated. (elf_i386_non_lazy_plt): Likewise. (elf_i386_lazy_ibt_plt): Likewise. (elf_i386_non_lazy_ibt_plt): 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_get_synthetic_symtab): Likewise. (elf_i386_link_setup_gnu_properties): Likewise. (elf_i386_nacl_plt): Likewise. * elf64-x86-64.c (ABI_64_P): Removed. (ELF64_DYNAMIC_INTERPRETER): Likewise. (ELF32_DYNAMIC_INTERPRETER): Likewise. (elf_x86_64_lazy_plt_layout): Likewise. (elf_x86_64_non_lazy_plt_layout): Likewise. (elf_x86_64_plt_layout): Likewise. (elf_x86_64_link_hash_table): Likewise. (elf_x86_64_plt): Likewise. (elf_x86_64_lazy_plt): Likewise. (elf_x86_64_non_lazy_plt): Likewise. (elf_x86_64_link_hash_table_create): Likewise. (bfd_elf64_bfd_link_hash_table_create): Likewise. (bfd_elf32_bfd_link_hash_table_create): Likewise. (elf_x86_64_lazy_plt): Updated. (elf_x86_64_non_lazy_plt): Likewise. (elf_x86_64_lazy_bnd_plt): Likewise. (elf_x86_64_non_lazy_bnd_plt): Likewise. (elf_x86_64_lazy_ibt_plt): Likewise. (elf_x32_lazy_ibt_plt): Likewise. (elf_x86_64_non_lazy_ibt_plt): Likewise. (elf_x32_non_lazy_ibt_plt): Likewise. (elf_x86_64_allocate_dynrelocs): Likewise. (elf_x86_64_size_dynamic_sections): Likewise. (elf_x86_64_relocate_section): Likewise. (elf_x86_64_finish_dynamic_symbol): Likewise. (elf_x86_64_finish_dynamic_sections): Likewise. (elf_x86_64_get_synthetic_symtab): Likewise. (elf_x86_64_link_setup_gnu_properties): Likewise. (elf_x86_64_nacl_plt): Likewise. * elfxx-x86.c: Include "objalloc.h", "elf/i386.h" and "elf/x86-64.h". (ELF32_DYNAMIC_INTERPRETER): New. (ELF64_DYNAMIC_INTERPRETER): Likewise. (ELFX32_DYNAMIC_INTERPRETER): Likewise. (_bfd_x86_elf_link_hash_table_create): Likewise. (_bfd_x86_elf_link_hash_table_free): Renamed to ... (elf_x86_link_hash_table_free): This. Make it static. * elfxx-x86.h: Don't include "objalloc.h". (ABI_64_P): New. (elf_x86_lazy_plt_layout): Likewise. (elf_x86_non_lazy_plt_layout): Likewise. (elf_x86_plt_layout): Likewise. (_bfd_x86_elf_link_hash_table_create): Likewise. (bfd_elf64_bfd_link_hash_table_create): Likewise. (bfd_elf32_bfd_link_hash_table_create): Likewise. (elf_x86_link_hash_table): Add plt, lazy_plt, non_lazy_plt, srelplt2 and next_tls_desc_index. (_bfd_x86_elf_link_hash_table_free): Removed.
2017-08-30MIPS/BFD: Correct microMIPS cross-mode BAL to JALX relaxationMaciej W. Rozycki2-1/+10
Fix a bug in commit a6ebf6169a1b ("MIPS: Convert cross-mode BAL to JALX") and in BFD linker relaxation correct the microMIPS interpretation of the branch offset, which is supposed to be shifted by 1 bit, rather than 2 as in the regular MIPS case. bfd/ * elfxx-mips.c (mips_elf_perform_relocation): Correct microMIPS branch offset interpretation. gas/ * testsuite/gas/mips/branch-addend-micromips.d: New test. * testsuite/gas/mips/branch-addend-micromips-n32.d: New test. * testsuite/gas/mips/branch-addend-micromips-n64.d: New test. * testsuite/gas/mips/branch-addend-micromips.s: New test source. * testsuite/gas/mips/mips.exp: Run the new tests. ld/ * testsuite/ld-mips-elf/bal-jalx-addend-micromips.d: New test. * testsuite/ld-mips-elf/bal-jalx-addend-micromips-n32.d: New test. * testsuite/ld-mips-elf/bal-jalx-addend-micromips-n64.d: New test. * testsuite/ld-mips-elf/bal-jalx-local-micromips.d: New test. * testsuite/ld-mips-elf/bal-jalx-local-micromips-n32.d: New test. * testsuite/ld-mips-elf/bal-jalx-local-micromips-n64.d: New test. * testsuite/ld-mips-elf/bal-jalx-pic-micromips.d: New test. * testsuite/ld-mips-elf/bal-jalx-pic-micromips-n32.d: New test. * testsuite/ld-mips-elf/bal-jalx-pic-micromips-n64.d: New test. * testsuite/ld-mips-elf/bal-jalx-pic-ignore-micromips.d: New test. * testsuite/ld-mips-elf/bal-jalx-pic-ignore-micromips-n32.d: New test. * testsuite/ld-mips-elf/bal-jalx-pic-ignore-micromips-n64.d: New test. * testsuite/ld-mips-elf/mips-elf.exp: Run the new tests.
2017-08-30Call _close_and_cleanup in bfd_close_all_doneH.J. Lu2-0/+8
PR binutils/22032 * opncls.c (bfd_close_all_done): Call _close_and_cleanup.
2017-08-30Remove elf_x86_64_next_tls_desc_index/elf_x86_64_srelplt2H.J. Lu2-6/+5
They are unused. * elf64-x86-64.c (elf_x86_64_next_tls_desc_index): Removed. (elf_x86_64_srelplt2): Likewise.
2017-08-30Add missing ChangeLog entriesH.J. Lu1-0/+144
2017-08-30PowerPC TPREL16_HA/LO reloc optimizationAlan Modra3-2/+84
In the TLS GD/LD to LE optimization, ld replaces a sequence like addi 3,2,x@got@tlsgd R_PPC64_GOT_TLSGD16 x bl __tls_get_addr(x@tlsgd) R_PPC64_TLSGD x R_PPC64_REL24 __tls_get_addr nop with addis 3,13,x@tprel@ha R_PPC64_TPREL16_HA x addi 3,3,x@tprel@l R_PPC64_TPREL16_LO x nop When the tprel offset is small, this can be further optimized to nop addi 3,13,x@tprel nop bfd/ * elf64-ppc.c (struct ppc_link_hash_table): Add do_tls_opt. (ppc64_elf_tls_optimize): Set it. (ppc64_elf_relocate_section): Nop addis on TPREL16_HA, and convert insn on TPREL16_LO and TPREL16_LO_DS relocs to use r13 when addis would add zero. * elf32-ppc.c (struct ppc_elf_link_hash_table): Add do_tls_opt. (ppc_elf_tls_optimize): Set it. (ppc_elf_relocate_section): Nop addis on TPREL16_HA, and convert insn on TPREL16_LO relocs to use r2 when addis would add zero. gold/ * powerpc.cc (Target_powerpc::Relocate::relocate): Nop addis on TPREL16_HA, and convert insn on TPREL16_LO and TPREL16_LO_DS relocs to use r2/r13 when addis would add zero. ld/ * testsuite/ld-powerpc/tls.s: Add calls with tls markers. * testsuite/ld-powerpc/tls32.s: Likewise. * testsuite/ld-powerpc/powerpc.exp: Run tls marker tests. * testsuite/ld-powerpc/tls.d: Adjust for TPREL16_HA/LO optimization. * testsuite/ld-powerpc/tlsexe.d: Likewise. * testsuite/ld-powerpc/tlsexetoc.d: Likewise. * testsuite/ld-powerpc/tlsld.d: Likewise. * testsuite/ld-powerpc/tlsmark.d: Likewise. * testsuite/ld-powerpc/tlsopt4.d: Likewise. * testsuite/ld-powerpc/tlstoc.d: Likewise.
2017-08-30PowerPC64 __tls_get_addr sequence optimizationAlan Modra2-33/+10
There isn't a good reason for ld.bfd to behave differently from gold in the code generated by TLS GD/LD to LE optimization. bfd/ * elf64-ppc.c (ppc64_elf_relocate_section): When optimizing __tls_get_addr call sequences to LE, don't move the addi down to the nop. Replace the bl with addi and leave the nop alone. ld/ * testsuite/ld-powerpc/tls.d: Update. * testsuite/ld-powerpc/tlsexe.d: Update. * testsuite/ld-powerpc/tlsexetoc.d: Update. * testsuite/ld-powerpc/tlsld.d: Update. * testsuite/ld-powerpc/tlsmark.d: Update. * testsuite/ld-powerpc/tlsopt4.d: Update. * testsuite/ld-powerpc/tlstoc.d: Update.
2017-08-30Automatic date update in version.inGDB Administrator1-1/+1