aboutsummaryrefslogtreecommitdiff
path: root/bfd
AgeCommit message (Collapse)AuthorFilesLines
2022-03-08Automatic date update in version.inGDB Administrator1-1/+1
2022-03-07Automatic date update in version.inGDB Administrator1-1/+1
2022-03-06Automatic date update in version.inGDB Administrator1-1/+1
2022-03-05Automatic date update in version.inGDB Administrator1-1/+1
2022-03-04Automatic date update in version.inGDB Administrator1-1/+1
2022-03-03comment typo fixAlan Modra1-1/+1
2022-03-03PowerPC64 DT_RELR relative reloc addressesAlan Modra1-49/+76
Section addresses can change between ppc64_elf_size_stubs and ppc64_elf_build_stubs due to .eh_frame editing. The idea of stashing r_offset final addresses calculated in ppc64_elf_size_stubs for use by ppc64_elf_build_stubs was never a good idea. Instead, we need to keep section/offset pairs. * elf64-ppc.c (struct ppc_link_hash_table): Delete relr_addr. Add relr section/offset array. (append_relr_off): Rewrite. Update all callers. (sort_relr): New function. (ppc64_elf_size_stubs): Adjust to suit new relative reloc stash. (ppc64_elf_build_stubs): Likewise.
2022-03-03Automatic date update in version.inGDB Administrator1-1/+1
2022-03-02Automatic date update in version.inGDB Administrator1-1/+1
2022-03-01Fix a typo in the previous delta to bfdio.c.Nick Clifton2-21/+30
PR 25713 * bfdio.c (_bfd_real_fopen): Fix typo.
2022-03-01Revert "Check thin archive element file size against archive header"Alan Modra1-11/+1
This reverts commit 48e3e6aec8a4f37d00ea6c0da3ab45e76490e3db. PR 28929 * archive.c (_bfd_get_elt_at_filepos): Don't check thin archive element file size.
2022-03-01Prevent an assertion from being triggered when linking an ARM object file ↵Nick Clifton2-0/+15
with incorrectly set build attributes. PR 28848 PR 28859 * elf32-arm.c (elf32_arm_merge_eabi_attributes): If the first input bfd has a Tag_ABI_HardFP_use set to 3 but does not also have TAG_FP_arch set then reset the TAG_ABI_HardFP_use.
2022-03-01Automatic date update in version.inGDB Administrator1-1/+1
2022-02-28Further correct the handling of long pathnames on Windows hosts.Torbj?rn Svensson2-39/+45
PR 25713 * bfdio.c (_bfd_real_fopen): Fix handling of parhs longer than 260 characters on Windows hosts.
2022-02-28Clarify the wording of the error message when an obsolete configuration is ↵Nick Clifton2-2/+7
encountered. PR 28886 * config.bfd: Update error message for obsolete configurations.
2022-02-28Automatic date update in version.inGDB Administrator1-1/+1
2022-02-27Automatic date update in version.inGDB Administrator1-1/+1
2022-02-26Automatic date update in version.inGDB Administrator1-1/+1
2022-02-25RISC-V: Remove a loop in the ISA parserTsukasa OI1-7/+4
Since commit e601909a3287bf541c6a7d82214bb387d2c76d82 ("RISC-V: Support to parse the multi-letter prefix in the architecture string.") changed so that all prefixed extensions are parsed in single riscv_parse_prefixed_ext call, a "while" loop on riscv_parse_subset is no longer required. bfd/ChangeLog: * elfxx-riscv.c (riscv_parse_subset): Remove unnecessary loop.
2022-02-25Automatic date update in version.inGDB Administrator1-1/+1
2022-02-24Automatic date update in version.inGDB Administrator1-1/+1
2022-02-23RISC-V: PR28733, add missing extension info to 'unrecognized opcode' errorPatrick O'Neill2-0/+97
Currently we report errors as "unrecognized opcode `fence.i'" when the opcode isn't part of the selected extensions. This patch expands that error message to include the missing extension information. For example, now the error message would be "unrecognized opcode `fence.i', extension `zifencei' required". If the opcode is not a part of any extension, the error message reverts to "unrecognized opcode `<op statement>'". Signed-off-by: Patrick O'Neill <patrick@rivosinc.com> bfd/ pr 28733 * elfxx-riscv.c (riscv_multi_subset_supports_ext): New function, used to return the extension string for each INSN_CLASS_*. * elfxx-riscv.h: Added extern riscv_multi_subset_supports_ext. gas/ pr 28733 * config/tc-riscv.c (struct riscv_ip_error): New structure, contains information about errors that occur within the riscv_ip. (riscv_ip): Use struct riscv_ip_error to report more detailed errors. * testsuite/gas/riscv/c-fld-fsd-fail.l: Updated. * testsuite/gas/riscv/march-imply-i2p1-01.: Likewise.
2022-02-23Automatic date update in version.inGDB Administrator1-1/+1
2022-02-22RISC-V: Maintain a string to hold the canonical orderKito Cheng1-17/+5
Using dummy entry in riscv_supported_std_ext cause confusing and wrongly support `b` and `k` extensions. bfd/ * elfxx-riscv.c (riscv_supported_std_ext): Drop unsupported extensions. (riscv_ext_canonical_order): New. (riscv_init_ext_order): Use riscv_ext_canonical_order rather than riscv_supported_std_ext to compute canonical order. V2 Changes: - Use `*ext` rather than `*ext != NULL` for checking is reach end of string.
2022-02-22Automatic date update in version.inGDB Administrator1-1/+1
2022-02-22Re: ld: Support customized output section typeAlan Modra2-9/+16
"DO NOT EDIT!" says the comment at the top of bfd-in2.h. Move the new type field where it belongs. PR ld/28841 * section.c (struct bfd_section): Add type. Formatting. (BFD_FAKE_SECTION): Formatting. * bfd-in2.h: Regenerate.
2022-02-21Automatic date update in version.inGDB Administrator1-1/+1
2022-02-20Automatic date update in version.inGDB Administrator1-1/+1
2022-02-19Automatic date update in version.inGDB Administrator1-1/+1
2022-02-18Automatic date update in version.inGDB Administrator1-1/+1
2022-02-17Updated Serbian translations for the bfd, gold, ld and opcodes directoriesNick Clifton2-1487/+1640
2022-02-17Automatic date update in version.inGDB Administrator1-1/+1
2022-02-16ld: Support customized output section typeFangrui Song4-5/+20
bfd/ PR ld/28841 * bfd-in2.h (struct bfd_section): Add type. (discarded_section): Add field. * elf.c (elf_fake_sections): Handle bfd_section::type. * section.c (BFD_FAKE_SECTION): Add field. * mri.c (mri_draw_tree): Update function call. ld/ PR ld/28841 * ld.texi: Document new output section type. * ldlex.l: Add new token TYPE. * ldgram.y: Handle TYPE=exp. * ldlang.h: Add type_section to list of section types. * ldlang.c (lang_add_section): Handle type_section. (map_input_to_output_sections): Handle type_section. * testsuite/ld-scripts/output-section-types.t: Add tests. * testsuite/ld-scripts/output-section-types.d: Update.
2022-02-16pe_ILF_make_a_symbol_reloc segfaultAlan Modra1-1/+1
pei-aarch64-little apparently lacks support for BFD_RELOC_RVA. * peicode.h (pe_ILF_make_a_symbol_reloc): Don't segfault on NULL howto.
2022-02-16What to do when sh_addralign isn't a power of twoAlan Modra1-6/+7
BFD generally doesn't handle anything but a power of two section alignment, and ELF sh_addralign is required to be an integral power of two (or zero) by the ELF spec. Of course this is ignored by fuzzers, and because bfd_log2 rounds up, we can end up with alignment_power being 32 on a 32-bit object or 64 on a 64-bit object. That then triggers ubsan warnings in places like bfd_update_compression_header where we want to convert from alignment_power back to an alignment. I suppose we could reject object files that have non-compliant sh_addralign, but I think it's also reasonable to use the greatest power of two divisor of sh_addralign, ie. the rightmost 1 bit. * elf.c (_bfd_elf_make_section_from_shdr): Use greatest power of two divisor of sh_addralign. (_bfd_elf_assign_file_position_for_section): Likewise. (assign_file_positions_for_non_load_sections): Likewise.
2022-02-16asan: buffer overflow in vms-alpha.cAlan Modra1-1/+3
* vms-alpha.c (evax_bfd_print_dst): Sanity check another place printing strings.
2022-02-16asan: buffer overflow in peXXigen.cAlan Modra1-4/+10
* peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Properly sanity check DataDirectory[PE_DEBUG_DATA].Size.
2022-02-16Automatic date update in version.inGDB Administrator1-1/+1
2022-02-15i386: Update I386_NEED_DYNAMIC_RELOC_TYPE_P for DT_TEXTRELH.J. Lu1-0/+1
Update I386_NEED_DYNAMIC_RELOC_TYPE_P to allow R_386_TLS_IE for relocation in read-only section. bfd/ PR ld/28894 * elfxx-x86.h (I386_NEED_DYNAMIC_RELOC_TYPE_P): Allow R_386_TLS_IE. ld/ PR ld/28894 * testsuite/ld-i386/i386.exp: Run pr28894. * testsuite/ld-i386/pr28894.d: New file. * testsuite/ld-i386/pr28894.s: Likewise.
2022-02-15Automatic date update in version.inGDB Administrator1-1/+1
2022-02-13ld: Keep indirect symbol from IR if referenced from shared objectH.J. Lu1-3/+2
Don't change indirect symbol defined in IR to undefined if it is referenced from shared object. bfd/ PR ld/28879 * elflink.c (_bfd_elf_merge_symbol): Don't change indirect symbol defined in IR to undefined if it is referenced from shared object. ld/ PR ld/28879 * testsuite/ld-plugin/lto.exp: Run PR ld/28879 tests. * testsuite/ld-plugin/pr28879a.cc: New file. * testsuite/ld-plugin/pr28879b.cc: Likewise.
2022-02-14Automatic date update in version.inGDB Administrator1-1/+1
2022-02-13Remove bfd ELF_RELROPAGESIZEAlan Modra6-23/+4
Now that ld properly aligns the end of the relro segment, the hack to make relro work on powerpc can disappear. bfd/ * bfd.c (bfd_emul_get_commonpagesize): Remove relro param. Don't return bed->relropagesize. * elf-bfd.h (struct elf_backend_data): Remove relropagesize. * elfxx-target.h (ELF_RELROPAGESIZE): Remove. * elf32-ppc.c (ELF_RELROPAGESIZE): Don't define. * elf64-ppc.c: Likewise. * bfd-in2.h: Regenerate. ld/ * ldemul.c (after_parse_default): Adjust bfd_emul_get_commonpagesize call.
2022-02-13Automatic date update in version.inGDB Administrator1-1/+1
2022-02-12Automatic date update in version.inGDB Administrator1-1/+1
2022-02-11x86: Disallow invalid relocation against protected symbolH.J. Lu4-4/+53
I am checking this into master and will backport it to 2.38 branch. H.J ---- On x86, GCC 12 supports -mno-direct-extern-access to enable canonical reference to protected function and disable copy relocation. With -mno-direct-extern-access, the canonical protected function symbols must be accessed via canonical reference and the protected data symbols in shared libraries are non-copyable. Under glibc 2.35, non-canonical reference to the canonical protected function will get the run-time error: ./y: internal_f: ./libfoo.so: non-canonical reference to canonical protected function and copy relocations against the non-copyable protected symbols will get the run-time error: ./x: internal_i: ./libfoo.so: copy relocation against non-copyable protected symbol Update x86 linker to disallow non-canonical reference to the canonical protected function: ld: plt.o: non-canonical reference to canonical protected function `internal_f' in libfoo.so ld: failed to set dynamic section sizes: bad value and copy relocation against the non-copyable protected symbol: ld: main.o: copy relocation against non-copyable protected symbol `internal_i' in libfoo.so at link-time. bfd/ PR ld/28875 * elf-properties.c (_bfd_elf_parse_gnu_properties): Don't skip shared libraries for GNU_PROPERTY_1_NEEDED_INDIRECT_EXTERN_ACCESS. * elf32-i386.c (elf_i386_scan_relocs): Disallow non-canonical reference to canonical protected function. * elf64-x86-64.c (elf_x86_64_scan_relocs): Likewise. * elfxx-x86.c (elf_x86_allocate_dynrelocs): Don't allow copy relocation against non-copyable protected symbol. ld/ PR ld/28875 * testsuite/ld-i386/i386.exp: Check non-canonical reference to canonical protected function and check copy relocation against non-copyable protected symbol. * testsuite/ld-i386/pr21997-1.err: New file. * testsuite/ld-i386/pr28875.err: Likewise. * testsuite/ld-i386/pr28875a.c: Likewise. * testsuite/ld-i386/pr28875b.c: Likewise. * testsuite/ld-x86-64/pr21997-1a.err: Updated. * testsuite/ld-x86-64/pr21997-1b.err: Likewise. * testsuite/ld-x86-64/pr28875-data.err: New file. * testsuite/ld-x86-64/pr28875-func.err: Likewise. * testsuite/ld-x86-64/x86-64.exp: Check non-canonical reference to canonical protected function and check copy relocation against non-copyable protected symbol.
2022-02-11bfd: Remove return with expression in void functionMichael Forney2-1/+6
* bfd.c (bfd_set_gp_value): Remove return with expression in void function.
2022-02-11Automatic date update in version.inGDB Administrator1-1/+1
2022-02-10Automatic date update in version.inGDB Administrator1-1/+1
2022-02-09Update the obsolete list and how-to-make-a-release documentation now that ↵Nick Clifton2-3/+8
the 2.38 release is out.