aboutsummaryrefslogtreecommitdiff
path: root/bfd
AgeCommit message (Collapse)AuthorFilesLines
2019-04-10Automatic date update in version.inGDB Administrator1-1/+1
2019-04-09Automatic date update in version.inGDB Administrator1-1/+1
2019-04-08x86: Remove i386-*-kaos* and i386-*-chaos targetsH.J. Lu2-8/+4
Remove i386-*-kaos* and i386-*-chaos targets since they are no longer supported by config.sub: $ .../config.sub i386-kaos Invalid configuration `i386-kaos': system `kaos' not recognized $ .../config.sub i386-chaos Invalid configuration `i386-chaos': system `chaos' not recognized $ bfd/ * config.bfd: Remove i[3-7]86-*-kaos* and i[3-7]86-*-chaos targets. gas/ * configure.tgt: Remove i386-*-kaos* and i386-*-chaos targets. * testsuite/gas/i386/i386.exp: Remove *-*-caos* and "*-*-kaos* check. ld/ * Makefile.am (ALL_EMULATION_SOURCES): Remove eelf_i386_chaos.c. (eelf_i386_chaos.c): Removed. * Makefile.in: Regenerated. * configure.tgt: Remove i[3-7]86-*-kaos*. * emulparams/elf_i386_chaos.sh: Removed.
2019-04-08Fix x86_64-rdos build failAlan Modra3-26/+33
x86_64-rdos is one of the few x86_64 targets that is 64-bit only and the x86_64 configure entries don't depend on elf-vxworks.lo. This results in undefined references from elfxx-x86.o. * configure.ac (elfxx_x86): Define and use. * configure: Regenerate.
2019-04-08Automatic date update in version.inGDB Administrator1-1/+1
2019-04-07Automatic date update in version.inGDB Administrator1-1/+1
2019-04-06x86: Move x86-specific linker options to elf_linker_x86_paramsH.J. Lu6-19/+109
Remove x86-specific linker options from bfd_link_info and put them in elf_linker_x86_params. Add _bfd_elf_linker_x86_set_options to pass x86-specific linker options from ld to bfd. bfd/ * elf-linker-x86.h: New file. * elf32-i386.c (elf_i386_convert_load_reloc): Use htab->params to get x86-specific linker options. * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Likewise. (elf_x86_64_check_relocs): Likewise. (elf_x86_64_relocate_section): Likewise. (elf_x86_64_link_setup_gnu_properties): Likewise. * elfxx-x86.c (_bfd_x86_elf_merge_gnu_properties): Likewise. (_bfd_x86_elf_link_setup_gnu_properties): Likewise. (_bfd_elf_linker_x86_set_options): New function. * elfxx-x86.h: Include "elf-linker-x86.h". (elf_x86_link_hash_table): Add params. include/ * bfdlink.h (bfd_link_info): Remove x86-specific linker options. ld/ * Makefile.am (ELF_X86_DEPS): Add $(srcdir)/emultempl/elf-x86.em. (eelf_i386_sol2.c): Also depend on $(srcdir)/emultempl/solaris2-x86.em. (eelf_x86_64_sol2.c): Likewise. * Makefile.in: Regenerated. * emulparams/call_nop.sh: Set x86-specific linker options via params. * emulparams/cet.sh: Likewise. * emulparams/reloc_overflow.sh: Likewise. * emulparams/elf32_x86_64.sh (EXTRA_EM_FILE): New. Set to "elf-x86". * emulparams/elf_i386.sh: Likewise. * emulparams/elf_i386_be.sh: Likewise. * emulparams/elf_i386_chaos.sh: Likewise. * emulparams/elf_i386_ldso.sh: Likewise. * emulparams/elf_i386_vxworks.sh: Likewise. * emulparams/elf_iamcu.sh: Likewise. * emulparams/elf_k1om.sh: Likewise. * emulparams/elf_l1om.sh: Likewise. * emulparams/elf_x86_64.sh: Likewise. * emulparams/elf_i386_sol2.sh (EXTRA_EM_FILE): Changed to "solaris2-x86". * emulparams/elf_x86_64_sol2.sh: Likewise. * emultempl/elf-x86.em: New file. * emultempl/solaris2-x86.em: Likewise. * emultempl/elf32.em (gld${EMULATION_NAME}_before_parse): Don't set link_info.call_nop_byte.
2019-04-06Automatic date update in version.inGDB Administrator1-1/+1
2019-04-05Automatic date update in version.inGDB Administrator1-1/+1
2019-04-04Automatic date update in version.inGDB Administrator1-1/+1
2019-04-03BFD whitespace fixesAlan Modra24-188/+197
* coff-i386.c, * coff-x86_64.c, * coffgen.c, * dwarf2.c, * elf-m10200.c, * elf.c, * elf32-arm.c, * elf32-bfin.c, * elf32-csky.c, * elf32-m32r.c, * elf32-microblaze.c, * elf32-pru.c, * elf32-rx.c, * elf32-xgate.c, * elf64-sparc.c, * elfnn-ia64.c, * elfxx-riscv.c, * elfxx-sparc.c, * linker.c, * mach-o.c, * pe-x86_64.c, * pei-x86_64.c, * plugin.c: Whitespace fixes.
2019-04-03Automatic date update in version.inGDB Administrator1-1/+1
2019-04-02RISC-V: Don't check ABI flags if no code section.Jim Wilson2-2/+39
This fixes a glib build failure reported in PR 24389. Using ld -b binary creates an object file with no elf header flags set which has the wrong ABI info for riscv64-linux. But the file also has no code sections, so I added code borrowed from the arm port that only checks the ELF header ABI flags if there is a code section. bfd/ PR 24389 * elfnn-riscv.c (_bfd_riscv_elf_merge_private_bfd_data): Move read of ELF header flags to after check for ELF object file. Loop through sections looking for code sections, if none, then skip ABI checks.
2019-04-02Automatic date update in version.inGDB Administrator1-1/+1
2019-04-01Automatic date update in version.inGDB Administrator1-1/+1
2019-03-31Automatic date update in version.inGDB Administrator1-1/+1
2019-03-30RISC-V: Relax tail/j to c.j for RV64.Jim Wilson2-2/+10
2019-03-30 Andrew Waterman <andrew@sifive.com> bfd/ * elfnn-riscv.c (_bfd_riscv_relax_call): Only check ARCH_SIZE for rd == X_RA case.
2019-03-30Automatic date update in version.inGDB Administrator1-1/+1
2019-03-29bfd: xtensa: fix shrink_dynamic_reloc_sections for export-dynamicMax Filippov2-1/+7
shrink_dynamic_reloc_sections must remove PLT entry that was created for an undefined weak symbol in the presence of --export-dynamic option when relaxation coalesces literals pointing to that symbol. This fixes the following assertion: ld: BFD (GNU Binutils) 2.31.1 internal error, aborting at elf32-xtensa.c:3292 in elf_xtensa_finish_dynamic_sections 2019-03-29 Max Filippov <jcmvbkbc@gmail.com> bfd/ * elf32-xtensa.c (shrink_dynamic_reloc_sections): Add info->export_dynamic to the conditional. ld/ * testsuite/ld-xtensa/relax-undef-weak-pie-export-dynamic.d: New test definition. * testsuite/ld-xtensa/xtensa.exp (relax-undef-weak-pie-export-dynamic): Add new test.
2019-03-29Automatic date update in version.inGDB Administrator1-1/+1
2019-03-28PR24392, Clang warning Wtautological-constant-out-of-range-compareAlan Modra7-29/+53
PR 24392 * configure.ac: Invoke AC_CHECK_SIZEOF(int). * configure: Regenerate. * coffgen.c (coff_get_reloc_upper_bound): Replace gcc diagnostic workaround with SIZEOF_LONG vs. SIZEOF_INT check. * elf.c (_bfd_elf_get_reloc_upper_bound): Likewise. * elf64-sparc.c (elf64_sparc_get_reloc_upper_bound): Likewise. * mach-o.c (bfd_mach_o_get_reloc_upper_bound): Likewise.
2019-03-28Automatic date update in version.inGDB Administrator1-1/+1
2019-03-27Automatic date update in version.inGDB Administrator1-1/+1
2019-03-26Automatic date update in version.inGDB Administrator1-1/+1
2019-03-25Automatic date update in version.inGDB Administrator1-1/+1
2019-03-24Automatic date update in version.inGDB Administrator1-1/+1
2019-03-23Automatic date update in version.inGDB Administrator1-1/+1
2019-03-22Automatic date update in version.inGDB Administrator1-1/+1
2019-03-21RISC-V: Fix linker crash in section symbol check.Jim Wilson2-1/+9
sym is only set for local symbols. h is only set for global symbols. Gas won't let me create a global section symbol, but bfd appears to have some support for that, and I can't rule out that other assemblers might do this. So we need to support both, and verify sym and h are non-NULL before using. bfd/ PR 24365 * elfnn-riscv.c (riscv_elf_relocate_section): For STT_SECTION check, verify sym non-NULL before using. Add identical check using h.
2019-03-21[BFD, AArch64, x86] Improve warning for --force-btiSudakshina Das7-14/+45
The AArch64 linker option to turn on BTI (--force-bti) warns in case there are input objects which have a missing GNU NOTE section for BTI. This patch is trying to improve the warnings that come out. In order to do so, I propose adding a new argument to elf_merge_gnu_properties and the backend function merge_gnu_properties. This new argument makes sure that we now pass both the objects along with the properties to which they belong to. The x86 backend function has also been updated to match this change. *** bfd/ChangeLog *** 2019-03-21 Sudakshina Das <sudi.das@arm.com> * elf-bfd.h (struct elf_backend_data): Add argument to merge_gnu_properties. * elf-properties.c (elf_merge_gnu_properties): Add argument to itself and while calling bed->merge_gnu_properties. (elf_merge_gnu_property_list): Update the calls for elf_merge_gnu_properties. * elfnn-aarch64.c (elfNN_aarch64_merge_gnu_properties): Update handling of --force-bti warning and add argument. * elfxx-aarch64.c (_bfd_aarch64_elf_link_setup_gnu_properties): Add warning. * elfxx-x86.c (_bfd_x86_elf_merge_gnu_properties): Add argument. * elfxx-x86.h (_bfd_x86_elf_merge_gnu_properties): Likewise in declaration. *** ld/ChangeLog *** 2019-03-21 Sudakshina Das <sudi.das@arm.com> * testsuite/ld-aarch64/aarch64-elf.exp: Add new test. * testsuite/ld-aarch64/bti-plt-1.s: Add .ifdef for PAC note section. * testsuite/ld-aarch64/bti-plt-6.d: Update warning. * testsuite/ld-aarch64/bti-plt-7.d: Likewise. * testsuite/ld-aarch64/bti-warn.d: New test.
2019-03-21Automatic date update in version.inGDB Administrator1-1/+1
2019-03-20[BFD, AArch64] Define elf_backend_fixup_gnu_properties in AArch64Sudakshina Das3-0/+48
This patch add support for elf_backend_fixup_gnu_properties for GNU property support for AArch64. The new AArch64 specific definition _bfd_aarch64_elf_link_fixup_gnu_properties goes through the property list to find AArch64 type properties and removes the properties that are marked as "property_remove". *** bfd/ChangeLog *** 2019-03-20 Sudakshina Das <sudi.das@arm.com> * elfxx-aarch64.c (_bfd_aarch64_elf_link_fixup_gnu_properties): Define. * elfxx-aarch64.h (_bfd_aarch64_elf_link_fixup_gnu_properties): Declare. (elf_backend_fixup_gnu_properties): Define for AArch64.
2019-03-20Automatic date update in version.inGDB Administrator1-1/+1
2019-03-19Automatic date update in version.inGDB Administrator1-1/+1
2019-03-18PR24355, segmentation fault in function called from ppc_finish_symbolsAlan Modra2-6/+9
This one looks to be a bug going back to 2009, git commit e054468f6c "STT_GNU_IFUNC support for PowerPC". That bug was carried over with git commit 49c09209d0 "Rearrange PLT reloc output on powerpc". If the refcount for an ifunc local sym plt entry was zero, ppc_elf_size_dynamic_sections would correctly set plt.offset to -1 but leave glink_offset uninitialized. That leads to occasional segfaults (which can be made solid with MALLOC_PERTURB_=1 when using glibc). So, guard the write_glink_stub call with plt.offset != -1. Also, remove the totally ineffective attempt at writing multiple-use glink stubs only once. PR 24355 * elf32-ppc.c (ppc_finish_symbols): Don't call write_glink_stub for local iplt syms with ent->plt.offset == -1. Remove ineffective attempt at writing glink stubs only once.
2019-03-18Automatic date update in version.inGDB Administrator1-1/+1
2019-03-17Automatic date update in version.inGDB Administrator1-1/+1
2019-03-16PR24337, segfault in _bfd_elf_rela_local_sym, againAlan Modra3-8/+14
Reverts commit 1ff31e135f, fixing the problem more generally. There are likely other place that will segfault on a NULL section. PR 24337 * elf.c (_bfd_elf_rela_local_sym): Revert last change. (_bfd_elf_rel_local_sym): Likewise. * elflink.c (elf_link_input_bfd): Use bfd_und_section for section of symbols with unrecognized shndx.
2019-03-16Automatic date update in version.inGDB Administrator1-1/+1
2019-03-15COFF: Check for symbols defined in discarded sectionH.J. Lu3-1/+16
For LTO, a symbol may defined in discarded section. We should mark it as undefined so that LTO plugin will make IR definition available. PR ld/24267 * coffgen.c (_bfd_coff_section_already_linked): Skip discarded section. * cofflink.c (coff_link_add_symbols): Check for symbols defined in discarded section.
2019-03-15PR24339, segfault on NULL symbol sectionAlan Modra2-1/+13
PR 24339 * elflink.c (elf_link_add_object_symbols): Bail out on a local symbol after globals if elf_bad_symtab is not set.
2019-03-15PR24337, segfault in _bfd_elf_rela_local_symAlan Modra2-4/+11
PR 24337 * elf.c (_bfd_elf_rela_local_sym): Don't segfault on NULL sec. (_bfd_elf_rel_local_sym): Likewise.
2019-03-15PR24336, buffer overflow in swap_reloca_inAlan Modra2-2/+10
PR 24336 * elflink.c (elf_link_read_relocs_from_section): Handle fuzzed object files with sh_size not a multiple of sh_entsize.
2019-03-15x86-64: Check for corrupt input with bad relocationH.J. Lu2-38/+138
PR ld/24338 * elf64-x86-64.c (elf_x86_64_relocate_section): Check for corrupt input with bad relocation.
2019-03-15Re-indent elf_x86_64_relocate_sectionH.J. Lu2-2/+6
* elf64-x86-64.c (elf_x86_64_relocate_section): Re-indent.
2019-03-15Automatic date update in version.inGDB Administrator1-1/+1
2019-03-14Fix a buffer overrun error when attempting to parse corrupt DWARF information.Nick Clifton2-0/+18
PR 24334 * dwarf2.c (struct dwarf2_debug): Add sec_vma_count field. (save_section_vma): Initialise field to the number of entries in the sec_vma table. (section_vma_same): Check that the number of entries in the sec_vma table matches the number of sections in the bfd.
2019-03-14Fix an illegal memory access when parsing a corrupt ELF file.Nick Clifton2-0/+7
PR 24333 * elflink.c (_bfd_elf_add_default_symbol): Add a check for a NULL section owner pointer when adding the default symbol.
2019-03-14Fix illegal memory access parsing a corrupt ELF file.Nick Clifton2-3/+34
PR 24332 * elflink.c (elf_link_add_object_symbols): Add new local variable extversym_end. Initialise it to point to the end of the version symbol table, if present. Check it when initialising and updating the ever pointer.
2019-03-14Automatic date update in version.inGDB Administrator1-1/+1