summaryrefslogtreecommitdiff
path: root/bfd
AgeCommit message (Collapse)Author
2024-01-31Automatic date update in version.inGDB Administrator
2024-01-30Automatic date update in version.inGDB Administrator
2024-01-30PR31314, chew crashing on use of uninitialized valueAlan Modra
The "drop" call in wrap_comment already increments pc. Defining DOCDD in proto.str is a warning fix. PR 31314 * chew.c (wrap_comment): Don't increment pc. * proto.str (DOCDD): Define.
2024-01-29bfd: restore Threading menu entry in bfd.texiJose E. Marchesi
I mistakenly vandalized bfd.texi in the commit 0c45feb159a14ca4cb50cfbf45eacaf5a6cecf2b by removing an entry in the manual menu. This commit reverts that thunk.
2024-01-29bpf: there is no ldinddw nor ldabsdw instructionsJose E. Marchesi
There are no legacy ldind nor ldabs BPF instructions with BPF_SIZE_DW. For some reason we were (incorrectly) supporting these. This patch updates the opcodes so the instructions get removed and modifies the GAS manual and testsuite accordingly. See discussion at https://lore.kernel.org/bpf/110aad7a-f8a3-46ed-9fda-2f8ee54dcb89@linux.dev Tested in bpf-uknonwn-none target, x86-64-linux-gnu host. include/ChangeLog: 2024-01-29 Jose E. Marchesi <jose.marchesi@oracle.com> * opcode/bpf.h (enum bpf_insn_id): Remove BPF_INSN_LDINDDW and BPF_INSN_LDABSDW instructions. opcodes/ChangeLog: 2024-01-29 Jose E. Marchesi <jose.marchesi@oracle.com> * bpf-opc.c (bpf_opcodes): Remove BPF_INSN_LDINDDW and BPF_INSN_LDABSDW instructions. gas/ChangeLog: 2024-01-29 Jose E. Marchesi <jose.marchesi@oracle.com> * doc/c-bpf.texi (BPF Instructions): There is no indirect 64-bit load instruction. (BPF Instructions): There is no absolute 64-bit load instruction. * testsuite/gas/bpf/mem.s: Update test accordingly. * testsuite/gas/bpf/mem-be-pseudoc.d: Likewise. * testsuite/gas/bpf/mem-be.d: Likewise. * testsuite/gas/bpf/mem-pseudoc.d: Likewise. * testsuite/gas/bpf/mem-pseudoc.s: Likewise. * testsuite/gas/bpf/mem.d: Likewise. * testsuite/gas/bpf/mem.s: Likewise.
2024-01-29Remove support for the beos file formatNick Clifton
2024-01-29Automatic date update in version.inGDB Administrator
2024-01-28Automatic date update in version.inGDB Administrator
2024-01-27Automatic date update in version.inGDB Administrator
2024-01-26LoongArch: Fix a bug of getting relocation typemengqinggang
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 addendmengqinggang
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 Administrator
2024-01-25Automatic date update in version.inGDB Administrator
2024-01-24Automatic date update in version.inGDB Administrator
2024-01-23Automatic date update in version.inGDB Administrator
2024-01-22Updated Serbian translations for th bfd, gold and opcodes directoriesNick Clifton
2024-01-22LoongArch: Do not add DF_STATIC_TLS for TLS LETatsuyuki Ishi
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 Administrator
2024-01-21Automatic date update in version.inGDB Administrator
2024-01-20Automatic date update in version.inGDB Administrator
2024-01-19Remove hosts/mipsbsd.h and scripttempl/mipsbsd.scH.J. Lu
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 Administrator
2024-01-18Updated translations for various sub-directoriesNick Clifton
2024-01-18Automatic date update in version.inGDB Administrator
2024-01-18PR30824 internal error with -z pack-relative-relocsAlan Modra
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 Ruoyao
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 Administrator
2024-01-16Automatic date update in version.inGDB Administrator
2024-01-15Change version to 2.42.50 and regenerate filesNick Clifton
2024-01-15Add markers for 2.42 branchNick Clifton
2024-01-15bfd: riscv_maybe_function_sym check _bfd_elf_is_local_label_nameMark Wielaard
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 Administrator
2024-01-14Automatic date update in version.inGDB Administrator
2024-01-13Automatic date update in version.inGDB Administrator
2024-01-12bpf: fix relocation addend incorrect symbol valueDavid Faust
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 alignmentmengqinggang
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 Administrator
2024-01-11Automatic date update in version.inGDB Administrator
2024-01-10Automatic date update in version.inGDB Administrator
2024-01-09elf: Add elf_backend_add_glibc_version_dependencyH.J. Lu
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. Lu
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 Beulich
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 Administrator
2024-01-08bpf: Added linker support for R_BPF_64_NODYLD32.Cupertino Miranda
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 Bugaev
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 Administrator
2024-01-07Automatic date update in version.inGDB Administrator
2024-01-06Automatic date update in version.inGDB Administrator
2024-01-05loongarch: 'index' shadows globalAlan Modra
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 Modra
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.