aboutsummaryrefslogtreecommitdiff
path: root/bfd
AgeCommit message (Collapse)AuthorFilesLines
2024-06-03Automatic date update in version.inGDB Administrator1-1/+1
2024-06-02Automatic date update in version.inGDB Administrator1-1/+1
2024-06-01Automatic date update in version.inGDB Administrator1-1/+1
2024-05-31aarch64: Add DT_RELR supportSzabolcs Nagy2-1/+439
The logic to decide if an input relocation for a symbol becomes a particular kind of output relocation is one of the hard to maintain parts of the bfd ld backend, since it is partially repeated across elfNN_aarch64_check_relocs (where dynamic relocations are counted per symbol and input section), elfNN_aarch64_late_size_sections (where relocation sections are sized and GOT offsets assigned), elfNN_aarch64_relocate_section (where most relocations are applied and output to a relocation section), elfNN_aarch64_finish_dynamic_symbol (where some of the GOT relocations are applied and output). The DT_RELR support adds another layer to this complexity: after the output relocation sections are sized, so all dynamic relocations are accounted (in elfNN_aarch64_late_size_sections), we scan the symbols and input relocations again to decide which ones become relative relocations that can be packed. The sizes of the relocation sections are updated accordingly. This logic must be consistent with the code that applies the relocs later so each relative relocation is emitted exactly once: either in .rela.* or packed in .relr.dyn. Sizing of .relr.dyn is done via elfNN_aarch64_size_relative_relocs that may be called repeatedly whenever the layout changes since an address change can affect the size of the packed format. Then the final content is emitted in elfNN_aarch64_finish_relative_relocs, that is called after the layout is final and before relocations are applied and emitted. These hooks are only called if DT_RELR is enabled. We only pack relative relocs that are known to be aligned in the output during .relr.dyn sizing, the potentially unaligned relative relocs are emitted normally (in .rela.*, not packed), because the format requires aligned addresses.
2024-05-31Automatic date update in version.inGDB Administrator1-1/+1
2024-05-30Automatic date update in version.inGDB Administrator1-1/+1
2024-05-29Automatic date update in version.inGDB Administrator1-1/+1
2024-05-28Updated Spanish translation for the BFD sub-directory.Nick Clifton1-4754/+7118
2024-05-28Automatic date update in version.inGDB Administrator1-1/+1
2024-05-28RISC-V: Fixed overwritten IRELATIVE relocs in the .rel.iplt for data reloc.Nelson Chu1-6/+16
This was originally reported by Hau Hsu <hau.hsu@sifive.com>. Similar to commit 51a8a7c2e3cc0730831963651a55d23d1fae624d We shouldn't use riscv_elf_append_rela to add dynamic relocs into .rela.iplt in the riscv_elf_relocate_section when handling ifunc data reloc R_RISCV_32/64. This just like what did in the riscv_elf_finish_dynamic_symbol. bfd/ * elfnn-riscv.c (riscv_elf_relocate_section): We shouldn't use riscv_elf_append_rela to add dynamic relocs into .rela.iplt in the riscv_elf_relocate_section when handling ifunc data reloc. ld/ * testsuite/ld-riscv-elf/ifunc-overwrite.s: Updated and renamed. * testsuite/ld-riscv-elf/ifunc-overwrite-exe.rd: Likewise. * testsuite/ld-riscv-elf/ifunc-overwrite-pic.rd: Likewise. * testsuite/ld-riscv-elf/ifunc-overwrite-pie.rd: Likewise. * testsuite/ld-riscv-elf/ifunc-overwrite.d: Renamed.
2024-05-28RISC-V: Segment fault for kernel purgatory when linking.Nelson Chu1-13/+10
This was originally reported by Ard Biesheuvel <ardb@kernel.org>. The followings are reproduce steps, https://lore.kernel.org/all/202404260640.9GQVTmrw-lkp@intel.com/T/#u The segment fault happens in the riscv_elf_finish_dynamic_sections when the output got section is an ABS. Refer to MIPS code, they added an extra bfd_is_abs_section check to avoid ABS got, so this seems the right and easier way to go in the short-term. bfd/ * elfnn-riscv.c (riscv_elf_finish_dynamic_sections): Set sh_entsize and fill the got entries only when the got isn't an ABS section, and the size of got is larger than zero. The similar goes for gotplt, except we already reported error when the gotplt is an ABS.
2024-05-27LoongArch: Fix relaxation overflow caused by ld -z separate-codemengqinggang1-39/+62
ld -z separate-code let .text and .rodata in two different but read only segment. If the symbol and pc in two segment, the offset from pc to symbol need to consider segment alignment. Add a function 'loongarch_two_sections_in_same_segment' to determine whether two sections are in the same segment.
2024-05-27Automatic date update in version.inGDB Administrator1-1/+1
2024-05-26Automatic date update in version.ingdb-15-branchpointGDB Administrator1-1/+1
2024-05-25Automatic date update in version.inGDB Administrator1-1/+1
2024-05-24Automatic date update in version.inGDB Administrator1-1/+1
2024-05-23Automatic date update in version.inGDB Administrator1-1/+1
2024-05-22Automatic date update in version.inGDB Administrator1-1/+1
2024-05-21Automatic date update in version.inGDB Administrator1-1/+1
2024-05-20Automatic date update in version.inGDB Administrator1-1/+1
2024-05-19Automatic date update in version.inGDB Administrator1-1/+1
2024-05-18Automatic date update in version.inGDB Administrator1-1/+1
2024-05-17bfd: sframe: minor code adjustments and fix typosIndu Bhagat1-7/+5
bfd/ * elfxx-x86.c (_bfd_x86_elf_create_sframe_plt): Use local variable. (_bfd_x86_elf_size_dynamic_sections): Fix typos.
2024-05-17Automatic date update in version.inGDB Administrator1-1/+1
2024-05-16Automatic date update in version.inGDB Administrator1-1/+1
2024-05-15Automatic date update in version.inGDB Administrator1-1/+1
2024-05-14Improve objdump -p output of PE Import and Export TablesPali Roh?r1-23/+38
PR 31738
2024-05-14arm: remove Maverick support from BFD.Richard Earnshaw2-74/+22
Remove the handling of Maverick from BFD. Where appropriate we handle legacy code by mapping ep9312 onto Armv4t.
2024-05-14Automatic date update in version.inGDB Administrator1-1/+1
2024-05-13Automatic date update in version.inGDB Administrator1-1/+1
2024-05-12Automatic date update in version.inGDB Administrator1-1/+1
2024-05-11Automatic date update in version.inGDB Administrator1-1/+1
2024-05-10Automatic date update in version.inGDB Administrator1-1/+1
2024-05-09Automatic date update in version.inGDB Administrator1-1/+1
2024-05-08Fix RELOC_FOR_GLOBAL_SYMBOLS macro so that it can cope with user defined ↵Nick Clifton1-2/+8
symbols that start with __wrap_. PR 31710
2024-05-08RISC-V: Support B, Zaamo and Zalrsc extensions.Nelson Chu1-4/+16
* https://github.com/riscv/riscv-b/tags Added standard B extension back, which implies Zba, Zbb and Zbs extensions. * https://github.com/riscv/riscv-zaamo-zalrsc/tags Splited standard A extension into two new extensions, Zaamo and Zalrsc. The A extension implies Zaamo and Zalrsc extensions. Not sure if we need to do the similar check as i and zicsr/zifencei. Passed riscv[32|64]-[elf/linux] binutils testcases. bfd/ * elfxx-riscv.c (riscv_implicit_subsets): Added imply rules for A and B extensions. The A implies Zaamo and Zalrsc, the B implies Zba, Zbb and Zbs. (riscv_supported_std_ext): Supported B extension with v1.0. (riscv_supported_std_z_ext): Supported Zaamo and Zalrsc with v1.0. (riscv_multi_subset_supports, riscv_multi_subset_supports_ext): Updated. include/ * opcode/riscv.h (riscv_insn_class): Removed INSN_CLASS_A, Added INSN_CLASS_ZAAMO and INSN_CLASS_ZALRSC. opcodes/ * riscv-opc.c (riscv_opcodes): Splited standard A extension into two new extensions, Zaamo and Zalrsc. gas/ * testsuite/gas/riscv/march-imply-a.d: New testcase. * testsuite/gas/riscv/march-imply-b.d: New testcase. * testsuite/gas/riscv/attribute-01.d: Updated. * testsuite/gas/riscv/attribute-02.d: Updated. * testsuite/gas/riscv/attribute-03.d: Updated. * testsuite/gas/riscv/attribute-04.d: Updated. * testsuite/gas/riscv/attribute-05.d: Updated. * testsuite/gas/riscv/attribute-10.d: Updated. * testsuite/gas/riscv/mapping-symbols.d: Updated. * testsuite/gas/riscv/march-imply-g.d: Updated. * testsuite/gas/riscv/march-imply-unsupported.d: Updated. * testsuite/gas/riscv/march-ok-reorder.d: Updated. ld/ * testsuite/ld-riscv-elf/attr-merge-arch-01.d: Updated. * testsuite/ld-riscv-elf/attr-merge-arch-02.d: Updated. * testsuite/ld-riscv-elf/attr-merge-arch-03.d: Updated. * testsuite/ld-riscv-elf/attr-merge-user-ext-01.d: Updated.
2024-05-08Automatic date update in version.inGDB Administrator1-1/+1
2024-05-07Automatic date update in version.inGDB Administrator1-1/+1
2024-05-06Automatic date update in version.inGDB Administrator1-1/+1
2024-05-05Automatic date update in version.inGDB Administrator1-1/+1
2024-05-04bus error with fuzzed archive elementAlan Modra1-1/+12
* libbfd.c (bfd_mmap_local): Sanity check rsize against actual file offset and size, not an archive element offset and size.
2024-05-04Automatic date update in version.inGDB Administrator1-1/+1
2024-05-03Automatic date update in version.inGDB Administrator1-1/+1
2024-05-02Automatic date update in version.inGDB Administrator1-1/+1
2024-05-01Automatic date update in version.inGDB Administrator1-1/+1
2024-04-30RISC-V: PR29823, defined the missing elf_backend_obj_attrs_handle_unknown.Nelson Chu1-0/+13
bfd/ PR 29823 * elfnn-riscv.c (riscv_elf_obj_attrs_handle_unknown): New function. (elf_backend_obj_attrs_handle_unknown): Defined to riscv_elf_obj_attrs_handle_unknown.
2024-04-30Automatic date update in version.inGDB Administrator1-1/+1
2024-04-29Fix initiali state of DWARF v5 line number table in BFD libraryNick Clifton1-4/+3
PR 30783
2024-04-29Fix building Loongarch BFD with a 32-bit compilerNick Clifton1-1/+1
2024-04-29Automatic date update in version.inGDB Administrator1-1/+1