aboutsummaryrefslogtreecommitdiff
path: root/bfd
AgeCommit message (Collapse)AuthorFilesLines
2024-01-28Automatic date update in version.inGDB Administrator1-1/+1
2024-01-27Automatic date update in version.inGDB Administrator1-1/+1
2024-01-26LoongArch: Fix a bug of getting relocation typemengqinggang1-1/+1
The old code works because R_LARCH_RELAX has no symbol index. It causes '(rel + 1)->r_info == R_LARCH_RELAX' is 1 and ELFNN_R_TYPE (1) is 1.
2024-01-26LoongArch: ld: Add support for TLS LE symbol with addendmengqinggang1-3/+2
Add support for TLS LE symbol with addend, such as: lu12i.w $t0, %le_hi20(a + 0x8) ori $t0, $t0, %le_lo12(a + 0x8)
2024-01-26Automatic date update in version.inGDB Administrator1-1/+1
2024-01-25Automatic date update in version.inGDB Administrator1-1/+1
2024-01-24Automatic date update in version.inGDB Administrator1-1/+1
2024-01-23Automatic date update in version.inGDB Administrator1-1/+1
2024-01-22Updated Serbian translations for th bfd, gold and opcodes directoriesNick Clifton1-1243/+1417
2024-01-22LoongArch: Do not add DF_STATIC_TLS for TLS LETatsuyuki Ishi1-2/+0
TLS LE is exclusively for executables, while DF_STATIC_TLS is for DLLs. DF_STATIC_TLS should only be set for TLS IE (and when it's DLL), not LE.
2024-01-22Automatic date update in version.inGDB Administrator1-1/+1
2024-01-21Automatic date update in version.inGDB Administrator1-1/+1
2024-01-20Automatic date update in version.inGDB Administrator1-1/+1
2024-01-19Remove hosts/mipsbsd.h and scripttempl/mipsbsd.scH.J. Lu1-31/+0
Remove hosts/mipsbsd.h and scripttempl/mipsbsd.sc which are unused after commit 3596d8ceb2cdc35b4fd702ee9daace5a2d880174 Author: Alan Modra <amodra@gmail.com> Date: Wed Apr 18 15:39:34 2018 +0930 Remove mips aout, coff, and pe support bfd/ * hosts/mipsbsd.h: Removed. ld/ * scripttempl/mipsbsd.sc: Removed.
2024-01-19Automatic date update in version.inGDB Administrator1-1/+1
2024-01-18Updated translations for various sub-directoriesNick Clifton3-3716/+4262
2024-01-18Automatic date update in version.inGDB Administrator1-1/+1
2024-01-18PR30824 internal error with -z pack-relative-relocsAlan Modra1-24/+28
This corrects a counting problem, where prior to relocate_section relr encoded relative relocs were allowed when it was known they were on even boundaries, but relocate_section can only put relative relocs (non-relr) on eight byte boundaries. PR 30824 * elf64-ppc.c (RELR_ALIGN): Define, use throughout. (maybe_relr): New function, use throughout.
2024-01-17LoongArch: Adapt R_LARCH_{PCALA,GOT,TLS_IE,TLS_DESC}64_* handling per psABI ↵Xi Ruoyao1-13/+18
v2.30 In LoongArch psABI v2.30, an offset (-8 for LO20 and -12 for HI12) should be applied on PC for these reloc types to avoid wrong relocation when the instruction sequence crosses a page boundary. The lld linker has already adapted the change. Make it for the bfd linker too. Link: https://github.com/loongson/la-abi-specs/releases/v2.30 Link: https://github.com/loongson-community/discussions/issues/17 Link: https://github.com/llvm/llvm-project/pull/73387 Signed-off-by: Xi Ruoyao <xry111@xry111.site>
2024-01-17Automatic date update in version.inGDB Administrator1-1/+1
2024-01-16Automatic date update in version.inGDB Administrator1-1/+1
2024-01-15Change version to 2.42.50 and regenerate filesNick Clifton3-511/+540
2024-01-15Add markers for 2.42 branchNick Clifton1-0/+4
2024-01-15bfd: riscv_maybe_function_sym check _bfd_elf_is_local_label_nameMark Wielaard1-1/+2
This fixes the ld "Handle no DWARF information" testcase. Which currently fails on riscv because a local label name is assumed to be the current function name. bfd/ChangeLog: * elfnn-riscv.c (riscv_maybe_function_sym): Also check _bfd_elf_is_local_label_name.
2024-01-15Automatic date update in version.inGDB Administrator1-1/+1
2024-01-14Automatic date update in version.inGDB Administrator1-1/+1
2024-01-13Automatic date update in version.inGDB Administrator1-1/+1
2024-01-12bpf: fix relocation addend incorrect symbol valueDavid Faust2-14/+26
Relocations installed by the BPF ELF backend were sometimes incorrectly adding the symbol value to the relocation entry addend, when the correct relocation value was already stored in the addend. This could lead to a relocation effectively adding the symbol value twice. Fix that by making bpf_elf_generic_reloc () more similar to the flow of bfd_install_relocation in the case where howto->install_addend is set, which is how it ought to behave. bfd/ * bpf-reloc.def (R_BPF_64_ABS32, R_BPF_64_ABS64) (R_BPF_64_NODYLD32): Set partial_inplace to true. * elf64-bpf.c (bpf_elf_generic_reloc): Do not include the value of the symbol when installing relocation. Copy some additional logic from bfd_elf_generic_reloc. gas/ * testsuite/gas/bpf/bpf.exp: Run new test. * testsuite/gas/bpf/elf-relo-1.d: New. * testsuite/gas/bpf/elf-relo-1.s: New.
2024-01-12LoongArch: Fix relaxation overflow caused by section alignmentmengqinggang1-22/+57
When deleting NOP instructions addend by .align at second pass, this may cause the PC decrease but the symbol address to remain unchanged due to section alignment. To solve this question, we subtract a maximux alignment of all sections like RISC-V.
2024-01-12Automatic date update in version.inGDB Administrator1-1/+1
2024-01-11Automatic date update in version.inGDB Administrator1-1/+1
2024-01-10Automatic date update in version.inGDB Administrator1-1/+1
2024-01-09elf: Add elf_backend_add_glibc_version_dependencyH.J. Lu4-62/+139
When -z mark-plt is used to add DT_X86_64_PLT, DT_X86_64_PLTSZ and DT_X86_64_PLTENT, the r_addend field of the R_X86_64_JUMP_SLOT relocation stores the offset of the indirect branch instruction. However, glibc versions which don't have this commit in glibc 2.36: commit f8587a61892cbafd98ce599131bf4f103466f084 Author: H.J. Lu <hjl.tools@gmail.com> Date: Fri May 20 19:21:48 2022 -0700 x86-64: Ignore r_addend for R_X86_64_GLOB_DAT/R_X86_64_JUMP_SLOT According to x86-64 psABI, r_addend should be ignored for R_X86_64_GLOB_DAT and R_X86_64_JUMP_SLOT. Since linkers always set their r_addends to 0, we can ignore their r_addends. Reviewed-by: Fangrui Song <maskray@google.com> won't ignore the r_addend value in the R_X86_64_JUMP_SLOT relocation. Although this commit has been backported to glibc 2.33/2.34/2.35 release branches, it is safer to require glibc 2.36 for such binaries. Extend the glibc version dependency of GLIBC_ABI_DT_RELR for DT_RELR to also add GLIBC_2.36 version dependency for -z mark-plt on the shared C library if it provides a GLIBC_2.XX symbol version. * elflink.c (elf_find_verdep_info): Moved to ... * elf-bfd.h (elf_find_verdep_info): Here. (elf_backend_data): Add elf_backend_add_glibc_version_dependency. (_bfd_elf_link_add_glibc_version_dependency): New function. (_bfd_elf_link_add_dt_relr_dependency): Likewise. * elf64-x86-64.c (elf_x86_64_add_glibc_version_dependency): Likewise. (elf_backend_add_glibc_version_dependency): New. * elflink.c (elf_link_add_dt_relr_dependency): Renamed to ... (elf_link_add_glibc_verneed): This. Modified to support other glibc dependencies. (_bfd_elf_link_add_glibc_version_dependency): Likewise. (_bfd_elf_link_add_dt_relr_dependency): Likewise. (bfd_elf_size_dynamic_sections): Call elf_backend_add_glibc_version_dependency instead of elf_link_add_dt_relr_dependency. * elfxx-target.h (elf_backend_add_glibc_version_dependency): New. (elfNN_bed): Add elf_backend_add_glibc_version_dependency. ld/ * testsuite/ld-x86-64/mark-plt-1a.rd: New file. * testsuite/ld-x86-64/mark-plt-1b.rd: Likewise. * testsuite/ld-x86-64/x86-64.exp: Run -z mark-plt test for GLIBC_2.36 dependency.
2024-01-09x86: Don't check R_386_NONE nor R_X86_64_NONEH.J. Lu2-0/+8
Update x86 ELF linker to skip R_386_NONE/R_X86_64_NONE when scanning relocations. bfd/ * PR ld/31047 * elf32-i386.c (elf_i386_scan_relocs): Don't check R_386_NONE. * elf64-x86-64.c (elf_x86_64_scan_relocs): Don't check R_X86_64_NONE. ld/ * PR ld/31047 * testsuite/ld-i386/i386.exp: Run PR ld/31047 test. * testsuite/ld-x86-64/x86-64.exp: Likewise. * testsuite/ld-i386/pr31047.d: New file. * testsuite/ld-x86-64/pr31047-x32.d: Likewise. * testsuite/ld-x86-64/pr31047.d: Likewise. * testsuite/ld-x86-64/pr31047a.s: Likewise. * testsuite/ld-x86-64/pr31047b.s: Likewise.
2024-01-09PPC64/ELF: adjust comment wrt ABI versionsJan Beulich1-1/+1
While having been moved a couple of times since its introduction in f6c7c3e8b742 ("Referencing a function's address on PowerPC64 ELFv2"), the wording has always remained the same. In particular ELFv1 and ELFv2 have always been the wrong way round.
2024-01-09Automatic date update in version.inGDB Administrator1-1/+1
2024-01-08bpf: Added linker support for R_BPF_64_NODYLD32.Cupertino Miranda2-7/+11
This patch adds linker support to patch R_BPF_64_NODYLD32 relocations. The implementation was based on comments and code in LLVM, as the GNU toolchain does not uses this relocation type.
2024-01-08Add support for the aarch64-gnu target (GNU/Hurd on AArch64)Sergey Bugaev1-1/+1
Also recognized are aarch64-*-gnu tagrets, e.g. aarch64-pc-gnu or aarch64-unknown-gnu. The ld/emulparams/aarch64gnu.sh file is (for now) identical to aarch64fbsd.sh, or to aarch64linux.sh with Linux-specific logic removed; and mainly different from the generic aarch64elf.sh in that it does not set EMBEDDED=yes. Coupled with a corresponding GCC patch, this produces a toolchain that can sucessfully build working binaries targeting aarch64-gnu. Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
2024-01-08Automatic date update in version.inGDB Administrator1-1/+1
2024-01-07Automatic date update in version.inGDB Administrator1-1/+1
2024-01-06Automatic date update in version.inGDB Administrator1-1/+1
2024-01-05loongarch: 'index' shadows globalAlan Modra1-2/+2
Avoid an error when compiling with older versions of gcc. * elfnn-loongarch.c (loongarch_relax_align): Rename "index" to "sym_index".
2024-01-05Tidy bfd_scan_vmaAlan Modra1-69/+4
In commit 83c79df86bf4 I removed configure tests for strtoull among other library functions part of C99, but didn't remove what is now dead code. * bfd.c (bfd_scan_vma): Delete fall-back for strtoull.
2024-01-05Automatic date update in version.inGDB Administrator1-1/+1
2024-01-04Update year range in copyright notice of binutils filesAlan Modra439-444/+444
Adds two new external authors to etc/update-copyright.py to cover bfd/ax_tls.m4, and adds gprofng to dirs handled automatically, then updates copyright messages as follows: 1) Update cgen/utils.scm emitted copyrights. 2) Run "etc/update-copyright.py --this-year" with an extra external author I haven't committed, 'Kalray SA.', to cover gas testsuite files (which should have their copyright message removed). 3) Build with --enable-maintainer-mode --enable-cgen-maint=yes. 4) Check out */po/*.pot which we don't update frequently.
2024-01-04LoongArch: Fix linker generate PLT entry for data symbolmengqinggang1-1/+5
With old "medium" code model, we call a function with a pair of PCALAU12I and JIRL instructions. The assembler produces something like: 8: 1a00000c pcalau12i $t0, 0 8: R_LARCH_PCALA_HI20 g c: 4c000181 jirl $ra, $t0, 0 c: R_LARCH_PCALA_LO12 g The linker generates a "PLT entry" for data without any diagnostic. If "g" is a data symbol and ld with -shared option, it may load two instructions in the PLT. Without -shared option, loongarch_elf_adjust_dynamic_symbol can delete PLT entry. For R_LARCH_PCALA_HI20 relocation, linker only generate PLT entry for STT_FUNC and STT_GNU_IFUNC symbols.
2024-01-04Automatic date update in version.inGDB Administrator1-1/+1
2024-01-03LoongArch: delete bfd/.elfnn-loongarch.c.swpmengqinggang1-0/+0
2024-01-03Automatic date update in version.inGDB Administrator1-1/+1
2024-01-02Automatic date update in version.inGDB Administrator1-1/+1