aboutsummaryrefslogtreecommitdiff
path: root/bfd
AgeCommit message (Collapse)AuthorFilesLines
2019-06-25bfd/elf-properties: avoid shadowing a C library symbolJan Beulich2-4/+9
With my (oldish) gcc/glibc combination I'm seeing .../bfd/elf-properties.c: In function ‘elf_find_and_remove_property’: .../bfd/elf-properties.c:244: error: declaration of ‘remove’ shadows a global declaration /usr/include/stdio.h:157: error: shadowed declaration is here
2019-06-25Automatic date update in version.inGDB Administrator1-1/+1
2019-06-24RISC-V: Enable lui relaxation for CODE and MERGE sections.Jim Wilson2-10/+55
2019-06-24 Ilia Diachkov <ilia.diachkov@optimitech.com> bfd/ * elfnn-riscv.c (_bfd_riscv_relax_lui): Delete early exit when SEC_MERGE or SEC_CODE flags are set. (_bfd_riscv_relax_section): New local symtype. Set sym_sec and symtype consistently. Don't include sec_addr (sym_sec) in symval. Add check for SEC_INFO_TYPE_MERGE and call _bfd_merged_section_offset. Add sec_addr (sym_sec) after handling merge sections.
2019-06-24elf: Remove the property after reporting its removalH.J. Lu2-6/+10
commit d2ef37ebd9f771d06edf1fdea37970f60b242b2d Author: H.J. Lu <hjl.tools@gmail.com> Date: Fri Dec 7 08:30:30 2018 -0800 elf: Report property change when merging properties failed to remove the property after reporting it has been removed. This patch corrects it. bfd/ PR ld/24721 * elf-properties.c (elf_merge_gnu_property_list): Remove the property after reporting property removal. ld/ PR ld/24721 * testsuite/ld-x86-64/x86-64.exp: Run PR ld/24721 tests. * testsuite/ld-x86-64/pr24721-x32.d: New file. * testsuite/ld-x86-64/pr24721.d: Likewise. * testsuite/ld-x86-64/pr24721.map: Likewise. * testsuite/ld-x86-64/pr24721a.s: Likewise. * testsuite/ld-x86-64/pr24721b.s: Likewise.
2019-06-24Automatic date update in version.inGDB Administrator1-1/+1
2019-06-23PR24704, Internal error building skiboot for powerpc64-linux-gnuAlan Modra2-16/+25
While the skiboot linker script bears some culpability in this PR, it's also true that the GOT indirect to GOT relative optimisation for 16-bit offsets isn't safe. At least, it isn't safe to remove the GOT entry based on distance between the GOT pointer and symbol calculated from the preliminary layout. So this patch removes that optimisation, and reduces the range allowed for 32-bit and 34-bit offsets. PR 24704 bfd/ * elf64-ppc.c (R_PPC64_GOT16_DS): Don't set has_gotrel. (ppc64_elf_edit_toc): Don't remove R_PPC64_GOT16_DS got entries. Reduce range of offsets allowed for other GOT relocs. ld/ * testsuite/ld-powerpc/elfv2exe.d: Update. * testsuite/ld-powerpc/elfv2so.d: Update.
2019-06-23PR24689 again, string table corruptionAlan Modra2-4/+5
Depending on optimisation level and gcc version, git commit 890f750a3b introduces a false positive warning that i_shdrp may be used uninitialized. PR 24689 * elfcode.h (elf_object_p): Warning fix.
2019-06-23Automatic date update in version.inGDB Administrator1-1/+1
2019-06-22Automatic date update in version.inGDB Administrator1-1/+1
2019-06-21PR24689, string table corruptionAlan Modra2-1/+7
The testcase in the PR had a e_shstrndx section of type SHT_GROUP. hdr->contents were initialized by setup_group rather than being read from the file, thus last byte was not zero and string dereference ran off the end of the buffer. PR 24689 * elfcode.h (elf_object_p): Check type of e_shstrndx section.
2019-06-21Automatic date update in version.inGDB Administrator1-1/+1
2019-06-20Automatic date update in version.inGDB Administrator1-1/+1
2019-06-19PR24697, R_PPC_EMB_SDA21 relocationAlan Modra2-7/+21
PR 24697 * elf32-ppc.c (ppc_elf_relocate_section): Don't read insn for R_PPC_EMB_RELSDA. Mask low bit of R_PPC_EMB_SDA21 r_offset.
2019-06-19PowerPC64 notoc callsAlan Modra2-3/+9
Calls from functions that don't have a valid toc pointer in r2 (these calls are marked with _NOTOC relocs) to functions that require r2 valid must go via the callee global entry point. This patch corrects the condition the linker was using to detect functions that require r2 to be valid. Values of both zero and one in st_other local entry bits mean a function doesn't care about r2. * elf64-ppc.c (ppc64_elf_inline_plt): Correct st_other test for functions that require r2 valid to use local entry. (ppc64_elf_size_stubs, ppc64_elf_relocate_section): Likewise.
2019-06-19Automatic date update in version.inGDB Administrator1-1/+1
2019-06-18Automatic date update in version.inGDB Administrator1-1/+1
2019-06-17aarch64: remove unnecessary loc_hash_table traversalSzabolcs Nagy2-24/+6
The loc_hash_table should only contain local ifunc symbols. The current code already aborts if there is anything else and for defined ifunc symbols elfNN_aarch64_allocate_dynrelocs is a no-op. bfd/ChangeLog: * elfnn-aarch64.c (elfNN_aarch64_allocate_local_dynrelocs): Remove. (elfNN_aarch64_size_dynamic_sections): Remove loc_hash_table traversal with elfNN_aarch64_allocate_local_dynrelocs.
2019-06-17Automatic date update in version.inGDB Administrator1-1/+1
2019-06-16Automatic date update in version.inGDB Administrator1-1/+1
2019-06-15Automatic date update in version.inGDB Administrator1-1/+1
2019-06-14Add R_AARCH64_P32_MOVW_PREL_* ELF32 relocsSzabolcs Nagy2-3/+7
These ilp32 relocations were missing for some reason. bfd/ChangeLog: * elfnn-aarch64.c: Enable MOVW_PREL relocs for ELF32. include/ChangeLog: * elf/aarch64.h (R_AARCH64_P32_MOVW_PREL_G0): Define. (R_AARCH64_P32_MOVW_PREL_G0_NC): Define. (R_AARCH64_P32_MOVW_PREL_G1): Define. ld/ChangeLog: * testsuite/ld-aarch64/aarch64-elf.exp: Add emit-relocs-22 and -23. * testsuite/ld-aarch64/emit-relocs-22.d: New test. * testsuite/ld-aarch64/emit-relocs-22.s: New test. * testsuite/ld-aarch64/emit-relocs-23.d: New test. * testsuite/ld-aarch64/emit-relocs-23.s: New test.
2019-06-14Regenerate with approved autotools versionAlan Modra3-21/+13
bfd/ * Makefile.in: Regenerate. * configure: Regenerate. binutils/ * Makefile.in: Regenerate. * aclocal.m4: Regenerate. * doc/Makefile.in: Regenerate. gas/ * Makefile.in: Regenerate. * configure: Regenerate. * doc/Makefile.in: Regenerate. ld/ * Makefile.in: Regenerate. * configure: Regenerate. libctf/ * configure: Regenerate.
2019-06-14PowerPC comment fixesAlan Modra2-5/+9
"paddi rt,sym@pcrel" as an abbreviation for "paddi rt,0,sym@pcrel,1" is invalid, so replace with "pla rt,sym@pcrel" which is a valid form of "pla rt,sym@pcrel(0),1". * elf64-ppc.c: Fix comments involving paddi.
2019-06-14Automatic date update in version.inGDB Administrator1-1/+1
2019-06-13Automatic date update in version.inGDB Administrator1-1/+1
2019-06-12Prevent a seg-fault from objdup when disassembling binaries which do not ↵Adam Lackorzymski3-9/+28
contain a symbol table. PR 24643 * elf32-arm.c (arm_elf_find_function): Fail if the symol table is absent, or the bfd is not in the ELF formart. * elfnn-aarch64.c (aarch64_elf_find_function): Likewise.
2019-06-12Automatic date update in version.inGDB Administrator1-1/+1
2019-06-11Automatic date update in version.inGDB Administrator1-1/+1
2019-06-10Add support for NetBSD/sh3 core file sections. Merge multiple copies of ↵Christos Zoulas2-39/+57
auxv section creation into one function. PR 24650 * elf.c (elfcore_make_auxv_note_section): New function. (elfcore_grok_note): Use it. (elfcore_grok_freebsd_note): Likewise. (elfcore_grok_openbsd_note): Likewise. (elfcore_grok_netbsd_note): Likewise. Plus add support for NT_NETBSDCORE_AUXV notes.
2019-06-10Automatic date update in version.inGDB Administrator1-1/+1
2019-06-09Automatic date update in version.inGDB Administrator1-1/+1
2019-06-08Automatic date update in version.inGDB Administrator1-1/+1
2019-06-07Automatic date update in version.inGDB Administrator1-1/+1
2019-06-06[BFD, AArch64] Fix PT_GNU_PROPERTY alignment issueSudakshina Das2-0/+13
If the new GNU property section was being created by the linker (this will happen only if none of the inputs have any GNU property section but the command line to the linker forces a bti with --force-bti), the alignment of the section and hence the program header of PT_GNU_PROPERTY type was not being set correctly. This patch fixes this issue. bfd/ChangeLog: 2019-06-06 Sudakshina Das <sudi.das@arm.com> * elfxx-aarch64.c (_bfd_aarch64_elf_link_setup_gnu_properties): Set alignment of the new gnu property section. ld/ChangeLog: 2019-06-06 Sudakshina Das <sudi.das@arm.com> * testsuite/ld-aarch64/aarch64-elf.exp: Add new tests. * testsuite/ld-aarch64/property-bti-pac4-a.d: New test. * testsuite/ld-aarch64/property-bti-pac4-b.d: New test. * testsuite/ld-aarch64/property-bti-pac4.s: New test.
2019-06-06[LD, AArch64] Move ELF options behind -zSudakshina Das5-5/+13
This patch moves the current AArch64 ld options of --force-bti and --pac-plt to -z force-bti and -z pac-plt since these are ELF specific options. *** bfd/ChangeLog *** 2019-06-06 Sudakshina Das <sudi.das@arm.com> * bfd-in.h: Change comment. * bfd-in2.h: Regenerate. * elfnn-aarch64.c (elfNN_aarch64_merge_gnu_properties): Update warning. * elfxx-aarch64.c (_bfd_aarch64_elf_link_setup_gnu_properties): Likwise. *** ld/ChangeLog *** 2019-06-06 Sudakshina Das <sudi.das@arm.com> * NEWS: Update options names. * emultempl/aarch64elf.em (OPTION_FORCE_BTI, OPTION_PAC_PLT): Remove. (PARSE_AND_LIST_LONGOPTS): Remove force-bti and pac-plt. (PARSE_AND_LIST_OPTIONS): Update to -z. (PARSE_AND_LIST_ARGS_CASE_Z_AARCH64): New. (PARSE_AND_LIST_ARGS_CASE_Z): Add PARSE_AND_LIST_ARGS_CASE_Z_AARCH64. (PARSE_AND_LIST_ARGS_CASES): Move cases for these options. * testsuite/ld-aarch64/bti-pac-plt-1.d: Update option. * testsuite/ld-aarch64/bti-pac-plt-2.d: Likewise. * testsuite/ld-aarch64/bti-plt-1.d: Likewise. * testsuite/ld-aarch64/bti-plt-2.d: Likewise. * testsuite/ld-aarch64/bti-plt-3.d: Likewise. * testsuite/ld-aarch64/bti-plt-4.d: Likewise. * testsuite/ld-aarch64/bti-plt-6.d: Likewise. * testsuite/ld-aarch64/bti-plt-7.d: Likewise. * testsuite/ld-aarch64/bti-warn.d: Likewise. * testsuite/ld-aarch64/pac-plt-1.d: Likewise. * testsuite/ld-aarch64/pac-plt-2.d: Likewise.
2019-06-06Automatic date update in version.inGDB Administrator1-1/+1
2019-06-05Automatic date update in version.inGDB Administrator1-1/+1
2019-06-04Automatic date update in version.inGDB Administrator1-1/+1
2019-06-03Automatic date update in version.inGDB Administrator1-1/+1
2019-06-02Automatic date update in version.inGDB Administrator1-1/+1
2019-06-01Automatic date update in version.inGDB Administrator1-1/+1
2019-05-31Automatic date update in version.inGDB Administrator1-1/+1
2019-05-30Automatic date update in version.inGDB Administrator1-1/+1
2019-05-29Automatic date update in version.inGDB Administrator1-1/+1
2019-05-28MIPS/LD: Skip overflow check for %pcrel_hi relocationsFaraz Shahbazker2-2/+5
Overflow checks were removed for all hi16 relocations except PC-relative high relocations per PR ld/16720. Remove overflow checks from %pcrel_hi relocations so that we can correctly handle negative offsets from PC. bfd/ * elfxx-mips.c (mips_elf_calculate_relocation) <R_MIPS_PCHI16>: Remove overflow check. ld/ * testsuite/ld-mips-elf/undefweak-overflow.s: Remove test case for pcrel_hi/pcrel_lo. * testsuite/ld-mips-elf/undefweak-overflow.d: Update to match. * testsuite/ld-mips-elf/reloc-pcrel-r6.s: New test source. * testsuite/ld-mips-elf/reloc-pcrel-r6.d: New test linker script. * testsuite/ld-mips-elf/reloc-pcrel-r6.ld: New test. * testsuite/ld-mips-elf/mips-elf.exp: Run the new test.
2019-05-28COFF linker segmentation faultsAlan Modra2-1/+7
A plugin can change the element, so call the generic bfd_link_add_symbols. PR 24596 * cofflink.c (coff_link_check_archive_element): Don't assume element is a coff object file after calling add_archive_element.
2019-05-28Microblaze linker segmentation faultAlan Modra2-2/+9
PR 24596 * elf32-microblaze.c (microblaze_elf_finish_dynamic_sections): Don't attempt to set sh_entsize for excluded PLT section.
2019-05-28Alpha-linux linker segmentation faultAlan Modra2-1/+8
This patch cures a linker segfault, and "FAIL: Build pr22263-1". PR 24596 * elf64-alpha.c (elf64_alpha_relocate_section): Don't attempt to emit R_ALPHA_GOTTPREL in PIEs, for which no space is allocated in alpha_dynamic_entries_for_reloc.
2019-05-28LM32 linker segmentation faultsAlan Modra3-2/+11
PR 24596 * elf32-lm32.c (lm32_elf_finish_dynamic_sections): Don't segfault on NULL output_section. * elflink.c (elf_final_link_free): Don't free -1 symshndxbuf.
2019-05-28m68k linker segmentation faultsAlan Modra2-12/+31
This doesn't fix the underlying bug, but an abort is better than a segfault. PR 24596 * elf32-m68k.c (elf_m68k_get_got_entry): Don't create a new entry when MUST_FIND. Abort when MUST_FIND not found. (elf_m68k_get_bfd2got_entry): Likewise. (elf_m68k_relocate_section): Remove now useless assert.