aboutsummaryrefslogtreecommitdiff
path: root/bfd
AgeCommit message (Collapse)AuthorFilesLines
2025-03-06Automatic date update in version.inGDB Administrator1-1/+1
2025-03-05elfxx-aarch64.c: Replace nested function with a static inline version instead.Nick Clifton1-10/+13
2025-03-05Automatic date update in version.inGDB Administrator1-1/+1
2025-03-04refactoring elf_find_and_remove_propertyMatthieu Longo1-15/+29
This refactoring focuses primarily on code readability and reuse. - Use the already defined _bfd_elf_find_property instead of another raw for-loop. - Extract _bfd_elf_remove_property out of the function body.
2025-03-04refactoring _bfd_elf_get_propertyMatthieu Longo2-18/+58
- Extract _bfd_elf_find_property and _bfd_elf_insert_property from the function's body to improve the code readability. - Export _bfd_elf_find_property's symbol as it will be used in a later commit.
2025-03-04refactoring bfd_linear_search_one_with_gnu_propertyMatthieu Longo1-30/+40
- remove the definition of the search predicate outside of the for loop. - change the function's return type to struct to adopt a more functional coding style.
2025-03-04aarch64: setup_gnu_properties only creates the notes section when none existsMatthieu Longo1-17/+26
The creation of .note.gnu.property section should not be based on the presence of GNU properties, but rather on whether this section exits or not. However, there is one exception to this: PR23900 [1]. Old linkers were treating .note.gnu.property as a generic note section, so old objects might contain properties inside .note instead of .note.gnu.property. In this case, the section won't be detected but the properties are still parsed. So the absence of the .note.gnu.property section is necessary but not enough to create the section. The condition of the creation of the section has also to include the absence of GNU properties. [1] PR23900: https://sourceware.org/bugzilla/show_bug.cgi?id=23900
2025-03-04clean-up bfd/elf-attrs.c: move specific-code to parse object attributes v1 ↵Matthieu Longo1-135/+147
into a new function
2025-03-04clean-up bfd: rename functions for object attributes v1Matthieu Longo1-42/+50
2025-03-04clean-up aarch64: move the name of the build attributes section into ↵Matthieu Longo1-1/+1
include/elf/aarch64.h
2025-03-04clean-up: move writing of build attributes section into a functionMatthieu Longo3-19/+38
- add obj_build_attributes to struct elf_backend_data similarly sframe. - new function _bfd_elf_write_section_build_attributes encapsulating the writing of the build attributes section into a function.
2025-03-04clean-up bfd/elf-attrs.c: change return type of uleb128_size to unsignedMatthieu Longo1-5/+4
2025-03-04clean-up: fix annoying spaces in bfd/elf-bfd.hMatthieu Longo1-1/+1
2025-03-04Automatic date update in version.inGDB Administrator1-1/+1
2025-03-04ecoff: check result of statAlan Modra1-3/+3
* ecoff.c (_bfd_ecoff_write_armap): Don't use statbuf.st_mtime if stat call returns non-zero. Use ARMAP_TIME_OFFSET rather than its expansion.
2025-03-04Move BFD_FAKE_SECTION to libbfd.hAlan Modra6-79/+65
BFD_FAKE_SECTION and its sidekick GLOBAL_SYM_INIT don't need to be cluttering bfd.h, and probably shouldn't be used outside bfd/. To make them internal to bfd, make the bfd ecoff small common section declaration global so it can be used instead of a duplicate in gas/ecoff.c. Oddly this needs to go in bfd/ecofflink.c rather than bfd/ecoff.c as the former is compiled for all targets needing the ecoff small common section (some via a call in gas/config/obj-elf.c to a function in gas/ecoff.c) while the latter is not. While doing this rename ecoff_scom_section to _bfd_ecoff_scom_section and remove support for traditional C from GLOBAL_SYM_INIT.
2025-03-03RISC-V: Support ssqosid extension with version 1.0.Kito Cheng1-0/+1
It only add one new CSR: `srmcfg`. Ref: https://github.com/riscv/riscv-ssqosid/releases/tag/v1.0
2025-03-03Automatic date update in version.inGDB Administrator1-1/+1
2025-03-02Automatic date update in version.inGDB Administrator1-1/+1
2025-03-01Automatic date update in version.inGDB Administrator1-1/+1
2025-02-28Automatic date update in version.inGDB Administrator1-1/+1
2025-02-27Updated translations for bfd and goldNick Clifton1-18/+14
2025-02-27Automatic date update in version.inGDB Administrator1-1/+1
2025-02-26Automatic date update in version.inGDB Administrator1-1/+1
2025-02-25x86: SFrame FDE for PLT0 does not use repetition block sizeJens Remus1-1/+1
The SFrame FDE for the PLT0 entry is of type PCINC, which does does not make use of the type PCMASK repetition block size. Therefore generate the FDE with a repetition block size of zero. bfd/ * elfxx-x86.c (_bfd_x86_elf_create_sframe_plt): Use FDE repetition block size of zero for PLT0. Signed-off-by: Jens Remus <jremus@linux.ibm.com>
2025-02-25Automatic date update in version.inGDB Administrator1-1/+1
2025-02-24Automatic date update in version.inGDB Administrator1-1/+1
2025-02-23Automatic date update in version.inGDB Administrator1-1/+1
2025-02-22Automatic date update in version.inGDB Administrator1-1/+1
2025-02-21ix86: drop dead part of a conditional in elf_i386_convert_load_reloc()Jan Beulich1-3/+3
A few lines up we would have already bailed when "baseless && is_pic".
2025-02-21x86-64: further tighten convert-load-reloc checkingJan Beulich1-2/+2
REX2.M affects what insn we're actually dealing with, so we better check this to avoid transforming (future) insns we must not touch.
2025-02-21x86: widen @got{,pcrel} support to PUSH and APX IMULJan Beulich2-18/+140
With us doing the transformation to an immediate operand for MOV and various ALU insns, there's little reason to then not support the same conversion for the other two insns which have respective immediate operand forms. Unfortunately for IMUL (due to the 0F opcode prefix) there's no suitable relocation, so the pre-APX forms cannot be marked for relaxation in the assembler.
2025-02-21x86/APX: use CS: in place of ES: in @gotpcrel and @gottpoff relaxationJan Beulich1-11/+11
H.J. requested this adjustment; I'm unaware of any specific technical background.
2025-02-21ix86: tighten convert-load-reloc checkingJan Beulich1-4/+5
Just like was done recently for x86-64 (commit 4998f9ea9d35): Even if the assembler avoids using the relaxable relocation for inapplicable insns, the relocation type can still appear for other reasons. Be more thorough in the opcode checking we do, to avoid bogusly altering other insns. Furthermore correct an opcode mask (even if with the added condition that's now fully benign).
2025-02-21Automatic date update in version.inGDB Administrator1-1/+1
2025-02-20Automatic date update in version.inGDB Administrator1-1/+1
2025-02-19Automatic date update in version.inGDB Administrator1-1/+1
2025-02-18PR32703, Null pointer dereference in bfd/linker.cAlan Modra2-2/+12
NULL is a possible return from bfd_section_already_linked_table_lookup if out-of-memory. PR 32703 * linker.c (_bfd_generic_section_already_linked): Catch bfd_section_already_linked_table_lookup failure. * coffgen.c (_bfd_coff_section_already_linked): Likewise.
2025-02-18Re: bfd_set_section_alignment errors.Alan Modra1-5/+4
Fix another one for aarch64.
2025-02-18Use bfd_link_align_section in a few more placesAlan Modra8-27/+16
Some of these aren't relevant to the relro bug. Some are. They all matter if early estimation of section layout needs to be good. PR ld/32690 * elf32-bfin.c (bfin_adjust_dynamic_symbol), * elf32-hppa.c (elf32_hppa_late_size_sections), * elf32-microblaze.c (microblaze_elf_adjust_dynamic_symbol), * elf32-nds32.c (nds32_elf_adjust_dynamic_symbol), * elf64-ppc.c (size_global_entry_stubs), * elflink.c (_bfd_elf_tls_setup), * elfxx-mips.c (mips_elf_add_la25_intro), (mips_elf_add_la25_trampoline), (_bfd_mips_elf_adjust_dynamic_symbol), * elfxx-x86.c (_bfd_x86_elf_late_size_sections): Use bfd_link_align_section to ensure correct output section alignment.
2025-02-18Automatic date update in version.inGDB Administrator1-1/+1
2025-02-18bfd_set_section_alignment errorsAlan Modra2-42/+25
I noticed when making the change from "einfo" to "fatal" that the alignment error in _bfd_elf_link_create_gnu_property_sec lacked a %P, and then decided that a bfd_set_section_alignment that can't happen does not merit a separate error message. elfxx-x86.c had copied the same code, so fix that too. In fact, every bfd_set_section_alignment call in elfxx-x86.c will always return true absent some future programming error. This patch makes those that accompany making a section lose their "failed to align " error and share the "failed to create" error. Those that are changing alignment of a section created elsewhere now abort on bfd_set_section_alignment returning false.
2025-02-18PR 32603, more ld -w misbehaviourAlan Modra32-103/+98
Commit 8d97c1a53f3d claimed to replace all einfo calls using %F with a call to fatal. It did so only for the ld/ directory. This patch adds a "fatal" to linker callbacks, and replaces those calls in bfd/ too.
2025-02-18PR32690, assertion failure in lang_size_relro_segmentAlan Modra3-7/+46
This introduces a new function which should be used whenever the linker needs to increase section alignment after mapping input to output sections. PR ld/32690 * linker.c (bfd_link_align_section): New function. * elflink.c (_bfd_elf_adjust_dynamic_copy): Use it. * bfd-in2.h: Regenerate.
2025-02-17Automatic date update in version.inGDB Administrator1-1/+1
2025-02-16Automatic date update in version.inGDB Administrator1-1/+1
2025-02-16PR32698, potential null pointer dereference in tekhex.cAlan Modra1-24/+20
PR 32698 * tekhex.c (find_chunk): Remove unnecessary casts. (insert_byte): Check and return status from find_chunk. (move_section_contents): Likewise. (tekhex_get_section_contents, tekhex_set_arch_mach): Return status from move_section_contents. (first_phase): Check and return status from first_phase.
2025-02-15Automatic date update in version.inGDB Administrator1-1/+1
2025-02-14Automatic date update in version.inGDB Administrator1-1/+1
2025-02-13Automatic date update in version.inGDB Administrator1-1/+1