aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2024-12-03gas: Re-enable .org test 1 on all targets except kvxJens Remus1-1/+1
It got erroneously disabled for all targets including kvx instead of excluding kvx only. gas/testsuite/ * gas/all/org-1.d: Re-enable on all targets except kvx. Fixes: 6e712424f5cb ("kvx: New port.") Signed-off-by: Jens Remus <jremus@linux.ibm.com>
2024-12-03s390: Enable .bss/.struct data allocation directives testsJens Remus2-2/+2
This reduces the number of unsupported tests on s390 by two. gas/testsuite/ * gas/elf/bss.d: Enable for s390*-*-*. * gas/elf/bad-bss.d: Likewise. Signed-off-by: Jens Remus <jremus@linux.ibm.com>
2024-12-03PowerPC: Add support for RFC02680 - PQC Acceleration InstructionsSurya Kumari Jangala3-0/+30
opcodes/ * ppc-opc.c (powerpc_opcodes): Add xvadduwm, xvadduhm, xvsubuwm, xvsubuhm, xvmuluwm, xvmuluhm, xvmulhsw, xvmulhsh, xvmulhuw, xvmulhuh. gas/ * testsuite/gas/ppc/future.s: New test. * testsuite/gas/ppc/future.d: Likewise.
2024-12-03Updated Russian translation and new Malay translation for the BFD sub-directoryNick Clifton1-0/+9711
2024-12-03LoongArch: Fix the infinite loop caused by calling undefweak symbolLulu Cai4-0/+109
The undefweak symbol value of non-default visibility is 0 and does not use plt entry, and will not be relocated in the relocate_secion function. As a result, an infinite loop is generated because bl %plt(sym) => bl 0. Fix this by converting the call into a jump address 0.
2024-12-03gdb: fix comment for gdbarch_stack_grows_downAndrew Burgess1-1/+1
The comment for gdbarch_stack_grows_down was wrong. Fixed in this commit. There should be no user visible changes after this commit.
2024-12-03gas: partly restore how current_location() had workedJan Beulich6-14/+27
Commit 4a826962e760 changed its behavior without saying why, and without putting in place any testcase demonstrating the required behavior. Firmly latch the current position unless deferred-evaluation mode is in effect.
2024-12-03MMIX: use current_location() directlyJan Beulich2-16/+3
It's no longer a static function, so it can be used without involving a wrapper function plus an indirect function call.
2024-12-03gas: streamline expr_build_dot()Jan Beulich1-11/+18
There's no point involving symbol_clone_if_forward_ref(), just for it to replace dot_symbol by one obtained from symbol_temp_new_now(). For the abs-section case also produce a slightly more "complete" (as in: all potentially relevant fields filled) expression by going through expr_build_uconstant(). Move the function next to current_location(), for it to be easier to see the (dis)similarities. Correct the function's comment while there.
2024-12-03Support Intel AVX10.2 BF16 instructionsKong Lingling20-2042/+4965
In this patch, we will support AVX10.2 BF16 instructions. All of them are new instructions forms. In current documentation, it is still VSCALEFPBF16, but it will change to VSCALEFNEPBF16 eventually. In disassembler part, we added %XB to reduce W table pass since all of them get evex.w=0. gas/Changelog: * testsuite/gas/i386/i386.exp: Add AVX10.2 tests. * testsuite/gas/i386/x86-64.exp: Ditto. * testsuite/gas/i386/avx10_2-256-bf16-intel.d: New. * testsuite/gas/i386/avx10_2-256-bf16.d: Ditto. * testsuite/gas/i386/avx10_2-256-bf16.s: Ditto. * testsuite/gas/i386/avx10_2-512-bf16-intel.d: Ditto. * testsuite/gas/i386/avx10_2-512-bf16.d: Ditto. * testsuite/gas/i386/avx10_2-512-bf16.s: Ditto. * testsuite/gas/i386/x86-64-avx10_2-256-bf16-intel.d: Ditto. * testsuite/gas/i386/x86-64-avx10_2-256-bf16.d: Ditto. * testsuite/gas/i386/x86-64-avx10_2-256-bf16.s: Ditto. * testsuite/gas/i386/x86-64-avx10_2-512-bf16-intel.d: Ditto. * testsuite/gas/i386/x86-64-avx10_2-512-bf16.d: Ditto. * testsuite/gas/i386/x86-64-avx10_2-512-bf16.s: Ditto. opcodes/ * i386-dis-evex-prefix.h: Update PREFIX_EVEX_0F3A08, PREFIX_EVEX_0F3A26, PREFIX_EVEX_0F3A56, PREFIX_EVEX_0F3A66, PREFIX_EVEX_0F3AC2, PREFIX_EVEX_MAP5_2F, PREFIX_EVEX_MAP5_51, PREFIX_EVEX_MAP5_58, PREFIX_EVEX_MAP5_59, PREFIX_EVEX_MAP5_5C, PREFIX_EVEX_MAP5_5D, PREFIX_EVEX_MAP5_5E, PREFIX_EVEX_MAP5_5F. Add PREFIX_EVEX_MAP6_2C, PREFIX_EVEX_MAP6_4C, PREFIX_EVEX_MAP6_4E, PREFIX_EVEX_MAP6_98, PREFIX_EVEX_MAP6_9A, PREFIX_EVEX_MAP6_9C, PREFIX_EVEX_MAP6_9E, PREFIX_EVEX_MAP6_A8, PREFIX_EVEX_MAP6_AA, PREFIX_EVEX_MAP6_AC, PREFIX_EVEX_MAP6_AE, PREFIX_EVEX_MAP6_B8, PREFIX_EVEX_MAP6_BA, PREFIX_EVEX_MAP6_BC, PREFIX_EVEX_MAP6_BE. * i386-dis-evex.h (evex_table): Update PREFIX_EVEX_MAP6_2C, PREFIX_EVEX_MAP6_42, PREFIX_EVEX_MAP6_4C, PREFIX_EVEX_MAP6_4E, PREFIX_EVEX_MAP6_98, PREFIX_EVEX_MAP6_9A, PREFIX_EVEX_MAP6_9C, PREFIX_EVEX_MAP6_9E, PREFIX_EVEX_MAP6_A8, PREFIX_EVEX_MAP6_AA, PREFIX_EVEX_MAP6_AC, PREFIX_EVEX_MAP6_AE, PREFIX_EVEX_MAP6_B8, PREFIX_EVEX_MAP6_BA, PREFIX_EVEX_MAP6_BC, PREFIX_EVEX_MAP6_BE. * i386-dis.c (PREFIX_EVEX_MAP6_2C): New enum. (PREFIX_EVEX_MAP6_42): Ditto. (PREFIX_EVEX_MAP6_4C): Ditto. (PREFIX_EVEX_MAP6_4E): Ditto. (PREFIX_EVEX_MAP6_98): Ditto. (PREFIX_EVEX_MAP6_9A): Ditto. (PREFIX_EVEX_MAP6_9C): Ditto. (PREFIX_EVEX_MAP6_9E): Ditto. (PREFIX_EVEX_MAP6_A8): Ditto. (PREFIX_EVEX_MAP6_AA): Ditto. (PREFIX_EVEX_MAP6_AC): Ditto. (PREFIX_EVEX_MAP6_AE): Ditto. (PREFIX_EVEX_MAP6_B8): Ditto. (PREFIX_EVEX_MAP6_BA): Ditto. (PREFIX_EVEX_MAP6_BC): Ditto. (PREFIX_EVEX_MAP6_BE): Ditto. (putop): Handle %XB. * i386-opc.tbl: Add AVX10.2 instructions. * i386-mnem.h: Regenerated. * i386-tbl.h: Ditto. Co-authored-by: Haochen Jiang <haochen.jiang@intel.com>
2024-12-03Automatic date update in version.inGDB Administrator1-1/+1
2024-12-02gdb/configure.ac: remove elf_hp.h checkSimon Marchi3-7/+0
The comment says this is for HP/UX, which is no longer supported. There should be no functional changes with this, since nothing checks HAVE_ELF_HP_H. Change-Id: Ie897fc64638c9fea28463e1bf69e450c3673fd84
2024-12-02gdb, gdbserver, gdbsupport: flatten and sort some list in configure filesSimon Marchi6-59/+298
This makes the lists easier sort read and modify. There are no changes in the generated config.h files, so I'm confident this brings no functional changes. Change-Id: Ib6b7fc532bcd662af7dbb230070fb1f4fc75f86b
2024-12-02aarch64: add tests for combinations of GCS options and marked/unmarked inputsMatthieu Longo25-0/+268
2024-12-02aarch64: add tests to check the correct merge of the GCS feature with others.Matthieu Longo10-5/+80
2024-12-02aarch64: GCS feature check in GNU note properties for input objectsSrinath Parvathaneni7-14/+224
This patch adds support for Guarded Control Stack in AArch64 linker. This patch implements the following: 1) Defines GNU_PROPERTY_AARCH64_FEATURE_1_GCS bit for GCS in GNU_PROPERTY_AARCH64_FEATURE_1_AND macro. 2) Adds readelf support to read and print the GCS feature in GNU properties in AArch64. Displaying notes found in: .note.gnu.property [ ]+Owner[ ]+Data size[ ]+Description GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0 Properties: AArch64 feature: GCS 3) Adds support for the "-z gcs" linker option and document all the values allowed with this option (-z gcs[=always|never|implicit]) where "-z gcs" is equivalent to "-z gcs=always". When '-z gcs' option is omitted from the command line, it defaults to "implicit" and relies on the GCS feature marking in GNU properties. 4) Adds support for the "-z gcs-report" linker option and document all the values allowed with this option (-z gcs-report[=none|warning|error]) where "-z gcs-report" is equivalent to "-z gcs-report=warning". When this option is omitted from the command line, it defaults to "warning". The ABI changes adding GNU_PROPERTY_AARCH64_FEATURE_1_GCS to the GNU property GNU_PROPERTY_AARCH64_FEATURE_1_AND is merged into main and can be found in [1]. [1] https://github.com/ARM-software/abi-aa/blob/main/sysvabi64/sysvabi64.rst Co-authored-by: Matthieu Longo <matthieu.longo@arm.com> Co-authored-by: Yury Khrustalev <yury.khrustalev@arm.com>
2024-12-02aarch64: rename BTI error/warning messageMatthieu Longo13-20/+20
The previous message for missing BTI feature in GNU properties was not very clear. The new message explains that a missing GNU property marking is lacking on this specific input.
2024-12-02aarch64: delete duplicated BTI testsMatthieu Longo6-117/+0
2024-12-02aarch64: improve test coverage for combination of BTI optionsMatthieu Longo19-5/+281
2024-12-02aarch64: limit number of reported issues on missing GNU propertiesMatthieu Longo3-0/+35
This patch attempts to make the linker output more friendly for the developers by limiting the number of emitted warning/error messages related to BTI issues. Every time an error/warning related to BTI is emitted, the logger also increments the BTI issues counter. A batch of errors/warnings is limited to a maximum of 20 explicit errors/warnings. At the end of the merge, a summary of the total of errors/warning is given if the number exceeds the limit of 20 invidual messages.
2024-12-02aarch64: bugfix when finding 1st bfd input with GNU propertyMatthieu Longo1-1/+6
The current implementation of searching the first input BFD with GNU properties has a bug. The search was not filtering on object inputs belonging to the output link unit only, but was also including dynamic objects, BFD plugins, and linker-created files. This means that the initial initialization of the output properties were skewed, and warnings on input files that should have been emitted were not. This patch fixes the filtering to exclude the object input files not belonging to the output link unit, not having the same ELF class, and not the same target architecture.
2024-12-02aarch64: remove early exit when setting up GNU properties with partial linkingMatthieu Longo1-3/+0
There is an early exit in _bfd_aarch64_elf_link_setup_gnu_properties that is enabled when the output link unit is relocatable, i.e. ld generates an output file that can in turn serve as input to ld. (see ld manual, -r,--relocatable for more details). At this stage, the GNU properties have already been merged and errors or warnings (if any) have already been issued. However, OUTPROP has not been updated yet. Not updating OUTPROP means that implicits enablement of BTI PLTs via the GNU properties will be ignored for final links. Indeed, the enablement of BTI PLTs is checked inside _bfd_aarch64_add_call_stub_entries by looking up at gnu_property_aarch64_feature_1_and (OUTPROP). Since the final link does not happen in the case of partial linking, the behaviour with or without the early exit should be the same. Given that there is currently no comment for explain why the exit is there, and that there might in the future be cases were these properties affect relocatable links, it is preferrable to drop the early exit.
2024-12-02aarch64: refactoring _bfd_aarch64_elf_link_setup_gnu_properties (part 5)Matthieu Longo1-18/+24
Use _bfd_aarch64_elf_check_bti_report to report any BTI issue on the first input object.
2024-12-02aarch64: refactoring _bfd_aarch64_elf_link_setup_gnu_properties (part 4)Matthieu Longo1-22/+27
Move the code related to the creation of the gnu.note section to a separate function: _bfd_aarch64_elf_create_gnu_property_section
2024-12-02aarch64: refactoring _bfd_aarch64_elf_link_setup_gnu_properties (part 3)Matthieu Longo1-16/+34
Move the code related to the search of the first bfd input with GNU properties to a separate function: _bfd_aarch64_elf_find_1st_bfd_input_with_gnu_property
2024-12-02aarch64: refactoring _bfd_aarch64_elf_link_setup_gnu_properties (part 2)Matthieu Longo1-9/+10
Simplify this for-loop with too many "break" instructions inside.
2024-12-02aarch64: refactoring _bfd_aarch64_elf_check_bti_reportMatthieu Longo3-11/+12
Before this patch, warnings were reported normally, and errors (introduced by a previous patch adding '-z bti-report' option) were logged as error but were not provoking a link failure. The root of the issue was a misuse of _bfd_error_handler to report the errors. Replacing _bfd_error_handler by info->callbacks->einfo, with the addition of the formatter '%X' for errors fixed the issue.
2024-12-02aarch64: refactoring _bfd_aarch64_elf_link_setup_gnu_properties (part 1)Matthieu Longo3-33/+41
Exposing the output GNU property as a parameter of _bfd_aarch64_elf_link_setup_gnu_properties seems to break the encapsulation. The output GNU property update should be part of the function that sets up the GNU properties. This patch removes the parameter, and perform the update of the GNU property on the output object inside the function.
2024-12-02aarch64: rename gnu_and_prop to gnu_property_aarch64_feature_1_andMatthieu Longo2-19/+19
2024-12-02aarch64: simplify condition in elfNN_aarch64_merge_gnu_propertiesMatthieu Longo1-4/+2
The current condition used to check if a GNU feature property is set on an input object before the merge is a bit confusing. (aprop && !<something about aprop>) || !aprop It seems easier to understand if it is changed as follows: (!aprop || !<something about aprop>)
2024-12-02aarch64: rename parameter of _bfd_aarch64_elf_merge_gnu_propertiesMatthieu Longo1-9/+9
The current naming of the AArch64 feature GNU property of the output bfd does not reflect what it is. This patch renames it from "prop" to "outprop".
2024-12-02aarch64: update ld documentation with bti and pac optionsMatthieu Longo1-0/+28
2024-12-02aarch64: use only one type for feature marking reportMatthieu Longo4-23/+29
2024-12-02aarch64: group software protection options under a same struct.Matthieu Longo4-83/+138
- declare a new struc aarch_protection_opts to store all the configuration options related to software protections (i.e. bti-plt, pac-plt, bti-report level). - add a new option "-z bti-report" to configure the log level of reported issues when BTI PLT is forced. - encapsulate the BTI report inside _bfd_aarch64_elf_check_bti_report.
2024-12-02aarch64: adapt BTI tests to use selectable GNU propertiesMatthieu Longo10-125/+35
2024-12-02aarch64: adapt bti-far* tests to use selectable GNU propertiesMatthieu Longo10-118/+77
2024-12-02aarch64: adapt tests for PAC PLT to use selectable GNU propertiesMatthieu Longo3-4/+43
2024-12-02aarch64: delete old tests for PAC & BTI PLTMatthieu Longo2-70/+0
2024-12-02aarch64: new tests for BTI & PAC PLT to use selectable GNU propertiesMatthieu Longo7-0/+224
2024-12-02aarch64: adapt bti-plt-so to use selectable GNU propertiesMatthieu Longo2-16/+3
2024-12-02aarch64: delete old tests covering the merge of feature markingsMatthieu Longo3-35/+0
2024-12-02aarch64: new tests covering the merge of feature markingsMatthieu Longo13-1/+290
2024-12-02aarch64: move tests for AArch64 protections (BTI, PAC) into a subfolderMatthieu Longo38-64/+122
- moved all the BTI and PAC tests into a new subfolder: "protections". bti-far-* bti-plt-* bti-pac-plt-* - move several procedures used only for AArch64 linker tests to a new exp library file aarch64-elf-lib.exp in ld/testsuite/ld-aarch64/lib. - use aarch64-elf-lib.exp in aarch64-ld.exp and aarch64-protections.exp.
2024-12-02gdb: handle DW_AT_entry_pc pointing at an empty sub-rangeAndrew Burgess4-1/+356
The test gdb.cp/step-and-next-inline.exp creates a test binary called step-and-next-inline-no-header. This test includes a function `tree_check` which is inlined 3 times. When testing with some older versions of gcc (I've tried 8.4.0, 9.3.1) we see the following DWARF representing one of the inline instances of tree_check: <2><8d9>: Abbrev Number: 38 (DW_TAG_inlined_subroutine) <8da> DW_AT_abstract_origin: <0x9ee> <8de> DW_AT_entry_pc : 0x401165 <8e6> DW_AT_GNU_entry_view: 0 <8e7> DW_AT_ranges : 0x30 <8eb> DW_AT_call_file : 1 <8ec> DW_AT_call_line : 52 <8ed> DW_AT_call_column : 10 <8ee> DW_AT_sibling : <0x92d> ... <1><9ee>: Abbrev Number: 46 (DW_TAG_subprogram) <9ef> DW_AT_external : 1 <9ef> DW_AT_name : (indirect string, offset: 0xe8): tree_check <9f3> DW_AT_decl_file : 1 <9f4> DW_AT_decl_line : 38 <9f5> DW_AT_decl_column : 1 <9f6> DW_AT_linkage_name: (indirect string, offset: 0x2f2): _Z10tree_checkP4treei <9fa> DW_AT_type : <0x9e8> <9fe> DW_AT_inline : 3 (declared as inline and inlined) <9ff> DW_AT_sibling : <0xa22> ... Contents of the .debug_ranges section: Offset Begin End ... 00000030 0000000000401165 0000000000401165 (start == end) 00000030 0000000000401169 0000000000401173 00000030 0000000000401040 0000000000401045 00000030 <End of list> ... Notice that one of the sub-ranges of tree-check is empty, this is the line marked 'start == end'. As the end address is the first address after the range, this range cover absolutely no code. But notice too that the DW_AT_entry_pc for the inline instance points at this empty range. Further, notice that despite the ordering of the sub-ranges, the empty range is actually in the middle of the region defined by the lowest address to the highest address. The ordering is not a problem, the DWARF spec doesn't require that ranges be in any particular order. However, this empty range is causing issues with GDB newly acquire DW_AT_entry_pc support. GDB already rejects, and has done for a long time, empty sub-ranges, after all, the DWARF spec is clear that such a range covers no code. The recent DW_AT_entry_pc patch also had GDB reject an entry-pc which was outside of the low/high bounds of a block. But in this case, the entry-pc value is within the bounds of a block, it's just not within any useful sub-range. As a consequence, GDB is storing the entry-pc value, and making use of it, but when GDB stops, and tries to work out which block the inferior is in, it fails to spot that the inferior is within tree_check, and instead reports the function into which tree_check was inlined. I've tested with newer versions of gcc (12.2.0 and 14.2.0) and with these versions gcc is still generating the empty sub-range, but now this empty sub-range is no longer the entry point. Here's the corresponding ranges table from gcc 14.2.0: Contents of the .debug_rnglists section: Table at Offset: 0: Length: 0x56 DWARF version: 5 Address size: 8 Segment size: 0 Offset entries: 0 Offset Begin End ... 00000021 0000000000401165 000000000040116f 0000002b 0000000000401040 (base address) 00000034 0000000000401040 0000000000401040 (start == end) 00000037 0000000000401041 0000000000401046 0000003a <End of list> ... The DW_AT_entry_pc is 0x401165, but this is not the empty sub-range, as a result, when GDB stops at the entry-pc, GDB will correctly spot that the inferior is in the tree_check function. The fix I propose here is, instead of rejecting entry-pc values that are outside the block's low/high range, instead reject entry-pc values that are not inside any of the block's sub-ranges. Now, GDB will ignore the prescribed entry-pc, and will instead select a suitable default entry-pc based on either the block's low-pc value, or the first address of the first range. I have extended the gdb.cp/step-and-next-inline.exp test to check this case, but this does depend on the compiler version being used (newer compilers will always pass, even without the fix). So I have also added a DWARF assembler test to cover this case. Reviewed-By: Kevin Buettner <kevinb@redhat.com>
2024-12-02x86: default to not accepting MPX insnsJan Beulich30-32/+38
Gcc9 had MPX support removed. While we don't want to remove support, require these deprecated insns (and registers) to be enabled explicitly.
2024-12-02x86: always set ISA_1_BASELINE property for 64-bit objectsJan Beulich22-23/+24
The baseline was, afaik, specifically chosen to align with the baseline ISA of x86-64. It therefore makes no sense to emit that property only conditionally; if anything it confuses tools analyzing the difference between generated object files, which may result from just added / changed / removed (entirely ISA-independent) code, without any change to the enabled extensions. Compilers, after all, are free to use these baseline "extensions" when generating 64-bit code. While changing the one testcase that needs adjustment, also correct its misleading name (to be in sync with the filename).
2024-12-02x86/COFF: support section-index relocations in insn operandsJan Beulich6-2/+63
On the grounds of the principle put down near the bottom of [1], along with image and section relative operations, let's also support as insn operands what .secidx is for on the data side (of course like elsewhere the reloc operator can then also be used for data generation, albeit a small tweak to x86_cons() is needed for this to work). [1] https://sourceware.org/pipermail/binutils/2024-November/137617.html
2024-12-02x86/COFF: support RVA (image-relative) relocations in insn operandsJan Beulich7-2/+154
As was pointed out in [1] compilers produce code using such constructs, and hence we'd better support this. In analogy to the .rva directive permit @rva to be used for this, and in analogy with other architectures (plus to not diverge from e.g. Clang's integrated assembler, albeit I haven't been able myself to confirm it knows this form) also permit @imgrel. While there also adjust the operand type specifier for the adjacent @secrel32 - 64-bit fields cannot be used with a 32-bit relocation. Further while there also deal with *-*-pe* in x86-64.exp, even if (right now) perhaps only for completeness. [1] https://sourceware.org/pipermail/binutils/2024-November/137548.html
2024-12-02testsuite, threads: add missing return statementsRohr, Stephan2-0/+5
Add missing return statements in * gdb.threads/process-exit-status-is-leader-exit-status.c * gdb.threads/next-fork-exec-other-thread.c to fix 'no return statement' compiler warnings, e.g.: process-exit-status-is-leader-exit-status.c: In function ‘start’: process-exit-status-is-leader-exit-status.c:46:1: warning: no return statement in function returning non-void [-Wreturn-type] 46 | } | ^ Approved-By: Simon Marchi <simon.marchi@efficios.com>
2024-12-02RISC-V: Add support for ssdbltrp and smdbltrp extension.Dongyan Chen5-2/+13
This implements the ssdbltrp extensons, version 1.0[1] and the smdbltrp extensions, version1.0[2]. [1] https://github.com/riscv/riscv-isa-manual/blob/main/src/ssdbltrp.adoc [2] https://github.com/riscv/riscv-isa-manual/blob/main/src/smdbltrp.adoc bfd/ChangeLog: * elfxx-riscv.c: Add 'ssdbltrp' and 'smdbltrp' to the list of konwn standard extensions. gas/ChangeLog: * NEWS: Updated. * testsuite/gas/riscv/imply.d: Ditto. * testsuite/gas/riscv/imply.s: Ditto. * testsuite/gas/riscv/march-help.l: Ditto.