aboutsummaryrefslogtreecommitdiff
path: root/bfd
AgeCommit message (Collapse)AuthorFilesLines
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
2024-04-28Automatic date update in version.inGDB Administrator1-1/+1
2024-04-27Automatic date update in version.inGDB Administrator1-1/+1
2024-04-26Automatic date update in version.inGDB Administrator1-1/+1
2024-04-25LoongArch: Add bad static relocation check and output more information to userLulu Cai1-2/+31
Absolute address symbols cannot be used with -shared. We output more information to the user than just BFD_ASSETR.
2024-04-25LoongArch: The symbol got type can only be obtained after initializationLulu Cai1-1/+8
When scanning relocations and determining whether TLS type transition is possible, it will try to obtain the symbol got type. If the symbol got type record has not yet been allocated space and initialized, it will cause ld to crash. So when uninitialized, the symbol is set to GOT_UNKNOWN.
2024-04-25Automatic date update in version.inGDB Administrator1-1/+1
2024-04-24Automatic date update in version.inGDB Administrator1-1/+1
2024-04-23bfd: Remove duplicate word in elf-vxworks.cOlivier Hainque1-1/+1
PR ld/31652 * elf-vxworks.c (elf_vxworks_emit_relocs): Drop duplicate word.
2024-04-23PR31667, objcopy/strip corrupts solaris binariesAlan Modra1-7/+6
Using want_p_paddr_set_to_zero in commit 45d92439aebd was wrong. Even solaris targets don't have want_p_paddr_set_to_zero, but we should handle them at least somewhat reasonably. PR 31667 * elf.c (IS_SECTION_IN_INPUT_SEGMENT): Remove bed arg, add paddr_valid. Don't use bed->want_p_paddr_set_to_zero. (INCLUDE_SECTION_IN_SEGMENT): Likewise. (rewrite_elf_program_header): Adjust to suit.
2024-04-23ignore some symbols in elf.c:swap_out_symsAlan Modra1-55/+48
The reason behind this patch was noticing that generic ELF targets fail to remove "bar" in the recently committed ld-elf/undefweak-1 test. (Despite that, those targets pass the test due to it being too strict when matching symbols. "bar" gets turned into a local weak defined absolute symbol.) swap_out_syms currently drops local section syms that are defined in discarded sections. Extend that to also drop other symbols in discarded sections too, even global symbols. The linker goes to quite a lot of effort to ensure globals in discarded section take a definition from the kept linkonce or comdat group section. So the global sym change should only affect cases where something is quite wrong about the set of linkonce or comdat group sections. However that change to elf_map_symbols meant we dropped _DYNAMIC_LINK / _DYNAMIC_LINKING for mips, a global absolute symbol given STT_SECTION type for some reason. That problem is fixed by reverting the pr14493 change which is no longer needed due to a) BSF_SECTION_SYM_USED on x86, and b) fixing objcopy to use copy_private_symbol_data. bfd/ PR 14493 * elf.c (ignore_sym): Rename from ignore_section_sym. Return true for any symbol without a section or in a discarded section. Revert pr14493 change. (elf_map_symbols): Tidy. Use ignore_sym on all symbols. (swap_out_syms): Tidy. ld/ * testsuite/ld-elf/undefweak-1.rd: Match any "bar".
2024-04-23copy_private_symbol_dataAlan Modra1-2/+2
bfd_copy_private_symbol_data is a bfd function that appeared in commit 89665c8562da a long time ago, but seemingly wasn't used anywhere until Jan added it to gas/symbols.c in commit 6a2b6326c21e. The function is used to modify ELF symbol st_shndx for symbols defined in odd sections like .symtab, so that they get the corresponding section st_shndx in an output file. This patch fixes some bitrot in the function. After commit c03551323c04 which introduced output_elf_obj_tdata, elf_strtab_sec and elf_shstrtab_sec will segfault if used on an input bfd. PR 14493 * elf.c (_bfd_elf_copy_private_symbol_data): Don't use elf_strtab_sec and elf_shstrtab_sec.
2024-04-23Automatic date update in version.inGDB Administrator1-1/+1
2024-04-22Automatic date update in version.inGDB Administrator1-1/+1
2024-04-21Automatic date update in version.inGDB Administrator1-1/+1
2024-04-20Automatic date update in version.inGDB Administrator1-1/+1
2024-04-19Re: elf: Strip unreferenced weak undefined symbolsAlan Modra1-2/+3
PR ld/31652 * elflink.c (_bfd_elf_link_output_relocs): Don't segfault on NULL rel_hash.
2024-04-18elf: Strip unreferenced weak undefined symbolsH.J. Lu3-28/+47
Linker will resolve an undefined symbol only if it is referenced by relocation. Unreferenced weak undefined symbols serve no purpose. Weak undefined symbols appear in the dynamic symbol table only when they are referenced by dynamic relocation. Mark symbols with relocation and strip undefined weak symbols if they don't have relocation and aren't in the dynamic symbol table. bfd/ PR ld/31652 * elf-bfd.h (elf_link_hash_entry): Add has_reloc. * elf-vxworks.c (elf_vxworks_emit_relocs): Set has_reloc. * elflink.c (_bfd_elf_link_output_relocs): Likewise. (elf_link_output_extsym): Strip undefined weak symbols if they don't have relocation and aren't in the dynamic symbol table. ld/ PR ld/31652 * testsuite/ld-elf/elf.exp: Run undefweak tests. * testsuite/ld-elf/undefweak-1.rd: New file. * testsuite/ld-elf/undefweak-1a.s: Likewise. * testsuite/ld-elf/undefweak-1b.s: Likewise. * testsuite/ld-x86-64/weakundef-1.nd: Likewise. * testsuite/ld-x86-64/weakundef-1a.s: Likewise. * testsuite/ld-x86-64/weakundef-1b.s: Likewise. * testsuite/ld-x86-64/x86-64.exp: Run undefweak tests.
2024-04-19memory leak in bfd/dwarf2.cAlan Modra1-0/+2
* dwarf2.c (_bfd_dwarf2_cleanup_debug_info): Free dwarf_addr_buffer and dwarf_str_offsets_buffer.
2024-04-19Automatic date update in version.inGDB Administrator1-1/+1
2024-04-18HPPA64 linker: Do not force the generation of DT_FLAGS for Linux targets.Nick Clifton1-4/+12
PR 30743
2024-04-18Re: Fix address violations when reading corrupt VMS recordsAlan Modra1-9/+15
Fixes error reports about the length of EEOM records produced by gas. PR 21618 * vms-alpha.c (evax_bfd_print_emh): Don't read subtyp if short record. Consolidate error messages. (evax_bfd_print_eeom): Allow length 10 record.
2024-04-18alpha_vms_get_section_contents vs. fuzzed filesAlan Modra1-24/+26
This patch is in response to an oss-fuzz report regarding use-of-uninitialized-value in bfd_is_section_compressed_info from section contents provided by alpha_vms_get_section_contents. That hole is covered by using bfd_zalloc rather than bfd_alloc. The rest of the patch is mostly a tidy. In a function returning section contents, I tend to prefer a test on the section properties over a test on file properties. That's why I've changed the file flags test to one on section filepos and flags before calling _bfd_generic_get_section_contents. Also, fuzzed objects can easily have sections with file backing in relocatable objects, or sections without file backing in images. Possible confusion is avoided by testing each section. Note that we are always going to run into out-of-memory with fuzzed alpha-vms object files due to sections with contents via ETIR records. eg. ETIR__C_STO_IMMR stores a number of bytes repeatedly, with a 32-bit repeat count. So section contents can be very large from a relatively small file. I'm inclined to think that an out-of-memory error is fine for such files. * vms-alpha.c (alpha_vms_get_section_contents): Handle sections with non-zero filepos or without SEC_HAS_CONTENTS via _bfd_generic_get_section_contents. Zero memory allocated for sections filled by ETIR records.
2024-04-18Automatic date update in version.inGDB Administrator1-1/+1
2024-04-16elf: Skip the archive if the symbol isn't referencedH.J. Lu1-3/+5
Also skip the archive if the symbol isn't referenced by a regular object. bfd/ PR ld/31644 * elflink.c (elf_link_add_archive_symbols): Also skip the archive if the symbol isn't referenced by a regular object. ld/ PR ld/31644 * testsuite/ld-plugin/lto.exp: Run PR ld/31644 tests. * testsuite/ld-plugin/pr31644a.c: New test. * testsuite/ld-plugin/pr31644b.c: Likewise. * testsuite/ld-plugin/pr31644c.c: Likewise.
2024-04-17Automatic date update in version.inGDB Administrator1-1/+1
2024-04-17ARC e_flags vs. objcopyAlan Modra1-6/+6
While the patch that Nick reverted in commit 3f6a060c7543 was in the source, "FAIL: objcopy executable (pr25662)" was seen on ARC. The failure was triggered by the .ARC.attributes section being removed by the linker script. When a file lacking this section is copied by objcopy, e_flags from the input is copied to the output (in this case the value 0x406), but arc_elf_final_write_processing then logical-ors in 0x300 when Tag_ARC_ABI_osver is not found. * elf32-arc.c (arc_elf_final_write_processing): Don't ignore existing e_flags for objcopy.