aboutsummaryrefslogtreecommitdiff
path: root/bfd
AgeCommit message (Collapse)AuthorFilesLines
2022-02-08RISC-V: Stop reporting warnings for mismatched extension versionsPalmer Dabbelt1-54/+24
The extension version checking logic is really just too complicated to encode into the linker, trying to do so causes more harm than good. This removes the checks and the associated tests, leaving the logic to keep the largest version of each extension linked into the target. bfd/ * elfnn-riscv.c (riscv_version_mismatch): Rename to riscv_update_subset_version, and stop reporting warnings on version mismatches. (riscv_merge_std_ext): Adjust calls to riscv_version_mismatch. (riscv_merge_multi_letter_ext): Likewise. ld/ * testsuite/ld-riscv-elf/attr-merge-arch-failed-01.d: Remove * testsuite/ld-riscv-elf/attr-merge-arch-failed-01a.s: Likewise * testsuite/ld-riscv-elf/attr-merge-arch-failed-01b.s: Likewise * testsuite/ld-riscv-elf/attr-merge-arch-failed-02.d: Likewise * testsuite/ld-riscv-elf/attr-merge-arch-failed-02a.s: Likewise * testsuite/ld-riscv-elf/attr-merge-arch-failed-02b.s: Likewise * testsuite/ld-riscv-elf/attr-merge-arch-failed-02c.s: Likewise * testsuite/ld-riscv-elf/attr-merge-arch-failed-02d.s: Likewise * testsuite/ld-riscv-elf/attr-merge-user-ext-01.d: New test. * testsuite/ld-riscv-elf/attr-merge-user-ext-rv32i21_m2p0.s: Likewise. * testsuite/ld-riscv-elf/attr-merge-user-ext-rv32i21_m2p1.s: Likewise. * testsuite/ld-riscv-elf/ld-riscv-elf.exp: Remove obselete attr-merge-arch-failed-{01,02}, replace with attr-merge-user-ext-01. Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
2022-02-07i386: Allow GOT32 relocations against ABS symbolsH.J. Lu1-4/+6
GOT32 relocations are allowed since absolute value + addend is stored in the GOT slot. Tested on glibc 2.35 build with GCC 11.2 and -Os. bfd/ PR ld/28870 * elfxx-x86.c (_bfd_elf_x86_valid_reloc_p): Also allow GOT32 relocations. ld/ PR ld/28870 * testsuite/ld-i386/i386.exp: Run pr28870. * testsuite/ld-i386/pr28870.d: New file. * testsuite/ld-i386/pr28870.s: Likewise.
2022-02-08Automatic date update in version.inGDB Administrator1-1/+1
2022-02-07Automatic date update in version.inGDB Administrator1-1/+1
2022-02-06Automatic date update in version.inGDB Administrator1-1/+1
2022-02-05x86: Skip undefined symbol when finishing DT_RELRH.J. Lu1-2/+4
Don't abort for undefined symbol when finishing DT_RELR. Instead, skip undefined symbol. Undefined symbol will be reported by relocate_section. * elfxx-x86.c (elf_x86_size_or_finish_relative_reloc): Skip undefined symbol in finishing phase.
2022-02-05Detect .eh_frame_hdr earlier for SIZEOF_HEADERSAlan Modra4-11/+19
Current code detects the need for PT_GNU_EH_FRAME using a field set by _bfd_elf_discard_section_eh_frame_hdr, which is called fairly late in the linking process. Use the elf hash table eh_info instead, which is set up earlier by size_dynamic_sections. * elf-bfd.h (struct output_elf_obj_tdata): Delete eh_frame_hdr. (elf_eh_frame_hdr): Don't define. (_bfd_elf_discard_section_eh_frame_hdr): Update prototype. * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame_hdr): Delete abfd parameter. Don't set elf_eh_frame_hdr. * elf.c (elf_eh_frame_hdr): New function. (get_program_header_size): Adjust elf_eh_frame_hdr call. (_bfd_elf_map_sections_to_segments): Likewise.
2022-02-05Automatic date update in version.inGDB Administrator1-1/+1
2022-02-04Automatic date update in version.inGDB Administrator1-1/+1
2022-02-03x86: Update X86_64_GOT_TYPE_P to cover more GOT relocationsH.J. Lu1-1/+5
Add R_X86_64_GOT32, R_X86_64_GOT64, R_X86_64_GOTPCREL64 and R_X86_64_GOTPLT64 to X86_64_GOT_TYPE_P to cover more GOT relocations. PR ld/28858 * elfxx-x86.h (X86_64_GOT_TYPE_P): Add R_X86_64_GOT32, R_X86_64_GOT64, R_X86_64_GOTPCREL64 and R_X86_64_GOTPLT64.
2022-02-03PowerPC64 treatment of absolute symbolsAlan Modra1-62/+126
Supporting -static-pie on PowerPC64 requires the linker to properly treat SHN_ABS symbols for cases like glibc's _nl_current_LC_CTYPE_used absolute symbol. I've been slow to fix the linker on powerpc because there is some chance that this will break some shared libraries or PIEs. bfd/ * elf64-ppc.c (ppc64_elf_check_relocs): Consolidate local sym handling code. Don't count dyn relocs against non-dynamic absolute symbols. (dec_dynrel_count): Adjust to suit. (ppc64_elf_edit_toc): Don't remove entries for absolute symbols when pic. (allocate_got): Don't allocate space for got relocs against non-dynamic absolute syms. (ppc64_elf_layout_multitoc): Likewise. (got_and_plt_relr): Likewise. (ppc64_elf_size_dynamic_sections): Likewise for local got. (got_and_plt_relr_for_local_syms): Likewise. (ppc64_elf_size_stubs): Don't allocate space for relr either. (ppc64_elf_relocate_section): Don't write relocs against non-dynamic absolute symbols. Don't optimise got and toc code sequences loading absolute symbol entries. ld/ * testsuite/ld-powerpc/abs-reloc.s, * testsuite/ld-powerpc/abs-static.d, * testsuite/ld-powerpc/abs-static.r, * testsuite/ld-powerpc/abs-pie.d, * testsuite/ld-powerpc/abs-pie.r, * testsuite/ld-powerpc/abs-shared.d, * testsuite/ld-powerpc/abs-shared.r, * testsuite/ld-powerpc/abs-pie-relr.d, * testsuite/ld-powerpc/abs-pie-relr.r, * testsuite/ld-powerpc/abs-shared-relr.d, * testsuite/ld-powerpc/abs-shared-relr.r: New tests. * testsuite/ld-powerpc/powerpc.exp: Run them.
2022-02-03Automatic date update in version.inGDB Administrator1-1/+1
2022-02-02Stop the BFD library complaining about compressed dwarf debug string ↵Nick Clifton2-2/+12
sections being too big. PR 28834 * dwarf2.c (read_section): Change the heuristic that checks for overlarge dwarf debug info sections.
2022-02-02or1k: Avoid R_OR1K_GOT16 signed overflow by using special howtoStafford Horne2-4/+27
Previously when fixing PR 21464 we masked out upper bits of the relocation value in order to avoid overflow complaints when acceptable. It turns out this does not work when the relocation value ends up being signed. To fix this this patch introduces a special howto with complain_on_overflow set to complain_overflow_dont. This is used in place of the normal R_OR1K_GOT16 howto when we detect R_OR1K_GOT_AHI16 relocations. bfd/ChangeLog: PR 28735 * elf32-or1k.c (or1k_elf_got16_no_overflow_howto): Define. (or1k_elf_relocate_section): Use new howto instead of trying to mask out relocation bits.
2022-02-02Automatic date update in version.inGDB Administrator1-1/+1
2022-02-01Automatic date update in version.inGDB Administrator1-1/+1
2022-01-31Re: PR28827, assertion building LLVM 9 on powerpc64le-linux-gnuAlan Modra1-10/+18
In trying to find a testcase for PR28827, I managed to hit a linker error in bfd_set_section_contents with a .branch_lt input section being too large for the output .branch_lt. bfd/ PR 28827 * elf64-ppc.c (ppc64_elf_size_stubs): Set section size to maxsize past STUB_SHRINK_ITER before laying out. Remove now unnecessary conditional setting of maxsize at start of loop. ld/ * testsuite/ld-powerpc/pr28827-2.d, * testsuite/ld-powerpc/pr28827-2.lnk, * testsuite/ld-powerpc/pr28827-2.s: New test. * testsuite/ld-powerpc/powerpc.exp: Run it.
2022-01-31Automatic date update in version.inGDB Administrator1-1/+1
2022-01-30Automatic date update in version.inGDB Administrator1-1/+1
2022-01-29Re: PR28827, assertion building LLVM 9 on powerpc64le-linux-gnuAlan Modra1-11/+10
The previous patch wasn't quite correct. The size and padding depends on offset used in the current iteration, and if we're fudging the offset past STUB_SHRINK_ITER then we'd better use that offset. We can't have plt_stub_pad using stub_sec->size as the offset. PR 28827 * elf64-ppc.c (plt_stub_pad): Add stub_off param. (ppc_size_one_stub): Set up stub_offset to value used in this iteration before sizing the stub. Adjust plt_stub_pad calls.
2022-01-29Automatic date update in version.inGDB Administrator1-1/+1
2022-01-28PowerPC64 handling of @tocbaseAlan Modra1-0/+9
* elf64-ppc.c (ppc64_elf_relocate_section): Warn if the symbol on R_PPC64_TOC isn't local.
2022-01-28PR28827, assertion building LLVM 9 on powerpc64le-linux-gnuAlan Modra1-23/+36
The assertion is this one in ppc_build_one_stub BFD_ASSERT (stub_entry->stub_offset >= stub_entry->group->stub_sec->size); It is checking that a stub doesn't overwrite the tail of a previous stub, so not something trivial. Normally, stub sizing iterates until no stubs are added, detected by no change in stub section size. Iteration also continues if no stubs are added but one or more stubs increases in size, which also can be detected by a change in stub section size. But there is a pathological case where stub section sizing decreases one iteration then increases the next. To handle that situation, stub sizing also stops at more than STUB_SHRINK_ITER (20) iterations when calculated stub section size is smaller. The previous larger size is kept for the actual layout (so that building the stubs, which behaves like another iteration of stub sizing, will see the stub section sizes shrink). The problem with that stopping condition is that it assumes that stub sizing is only affected by addresses external to the stub sections, which isn't always true. This patch fixes that by also keeping larger individual stub_offset addresses past STUB_SHRINK_ITER. It also catches a further pathological case where one stub shrinks and another expands in such a way that no stub section size change is seen. PR 28827 * elf64-ppc.c (struct ppc_link_hash_table): Add stub_changed. (STUB_SHRINK_ITER): Move earlier in file. (ppc_size_one_stub): Detect any change in stub_offset. Keep larger one if past STUB_SHRINK_ITER. (ppc64_elf_size_stubs): Iterate on stub_changed too.
2022-01-28PR28826 x86_64 ld segfaults building xenAlan Modra1-0/+1
Fallout from commit e86fc4a5bc37 PR 28826 * coffgen.c (coff_write_alien_symbol): Init dummy to zeros.
2022-01-28Automatic date update in version.inGDB Administrator1-1/+1
2022-01-27Automatic date update in version.inGDB Administrator1-1/+1
2022-01-26bfd: Make bfd.stamp depend on source bfd.texiH.J. Lu2-4/+6
Make bfd.stamp depend on source bfd.texi to avoid regenerating doc/bfd.info for each make run. PR binutils/28807 * Makefile.in: Regenerate. * doc/local.mk (%D%/bfd.stamp): Depend on $(srcdir)/%D%/bfd.texi.
2022-01-26Automatic date update in version.inGDB Administrator1-1/+1
2022-01-25bfd: Regenerate Makefile.inH.J. Lu1-0/+1
* Makefile.in: Regenerate.
2022-01-25Automatic date update in version.inGDB Administrator1-1/+1
2022-01-24bfd: Update doc/local.mkH.J. Lu2-7/+8
PR binutils/28807 * Makefile.in: Regenerate. * doc/local.mk (AM_MAKEINFOFLAGS): Add -I "$(srcdir)/%D%" -I %D%. (TEXI2DVI): New. (%D%/bfd.texi): Removed. (doc/bfd/index.html): Remove -I$(srcdir). Replace bfd.texi with %D%/bfd.texi.
2022-01-24bfd/doc: Fix racy build failure from missing mkdirRoland McGrath2-0/+5
bfd/ * doc/local.mk (%D%/bfdver.texi): Add mkdir command.
2022-01-24Update Bulgarian, French, Romaniam and Ukranian translation for some of the ↵Nick Clifton4-4676/+11330
sub-directories
2022-01-24Automatic date update in version.inGDB Administrator1-1/+1
2022-01-23bfd: Partially revert commit 0e3839bde6fH.J. Lu2-62/+64
Partially revert commit 0e3839bde6f93e1e3eefce815be3636e3d81054d Author: H.J. Lu <hjl.tools@gmail.com> Date: Sun Jan 23 07:29:27 2022 -0800 bfd: Properly install library and header files PR binutils/28807 * Makefile.am: Revert bfdlib_LTLIBRARIES and bfdinclude_HEADERS changes. * Makefile.in: Regenerate.
2022-01-23bfd: Properly install library and header filesH.J. Lu3-72/+64
Rename bfdlib_LTLIBRARIES and bfdinclude_HEADERS to lib_LTLIBRARIES and include_HEADERS to fix the missing installed library and header files in bfd caused by commit bd32be01c997f686ab0b53f0640eaa0aeb61fbd3 Author: Mike Frysinger <vapier@gentoo.org> Date: Fri Dec 3 00:23:20 2021 -0500 bfd: merge doc subdir up a level PR binutils/28807 * Makefile.am (bfdlib_LTLIBRARIES): Renamed to ... (lib_LTLIBRARIES): This. (bfdinclude_HEADERS): Renamed to ... (include_HEADERS): This. * Makefile.in: Regenerate. * doc/local.mk (install): Removed.
2022-01-23Regenerate Makefile.in files with automake 1.15.1H.J. Lu1-1/+0
Regenerate Makefile.in files with the unmodified automake 1.15.1 to remove runstatedir = @runstatedir@ bfd/ * Makefile.in: Regenerate. binutils/ * Makefile.in: Regenerate. gas/ * Makefile.in: Regenerate. gold/ * Makefile.in: Regenerate. * testsuite/Makefile.in: Likewise. gprof/ * Makefile.in: Regenerate. ld/ * Makefile.in: Regenerate. opcodes/ * Makefile.in: Regenerate.
2022-01-23Regenerate configure files with autoconf 2.69H.J. Lu1-15/+3
Regenerate configure files with the unmodified autoconf 2.69 to remove --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] bfd/ * configure: Regenerate. binutils/ * configure: Regenerate. gas/ * configure: Regenerate. gold/ * configure: Regenerate. gprof/ * configure: Regenerate. ld/ * configure: Regenerate. opcodes/ * configure: Regenerate.
2022-01-23Automatic date update in version.inGDB Administrator1-1/+1
2022-01-22bfd: merge doc subdir up a levelMike Frysinger7-1158/+628
This avoids a recursive make into the doc subdir and speeds up the build slightly. It also allows for more parallelism.
2022-01-22bfd: rename core.texi to corefile.texiMike Frysinger4-10/+4
This is a generated file name from a correspondingly named C file. Rename it to avoid unique build rules since there's no difference to the generated manual.
2022-01-22bfd: replace doc header generation with pattern rulesMike Frysinger2-156/+12
This unifies boilerplate rules for most files with pattern rules.
2022-01-22Change version number to 2.38.50 and regenerate filesNick Clifton4-67/+73
2022-01-22Add markers for 2.38 branchNick Clifton1-0/+4
2022-01-22Automatic date update in version.inGDB Administrator1-1/+1
2022-01-21drop old unused stamp-h.in fileMike Frysinger1-1/+0
This was needed by ancient versions of automake, but that hasn't been the case since at least automake-1.5, so punt this from the tree.
2022-01-21Automatic date update in version.inGDB Administrator1-1/+1
2022-01-20Automatic date update in version.inGDB Administrator1-1/+1
2022-01-19PowerPC64 DT_RELR ELFv1Alan Modra1-14/+14
More fun with R_PPC64_NONE found in .opd. Fixed by the allocate_dynrelocs and ppc64_elf_size_dynamic_sections changes, and since we are doing ifunc, opd and SYMBOL_REFERENCES_LOCAL tests later, don't duplicate that work in check_relocs. * elf64-ppc.c (ppc64_elf_check_relocs): Remove opd and ifunc conditions for rel_count. (dec_dynrel_count): Likewise. (allocate_dynrelocs): Test for opd and ifunc when allocating relative relocs. (ppc64_elf_size_dynamic_sections): Likewise.
2022-01-19PowerPC64 DT_RELR local PLTAlan Modra1-1/+2
Similarly to the local GOT case. * elf64-ppc.c (ppc64_elf_size_dynamic_sections): Don't allocate space for PLT relocs against local syms when enable_dt_relr.