]> git.ipfire.org Git - thirdparty/binutils-gdb.git/log
thirdparty/binutils-gdb.git
4 hours agolto: Compile LTO 15 test with -fno-fat-lto-objects master
H.J. Lu [Thu, 11 Dec 2025 00:33:05 +0000 (08:33 +0800)] 
lto: Compile LTO 15 test with -fno-fat-lto-objects

When -ffat-lto-objects is used to compile binutils, LTO 15 test fails on
32-bit targets the same way as -fno-lto, where the builtin function is
used to divide unsigned 64-bit integers.  Compile LTO 15 test with
-fno-fat-lto-objects so that it passes on both 32-bit and 64-bit targets.

PR ld/33709
* testsuite/ld-plugin/lto.exp (lto_link_tests): Compile lto-15a.c
and lto-15b.c with -fno-fat-lto-objects.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
5 hours agoAutomatic date update in version.in
GDB Administrator [Thu, 11 Dec 2025 00:00:08 +0000 (00:00 +0000)] 
Automatic date update in version.in

21 hours agoLoongArch32: Fix and add testcases
Lulu Cai [Thu, 6 Nov 2025 11:32:53 +0000 (19:32 +0800)] 
LoongArch32: Fix and add testcases

Fixed several test failures caused by the LoongArch32 assembler adding
labels during assembly. Additionally, skipped tests specific to LoongArch64.

Add test for new relocations.
Add test for tls type transition, got relaxation and call30 relaxation.

21 hours agoLoongArch: Add linker relaxation for got_pcadd_hi20 and got_pcadd_lo12
mengqinggang [Mon, 22 Sep 2025 03:43:41 +0000 (11:43 +0800)] 
LoongArch: Add linker relaxation for got_pcadd_hi20 and got_pcadd_lo12

.L1:
pcaddu12i $t0, %got_pcadd_hi20(a)     -> pcaddu12i $t0, %pcadd_hi20(a)
ld.w/d $t0, $t0, %got_pcadd_lo12(.L1) -> addi.w/d $t0, $t0, %pcadd_lo12(.L1)

21 hours agoLoongArch: Add support for tls type transition on LA32
mengqinggang [Sun, 21 Sep 2025 06:43:49 +0000 (14:43 +0800)] 
LoongArch: Add support for tls type transition on LA32

desc -> le
ie -> le
desc -> ie

For desc/ie -> le, need to change the symbol of le_lo12 to the symbol of
[desc|ie]_pcadd_hi20.

21 hours agoLoongArch: Add linker relaxation support for R_LARCH_CALL30
mengqinggang [Tue, 9 Sep 2025 07:39:38 +0000 (15:39 +0800)] 
LoongArch: Add linker relaxation support for R_LARCH_CALL30

Relax call30 to bl, relax tail30 to b.

21 hours agoLoongArch: LA32R macros expand
mengqinggang [Mon, 8 Sep 2025 09:01:46 +0000 (17:01 +0800)] 
LoongArch: LA32R macros expand

Define a symbol .Lpcadd_hi* at R_LARCH_*_PCADD_HI20
if the instruction expand from macro.
Change the symbol of R_LARCH_PCADD_LO12 to .Lpcadd_hi*
if the instruction expand from macro.

21 hours agoLoongArch: LA32 macros support
mengqinggang [Wed, 8 Oct 2025 05:25:06 +0000 (13:25 +0800)] 
LoongArch: LA32 macros support

Change pcalau12i to pcaddu12i for LA32 macros.
Add call/tail and call30/tail30 macros, call/tail can expand to
call36/tail36 or call30/tail30 by mabi option.

21 hours agoLoongArch: Add processing for LA32/LA32R relocations
mengqinggang [Sun, 7 Sep 2025 09:43:56 +0000 (17:43 +0800)] 
LoongArch: Add processing for LA32/LA32R relocations

R_LARCH_CALL30:
  pcaddu12i $ra, %call30(func)
  jirl     $ra, $ra, 0
Similar with R_LARCH_CALL36, pcaddu12i and jirl must be adjacent.

R_LARCH_PCADD_HI20, R_LARCH_PCADD_LO12:
.Lpcadd_hi0:
  pcaddu12i $t0, %pcadd_hi20(sym)
  addi.w    $t0, $t0, %pcadd_lo12(.Lpcadd_hi0)
Similar with RISCV PCREL_HI20, PCREL_LO12, R_LARCH_PCADD_LO12 reference to the
symbol at R_LARCH_PCADD_HI20.

21 hours agoLoongArch: Add LA32 and LA32R relocations
mengqinggang [Sun, 7 Sep 2025 07:47:56 +0000 (15:47 +0800)] 
LoongArch: Add LA32 and LA32R relocations

LA32 and LA32R do not have pcaddu18i.
LA32R does not have pcalau12i.

Add R_LARCH_CALL30 for pcaddu12i + jirl used in LA32 and LA32R.
Add R_LARCH_*_PCADD_HI20 for pcaddu12i used in LA32R.
Add R_LARCH_*_PCADD_LO12 for addi.w/ld.w used in LA32R.

21 hours agoLoongArch: Enable all instructions by default on LA32 like LA64
mengqinggang [Sun, 7 Sep 2025 07:24:55 +0000 (15:24 +0800)] 
LoongArch: Enable all instructions by default on LA32 like LA64

Glibc checks LSX/LASX support when configure.
Kernel has float instructions but with -msoft-float option.

21 hours agoLoongArch: Add R_LARCH_TLS_LE_ADD_R relocation support for add.w
mengqinggang [Mon, 5 May 2025 03:29:52 +0000 (11:29 +0800)] 
LoongArch: Add R_LARCH_TLS_LE_ADD_R relocation support for add.w

Fix compiler error for "add.w $r12,$r12,$r2,%le_add_r(a)".

21 hours agoLoongArch: Change DWARF2_CIE_DATA_ALIGNMENT to -4 for loongarch32
Jiajie Chen [Mon, 16 Dec 2024 07:27:36 +0000 (15:27 +0800)] 
LoongArch: Change DWARF2_CIE_DATA_ALIGNMENT to -4 for loongarch32

21 hours agoLoongArch: Enable loongarch_elf64_vec loongarch64_pei_vec on LA32 target
mengqinggang [Mon, 8 Sep 2025 08:43:05 +0000 (16:43 +0800)] 
LoongArch: Enable loongarch_elf64_vec loongarch64_pei_vec on LA32 target

Fix -march=loongarch64 error on LA32 target.

26 hours agoRevert "[gdb/guile] Use SCM_DEBUG_TYPING_STRICTNESS 0"
Thiago Jung Bauermann [Wed, 3 Dec 2025 23:15:13 +0000 (20:15 -0300)] 
Revert "[gdb/guile] Use SCM_DEBUG_TYPING_STRICTNESS 0"

This reverts commit 852cbc7ffadf9daf173e13ea56caff49d52733af.

It fixed the build with libguile v2.0.9, but now GDB only supports
Guile >= 2.2.

I was able to build GDB using -std=c++20 with both Guile 2.2 and
Guile 3.0 (tested with GCC 14.3) without any error or warning.

Approved-By: Tom Tromey <tom@tromey.com>
26 hours agoGDB: Guile: Remove procedures ineffectual since Guile 2.2
Thiago Jung Bauermann [Fri, 5 Dec 2025 04:05:49 +0000 (01:05 -0300)] 
GDB: Guile: Remove procedures ineffectual since Guile 2.2

The manual mentions since GDB 10 that the functions for getting and setting
the size of memory port buffers are deprecated, and don't work when using
Guile 2.2 or later.  Since now GDB only supports Guile 2.2 and newer,
perform the promised removal.

Reviewed-By: Eli Zaretskii <eliz@gnu.org>
Approved-By: Tom Tromey <tom@tromey.com>
26 hours agoGDB: Guile: Remove code meant for Guile < 2.2
Thiago Jung Bauermann [Thu, 4 Dec 2025 22:30:50 +0000 (19:30 -0300)] 
GDB: Guile: Remove code meant for Guile < 2.2

Approved-By: Tom Tromey <tom@tromey.com>
29 hours agoAutomatic date update in version.in
GDB Administrator [Wed, 10 Dec 2025 00:00:08 +0000 (00:00 +0000)] 
Automatic date update in version.in

30 hours ago[gdb] Fix whitespace in NEWS
Tom de Vries [Tue, 9 Dec 2025 23:25:20 +0000 (00:25 +0100)] 
[gdb] Fix whitespace in NEWS

Fix this:
...
$ empty=$(git hash-object -t tree /dev/null)
$ git diff-index --check $empty gdb/NEWS
gdb/NEWS:1874: space before tab in indent.
+                            [--basename | --dirname]
...
and add the file to the clean list in
gdb/contrib/check-whitespace-pre-commit.py.

[ I'm not sure if NEWS has an official style.

There are no settings for NEWS in .gitattributes, so the whitespace attribute
defaults to trailing-space (shorthand for blank-at-eol, blank-at-eof) and
space-before-tab.

We could require either spaces only (tab-in-indent) in gdb/.gitattributes:
...
NEWS whitespace=space-before-tab,tab-in-indent,trailing-space
...
or tab style (indent-with-non-tab):
...
NEWS whitespace=space-before-tab,indent-with-non-tab,trailing-space
...

For tab-in-indent, we get:
...
$ git diff-index --check $empty gdb/NEWS  | wc -l
228
...
and for indent-with-non-tab instead:
...
$ git diff-index --check $empty gdb/NEWS  | wc -l
40
...
so the more common style seems to be tab style.

But I'm leaving this as is for now. ]

30 hours ago[gdb] Fix whitespace in *.def
Tom de Vries [Tue, 9 Dec 2025 23:25:20 +0000 (00:25 +0100)] 
[gdb] Fix whitespace in *.def

Add indent-with-non-tab for *.def in gdb*/.gitattributes.

Fix whitespace in the *.def files in gdb*, and add these files to the clean
list in gdb/contrib/check-whitespace-pre-commit.py.

Tested on x86_64-linux.

Approved-By: Tom Tromey <tom@tromey.com>
30 hours ago[gdb] Fix whitespace in *.[ly]
Tom de Vries [Tue, 9 Dec 2025 23:25:19 +0000 (00:25 +0100)] 
[gdb] Fix whitespace in *.[ly]

Add indent-with-non-tab for *.[ly] in gdb/.gitattributes.

Fix whitespace in the *.[ly] files in gdb, and add these files to the clean
list in gdb/contrib/check-whitespace-pre-commit.py.

Tested on x86_64-linux.

Approved-By: Tom Tromey <tom@tromey.com>
30 hours ago[gdb] Fix whitespace in *.c
Tom de Vries [Tue, 9 Dec 2025 23:25:19 +0000 (00:25 +0100)] 
[gdb] Fix whitespace in *.c

Fix whitespace in the *.c files in gdb, and add these files to the clean list
in gdb/contrib/check-whitespace-pre-commit.py.

Tested on x86_64-linux.

Approved-By: Tom Tromey <tom@tromey.com>
30 hours ago[gdb] Fix whitespace in *.h
Tom de Vries [Tue, 9 Dec 2025 23:25:19 +0000 (00:25 +0100)] 
[gdb] Fix whitespace in *.h

Fix whitespace in the *.h files in gdb, and add these files to the clean list
in gdb/contrib/check-whitespace-pre-commit.py.

Tested on x86_64-linux.

Approved-By: Tom Tromey <tom@tromey.com>
30 hours agox86: Add _bfd_elf_x86_copy_special_section_fields
H.J. Lu [Mon, 8 Dec 2025 23:33:28 +0000 (07:33 +0800)] 
x86: Add _bfd_elf_x86_copy_special_section_fields

When Linux/x86 objcopy is used on Solaris binary, it sets EI_OSABI to
ELFOSABI_SOLARIS, but it doesn't set the sh_info and sh_link fields of
Solaris specific sections.

Add _bfd_elf_x86_copy_special_section_fields to return false for Solaris
binary to properly set the sh_info and sh_link fields of Solaris specific
sections.

PR binutils/33705
* elf32-i386.c (elf32_i386_copy_solaris_special_section_fields):
Removed.
(elf_backend_copy_special_section_fields): Likewise.
* elf64-x86-64.c (elf64_x86_64_copy_solaris_special_section_fields):
Likewise.
(elf_backend_copy_special_section_fields): Likewise.
* elfxx-x86.c (_bfd_elf_x86_copy_special_section_fields): New.
* elfxx-x86.h (_bfd_elf_x86_copy_special_section_fields): Likewise.
(elf_backend_copy_special_section_fields): Likewise.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
34 hours agoPartly rewrite dwarf2_get_symbol_read_needs
Tom Tromey [Fri, 14 Nov 2025 21:43:27 +0000 (14:43 -0700)] 
Partly rewrite dwarf2_get_symbol_read_needs

This patch partly rewries dwarf2_get_symbol_read_needs.  The goal is
to simplify it and perhaps make it a little more efficient.

With this patch, if an operation simply continues to the next
operation in the expression, then no manipulation of ops_to_visit is
needed.  This avoids excess pushes and pops.

Also, visited_ops is changed to be a std::vector<bool> rather than a
map.

Regression tested on x86-64 Fedora 41.

34 hours agoImplement local-environment commands
Tom Tromey [Wed, 11 Dec 2024 18:33:12 +0000 (11:33 -0700)] 
Implement local-environment commands

A user noted that "set environment" does not affect things like
"shell" or "pipe".  This makes some sense, because the environment is
per-inferior, and also in the general case it may be affecting a
remote machine -- i.e., the settings may not be locally appropriate.

This patch adds a new set of "local-environment" commands (set, show,
and unset) that affect gdb's own environment.

Approved-By: Andrew Burgess <aburgess@redhat.com>
Reviewed-By: Eli Zaretskii <eliz@gnu.org>
Reviewed-by: Kévin Le Gouguec <legouguec@adacore.com>
34 hours agoAllow NULL to be passed to environment-related functions
Tom Tromey [Wed, 11 Dec 2024 18:25:08 +0000 (11:25 -0700)] 
Allow NULL to be passed to environment-related functions

This changse the various environment-related helper functions to
accept a NULL environment pointer.  This special case means that the
function should affect gdb's global environment.

Approved-By: Andrew Burgess <aburgess@redhat.com>
Reviewed-by: Kévin Le Gouguec <legouguec@adacore.com>
35 hours agoSwitch environment-related functions to accept a pointer
Tom Tromey [Wed, 11 Dec 2024 18:20:47 +0000 (11:20 -0700)] 
Switch environment-related functions to accept a pointer

This changes the environment-related helper functions to accept a
pointer argument rather than a reference.

Reviewed-by: Kévin Le Gouguec <legouguec@adacore.com>
35 hours agoRefactor environment-related commands
Tom Tromey [Wed, 11 Dec 2024 18:11:41 +0000 (11:11 -0700)] 
Refactor environment-related commands

This patch refactors the various environment-related commands into
functions that accept gdb_environ parameter.

Reviewed-by: Kévin Le Gouguec <legouguec@adacore.com>
35 hours agoRewrite the "show environment" test
Tom Tromey [Tue, 9 Dec 2025 14:57:51 +0000 (07:57 -0700)] 
Rewrite the "show environment" test

In a review early in the year:

    https://inbox.sourceware.org/gdb-patches/874iz3f4ek.fsf@redhat.com/

Andrew pointed out that a new test I proposed failed with read1.
This test was essentially a copy of gdb.base/environ.exp.

I couldn't reproduce the read1 problem, but this patch rewrites the
one test there that seems like it could possibly fail in this mode.
Now it uses line-by-line mode and checks for a certain environment
variable appearing in the output.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
36 hours agogdb: remove unused includes from c-lang.{c,h}
Simon Marchi [Mon, 8 Dec 2025 20:02:41 +0000 (15:02 -0500)] 
gdb: remove unused includes from c-lang.{c,h}

These includes are reported as unused by clangd.

Change-Id: Ib5c655d9c96e7a612e223bd87d124f90112acc5a

36 hours agogdb: remove unused arch-utils.h include from solib-rocm.c
Simon Marchi [Mon, 8 Dec 2025 19:37:40 +0000 (14:37 -0500)] 
gdb: remove unused arch-utils.h include from solib-rocm.c

This include is reported as unused by clangd.

Change-Id: I4fe6048d072d445a2133ac17887fe37ccc5e2d90

37 hours agogdb: adjust guile 2.0 NEWS entry
Simon Marchi [Tue, 9 Dec 2025 16:29:29 +0000 (11:29 -0500)] 
gdb: adjust guile 2.0 NEWS entry

I forgot to update the previous patch based on a review comment before
pushing.

Change-Id: Ib357d105ba67725bfa4772f95d0b658456173be6

37 hours agogdb: more guile 2.0 support removal
Simon Marchi [Thu, 4 Dec 2025 17:25:13 +0000 (12:25 -0500)] 
gdb: more guile 2.0 support removal

Commit f14bbacae00d ("gdb/guile: remove support for Guile < 2.2")
removed some code supporting Guile 2.0.  This patch removes more bits
related to Guile 2.0, and adds a NEWS entry.

 * Remove Guile 2.0 mention from the doc.

 * Remove HAVE_GUILE_MANUAL_FINALIZATION, assume it is always true.

 * Remove guile-2.0 from the versions automatically tried by configure.

 * Remove check for scm_new_smob (HAVE_SCM_NEW_SMOB), assume it is
   always true.

 * Remove hack to fill ac_cv_guild_program_name when the .pc file
   wouldn't specify it.

Tested by rebuilding against guile-3.0 and guile-2.2.

Change-Id: I2e89bcd4a4429262f4c3a1c74b275768e60f0cb0
Reviewed-by: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
Reviewed-By: Eli Zaretskii <eliz@gnu.org>
40 hours agoBFD: Unify relocation error reporting
Maciej W. Rozycki [Tue, 9 Dec 2025 12:38:52 +0000 (12:38 +0000)] 
BFD: Unify relocation error reporting

A couple of targets use virtually the same code for error reporting in
relocation processing.  Merge the copies, removing small discrepancies
such as a fallback call to `abort' for NDS32 targets as per PR 17512,
and factor out for backends to use.

43 hours agogdb: fix build error after forward_scope_exit changes
Andrew Burgess [Tue, 9 Dec 2025 10:34:11 +0000 (10:34 +0000)] 
gdb: fix build error after forward_scope_exit changes

After commit:

  commit 43db8f70d86b2492b79f59342187b919fd58b3dd
  Date:   Thu Oct 23 16:34:20 2025 +0100

      gdbsupport: remove undefined behaviour from (forward_)scope_exit

A build failure was reported[1] when using clang++.  The failure looks
like this:

    CXX    aarch64-fbsd-tdep.o
  In file included from /tmp/src/binutils-gdb/gdb/aarch64-fbsd-tdep.c:22:
  In file included from /tmp/src/binutils-gdb/gdb/gdbarch.h:28:
  In file included from /tmp/src/binutils-gdb/gdb/infrun.h:21:
  In file included from /tmp/src/binutils-gdb/gdb/gdbthread.h:35:
  /tmp/src/binutils-gdb/gdb/../gdbsupport/forward-scope-exit.h:112:20: error: too many template arguments
  for class template 'forward_scope_exit_policy'
    112 |         = scope_exit_base<forward_scope_exit_policy<Function,
        |                           ^
    113 |                                                     function, Res, Args...>>;
        |                                                                    ~~~~~~~~
  /tmp/src/binutils-gdb/gdb/../gdbsupport/forward-scope-exit.h:82:8: note: template is declared here
     81 | template<typename Function, Function *function, typename Signature>
        | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     82 | struct forward_scope_exit_policy;
        |        ^

The problem is that the forward_scope_exit_policy class expects 3
template arguments, but in forward-scope-exit.h we say:

  template<typename Function, Function *function,
    typename Res, typename... Args>
  using forward_scope_exit
   = scope_exit_base<forward_scope_exit_policy<Function,
       function, Res, Args...>>;

Which passes 4 template arguments.  Fix this by changing the above
'using' like too:

  template<typename Function, Function *function, typename Signature>
  using forward_scope_exit
   = scope_exit_base<forward_scope_exit_policy<Function, function,
       Signature>>;

This now compiles with clang++.

43 hours agotail recursion in _bfd_elf_link_hide_symbol
Alan Modra [Tue, 9 Dec 2025 07:25:53 +0000 (17:55 +1030)] 
tail recursion in _bfd_elf_link_hide_symbol

We can clear the flags first if no backend hide_symbol function tests
or sets them, which is true.

* elflink.c (_bfd_elf_link_hide_symbol): Clear flags before
calling elf_backend_hide_symbol, to enable tail recursion.

43 hours agogold testsuite volatile fixes
Alan Modra [Tue, 9 Dec 2025 07:25:12 +0000 (17:55 +1030)] 
gold testsuite volatile fixes

Avoid these mainline gcc complaints (C23 WG14 n2743).
copy_test_relro.cc:42:5: error: ‘++’ expression of ‘volatile’-qualified type is deprecated [-Werror=volatile]
icf_test_pr21066.cc:50:55: error: ‘volatile’-qualified parameter is deprecated [-Werror=volatile]

* testsuite/copy_test_relro.cc (segv): Avoid gcc warning.
* testsuite/icf_test_pr21066.cc (capture_exception_of_type):
Likewise.

43 hours agobitwise operation between different enumeration types
Alan Modra [Tue, 9 Dec 2025 07:16:29 +0000 (17:46 +1030)] 
bitwise operation between different enumeration types

mips.cc:9478:50: error: bitwise operation between different enumeration types ‘elfcpp::<unnamed enum>’ and ‘elfcpp::<unnamed enum>’ is deprecated [-Werror=deprecated-enum-enum-conversion]
 9478 |           merged_flags &= ~(elfcpp::EF_MIPS_ARCH | elfcpp::EF_MIPS_MACH);
      |                             ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~

* mips.h: Define all the EF_MIPS values in one enum.

44 hours agoLoongArch: Add support for the ud macro instruction
Lulu Cai [Fri, 28 Nov 2025 07:54:58 +0000 (15:54 +0800)] 
LoongArch: Add support for the ud macro instruction

In the "ud ui5" macro, the value of ui5 must be in the range 0–31. It
expands to "amswap.w $rd, $r1, $rj", where ui5 specifies the register
number for $rd in the amswap.w instruction, and $rd == $rj.

The test case have been adjusted to no longer report errors for illegal
operands of the amswap.w instruction.

gas/

* config/tc-loongarch.c (check_this_insn_before_appending): No
  longer check amswap.w.
* testsuite/gas/loongarch/illegal-operand.l: Update.
* testsuite/gas/loongarch/illegal-operand.s: Update.
* testsuite/gas/loongarch/macro_ud.d: New test.
* testsuite/gas/loongarch/macro_ud.s: New test.

include/

* opcode/loongarch.h: Add new macro for amswap.w.

opcodes/

* loongarch-opc.c: Add macro for ud.

2 days agolto-wrapper warning note
Alan Modra [Tue, 9 Dec 2025 00:26:03 +0000 (10:56 +1030)] 
lto-wrapper warning note

Current gcc adds a note to the LTO "using serial compilation" warning.

* lib/binutils-common.exp (prune_warnings_extra): Remove
lto-wrapper note.

2 days agoAutomatic date update in version.in
GDB Administrator [Tue, 9 Dec 2025 00:00:08 +0000 (00:00 +0000)] 
Automatic date update in version.in

2 days agoi386: Add GLIBC_ABI_GNU_TLS dependency only if used
H.J. Lu [Mon, 8 Dec 2025 02:06:43 +0000 (10:06 +0800)] 
i386: Add GLIBC_ABI_GNU_TLS dependency only if used

Add GLIBC_ABI_GNU_TLS version dependency only if ___tls_get_addr is
referenced by regular object.

bfd/

PR ld/33287
PR ld/33702
* elfxx-x86.c (_bfd_x86_elf_link_check_relocs): Set
has_tls_get_addr_call only if referenced by regular object.

ld/

PR ld/33287
PR ld/33702
* testsuite/ld-i386/i386.exp: Run PR ld/33702 test.
* testsuite/ld-i386/no-tls.c: New file.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2 days agoRevert "Re: Add warning message to readelf for local symbols"
Alan Modra [Mon, 8 Dec 2025 21:02:57 +0000 (07:32 +1030)] 
Revert "Re: Add warning message to readelf for local symbols"

This reverts commit f70242a98f91b7f5ec5b375346d8bfa7f9a61c4a.
Nick already applied this..

2 days agoRe: Add warning message to readelf for local symbols
Alan Modra [Mon, 8 Dec 2025 09:14:35 +0000 (19:44 +1030)] 
Re: Add warning message to readelf for local symbols

Limit the warning to ET_REL.

2 days ago[gdb/contrib] Add more clean files in check-whitespace-pre-commit.py
Tom de Vries [Mon, 8 Dec 2025 20:05:04 +0000 (21:05 +0100)] 
[gdb/contrib] Add more clean files in check-whitespace-pre-commit.py

Add gdbsupport and gdbserver as whitespace-clean in
gdb/contrib/check-whitespace-pre-commit.py.

Likewise for *.ac and *.m4.

Also drop the ignore of configure, that's already taken care of in
.gitattributes.

Approved-By: Tom Tromey <tom@tromey.com>
2 days ago[gdb/testsuite] Simplify gdb.multi/remote-with-running-inferior.exp
Tom de Vries [Mon, 8 Dec 2025 15:38:29 +0000 (16:38 +0100)] 
[gdb/testsuite] Simplify gdb.multi/remote-with-running-inferior.exp

Simplify regexps in test-case gdb.multi/remote-with-running-inferior.exp using
string_to_regexp and {}.

While we're at it, also break an overly long line.

Tested on x86_64-linux.

2 days ago[gdb/testsuite] Fix two typos in gdb.multi/remote-with-running-inferior.exp
Tom de Vries [Mon, 8 Dec 2025 15:38:28 +0000 (16:38 +0100)] 
[gdb/testsuite] Fix two typos in gdb.multi/remote-with-running-inferior.exp

Fix two typos in test-case gdb.multi/remote-with-running-inferior.exp.

2 days ago[gdb/testsuite] Fix FAIL in gdb.multi/remote-with-running-inferior.exp
Tom de Vries [Mon, 8 Dec 2025 15:38:28 +0000 (16:38 +0100)] 
[gdb/testsuite] Fix FAIL in gdb.multi/remote-with-running-inferior.exp

Occasionally, with test-case gdb.multi/remote-with-running-inferior.exp I run
into:
...
(gdb) continue^M
Continuing.^M
^M
Thread 1.1 "remote-with-run" hit Breakpoint 1.1, main () at \
  remote-with-running-inferior.c:31^M
31        for (int i = 0; i < 30; ++i)^M
(gdb) PASS: $exp: target_non_stop=auto: non_stop=off: \
  continue to breakpoint: continue to breakpoint in breakpt
bt 1^M
(gdb) FAIL: $exp: target_non_stop=auto: non_stop=off: \
  check inferior 1 is in breakpt
...

The problem is a race between:
- inferior 1 reaching main, and
- gdb setting a breakpoint on main.

If the breakpoint on main is set before inferior 1 reaches main, the
breakpoint triggers for inferior 1, which the test-case doesn't expect.

Fix this by setting the breakpoint on main only for inferior 2.

Tested on x86_64-linux.

PR testsuite/33621
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33621

2 days agoreadelf: Only check for out of bounds local symbols in object files
Alan Modra [Mon, 8 Dec 2025 15:12:26 +0000 (15:12 +0000)] 
readelf: Only check for out of bounds local symbols in object files

2 days agoFix typo in aarch64-opc.c
Nick Clifton [Mon, 8 Dec 2025 15:12:02 +0000 (15:12 +0000)] 
Fix typo in aarch64-opc.c

2 days agogdbsupport: remove undefined behaviour from (forward_)scope_exit
Andrew Burgess [Thu, 23 Oct 2025 15:34:20 +0000 (16:34 +0100)] 
gdbsupport: remove undefined behaviour from (forward_)scope_exit

Our implementation of scope_exit and forward_scope_exit make use of
the Curiously Recurring Template Pattern (CRTP) to provide the
"release" functionality, this is done in the scope_exit_base class in
scope-exit.h.

The interesting (for this commit) parts of scope_exit_base look like
this:

  template <typename CRTP>
  class scope_exit_base
  {
  public:
    scope_exit_base () = default;

    ~scope_exit_base ()
    {
      if (!m_released)
        {
   auto *self = static_cast<CRTP *> (this);
   self->on_exit ();
        }
    }

    ... snip ...
  };

By the time ~scope_exit_base is called the destructor for the derived
class (called CRTP here) has already been run, which means any data
members in the derived class will have also have had their destructors
run.  As a result of this I believe that casting 'this' to the derived
type, and then calling the on_exit method is undefined behaviour, as
'this' can no longer be considered a valid instance of CRTP (the CRTP
part has been destructed).

In reality, the memory for the derived type is not reclaimed until
after ~scope_exit_base has finished, so as long as the data members of
the derived type are Plain Old Data (POD), then the current code
should be just fine; any data members of the derived class will remain
in place, and untouched, until ~scope_exit_base has completed.

But still, I don't think we should rely on undefined behaviour.

I actually ran into this when, in another series, I tried to reuse
scope_exit_base with a class where a data member was not POD, and in
this case GDB would crash because my new on_exit function was making
use of the non-POD data member after it had been destructed, and
resources released.

I propose that we move away from the CRTP, and instead flip the class
hierarchy.  Instead of derived classes like scope_exit inheriting from
scope_exit_base, scope_exit_base should inherit from scope_exit.

What this means, is that when ~scope_exit_base is called, ~scope_exit
will not yet have been run, and the data members of scope_exit will
still be valid.

To allow the existing names to be used, the plan is that the existing
scope_exit and forward_scope_exit classes are renamed to
scope_exit_policy and forward_scope_exit_policy.  These policy classes
will then be injected via a template argument as the base class for
scope_exit_base.  Finally, we can:

  template<typename EF>
  using scope_exit = scope_exit_base<scope_exit_policy<EF>>;

which defines the scope_exit type.  This type is a drop in replacement
with all of GDB's existing code, but avoids the undefined behaviour.
We can do something similar with forward_scope_exit.

There should be no user visible changes after this commit.

2 days agoreadelf: Do not warn about mapping symbols that extend beyond the end of mergeable...
Nick Clifton [Mon, 8 Dec 2025 12:17:28 +0000 (12:17 +0000)] 
readelf: Do not warn about mapping symbols that extend beyond the end of mergeable sections

2 days agoRevert "gdb/record_full: add ptid entry for history."
Guinevere Larsen [Mon, 8 Dec 2025 11:54:39 +0000 (08:54 -0300)] 
Revert "gdb/record_full: add ptid entry for history."

This reverts commit b8524f61e398072f83938fb805f377f22198f9a9.

It was pushed by mistake with an unrelated patch.

2 days agobfd: fix build with C23
Guinevere Larsen [Fri, 5 Dec 2025 18:55:38 +0000 (15:55 -0300)] 
bfd: fix build with C23

Starting in C23, strchr and strrchr will return const char *, if fed a
const char *.  This means that several files in the BFD directory will
fail to build as they are assigning the return of those functions to a
char *.

Fix this by const-ifying several variables. The only place where that
wasn't just that was in targets.c, where a variable was being used in
subsequent strrchr invocations to change the underlying string, so a new
variable had to be introduced.

No user-visible change should happen after this commit.

2 days agogdb/record_full: add ptid entry for history.
Guinevere Larsen [Thu, 30 Oct 2025 20:43:55 +0000 (17:43 -0300)] 
gdb/record_full: add ptid entry for history.

For record full to work on multi-threaded inferiors, we must know to
which thread any given recorded instruction belongs to. This commit adds
this as a new entry for each instruction when an inferior is
multi-threaded. This way, when replaying the instruction, the subsystem
is able to change inferior thread as needed, and avoid SIGILLs when
changing stuff

Ideally, we would only add the PTID entry when we actually need to
switch threads, but that is left as a future improvement.

WIP: replaying doesn't automatically change threads yet, but there was
an attempt

2 days agoPR 33676 ld segfaults when using binary input inside NOLOAD
Magnus Wållberg [Mon, 8 Dec 2025 09:33:40 +0000 (20:03 +1030)] 
PR 33676 ld segfaults when using binary input inside NOLOAD

The code at ldlang.c:2840-2841 checks if the output BFD is ELF format,
then unconditionally uses elf_section_type() on the input section
without verifying the input section is also ELF format.

This was introduced in commit d87be451e (PR ld/32787) which added
special handling for NOLOAD note sections.

PR 33676
PR 32787
* ldlang.c (lang_add_section): Check section owner's BFD
flavour before using elf_section_type.

2 days agoPR 33701, abort in byte_get_little_endian
Alan Modra [Mon, 8 Dec 2025 05:34:44 +0000 (16:04 +1030)] 
PR 33701, abort in byte_get_little_endian

PR 33701
* dwarf.c (process_debug_info): Set debug_info_p NULL when
DEBUG_INFO_UNAVAILABLE.

2 days agoPR 33698 and PR 33700
Alan Modra [Mon, 8 Dec 2025 05:30:16 +0000 (16:00 +1030)] 
PR 33698 and PR 33700

It is possible for dump_relocations to return on an error from
slurp_rela_relocs or slurp_rel_relocs without writing to
"all_relocations".  In that case an uninitialised r_symbol is passed
to free at the end of process_got_section_contents.

PR 33698
PR 33700
* readelf.c (update_all_relocations): Zero array.  Remove
unnecessary casts.

2 days agoPR 33697, fuzzer segfault
Alan Modra [Mon, 8 Dec 2025 05:28:33 +0000 (15:58 +1030)] 
PR 33697, fuzzer segfault

PR 33697
* readelf.c (process_relocs): Don't segfault on no sections.

2 days agoGAS: Change S parameter of find_no_app to CHAR* in order to avoid problems with STRST...
Nick Clifton [Mon, 8 Dec 2025 09:11:23 +0000 (09:11 +0000)] 
GAS: Change S parameter of find_no_app to CHAR* in order to avoid problems with STRSTR returning a CONST CHAR*

PR 33696

2 days ago[gdb/build] Add gdb subdirs in gdb.pot
Tom de Vries [Mon, 8 Dec 2025 08:30:25 +0000 (09:30 +0100)] 
[gdb/build] Add gdb subdirs in gdb.pot

I found that gettext strings from gdb/cli are not added to gdb.pot.

Fix this by explicitly listing the gdb subdirs in the po/$(PACKAGE).pot rule
in gdb/Makefile.in.

Tested by doing:
...
$ cd build/gdb
$ make po/gdb.pot
  ...
$ grep -c cli/ po/gdb.pot
345
...

2 days ago[gdb/build] Re-add *.[ch] in gdb.pot
Tom de Vries [Mon, 8 Dec 2025 08:30:25 +0000 (09:30 +0100)] 
[gdb/build] Re-add *.[ch] in gdb.pot

In commit 4a40fe05bf0 ("[gdb/build] Handle gdbsupport and gdbserver in
gdb.pot"), in order to handle '*.cc' files I did:
...
-   -name '*.[hc]' -print
+   -name '*.[hc]' -o -name '*.cc' -print
...
but failed to understand that this no longer printed the '*.[hc]' names.

Fix this by adding a '-print' for '*.[hc]'.

Tested by doing:
...
$ cd build/gdb
$ make po/gdb.pot
 ...
$ grep -c symtab.c po/gdb.pot
102
...

2 days agoelf: Add SHT_SUNW_ctf and SHT_SUNW_symnsort
H.J. Lu [Sat, 6 Dec 2025 02:17:39 +0000 (10:17 +0800)] 
elf: Add SHT_SUNW_ctf and SHT_SUNW_symnsort

On Solaris 11.4, there is SHT_SUNW_symnsort and no SHT_SUNW_symtabnsort.
SHT_SUNW_symnsort is defined to 0x6fffffec, which is the same as
SHT_SUNW_symtabnsort.  There is also SHT_SUNW_ctf.  Add SHT_SUNW_ctf and
rename SHT_SUNW_symtabnsort to SHT_SUNW_symnsort.  Move SHT_SUNW_phname
after SHT_SUNW_symnsort.

binutils/

* readelf.c (get_solaris_section_type): Add SHT_SUNW_ctf and
SHT_SUNW_symnsort.  Move SHT_SUNW_phname after SHT_SUNW_symnsort.
Remove SHT_SUNW_symtabnsort.

include/

* elf/common.h (SHT_SUNW_ctf): New.
(SHT_SUNW_symtabnsort): Renamed to ...
(SHT_SUNW_symnsort): This.
(SHT_SUNW_phname): Moved after SHT_SUNW_symnsort.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
3 days agoAutomatic date update in version.in
GDB Administrator [Mon, 8 Dec 2025 00:00:08 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 days agoUnconditionally pass is_a_field_of_this in c-exp.y
Tom Tromey [Fri, 5 Dec 2025 18:43:08 +0000 (11:43 -0700)] 
Unconditionally pass is_a_field_of_this in c-exp.y

In a review to a different patch of mine, Simon asked for this change.
The idea here is that there's no need to pass null as the "field of
this" parameter, as lookup_language_this checks the language anyway.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
3 days ago[gdb/contrib] Check clean files in check-whitespace-pre-commit.sh
Tom de Vries [Sun, 7 Dec 2025 09:59:54 +0000 (10:59 +0100)] 
[gdb/contrib] Check clean files in check-whitespace-pre-commit.sh

The pre-commit check check-whitespace checks diffs.

Consequently, we detect something like this:
...
$ echo >> gdb/testsuite/lib/gdb.exp
$ git commit -a -m trailing-empty-line
  ...
check-whitespace.........................................................Failed
- hook id: check-whitespace
- duration: 0.01s
- exit code: 2

gdb/testsuite/lib/gdb.exp:11717: new blank line at EOF.
...

But say we work around the failing check using --no-verify, then we no longer
detect it after the commit has succeeded:
...
$ git commit -a -m trailing-empty-line --no-verify
[detached HEAD e6302105522] trailing-empty-line
 1 file changed, 1 insertion(+)
$ pre-commit run --all-files check-whitespace
check-whitespace.........................................................Passed
- hook id: check-whitespace
- duration: 0.3s
...

Fix this in check-whitespace-pre-commit.sh by distinguishing between clean and
other files.  Doing so is easier to do in a more advanced scripting language,
so rewrite into python.

Since a recent commit, gdb/testsuite is clean, so I'm using that as
simple classifier for now.

For the other files we do what we did before, and check just the staging area:
...
$ git --no-pager diff --staged --check "${other[@]}"
...

But for clean files, we check the entire file, including staged changes:
...
$ empty=$(git hash-object -t tree /dev/null)
$ git diff-index --cached --check $empty "${clean[@]}"
...

Consequently, we do see:
...
$ git commit -a -m trailing-empty-line --no-verify
[detached HEAD e6302105522] trailing-empty-line
 1 file changed, 1 insertion(+)
$ pre-commit run --all-files check-whitespace
check-whitespace.........................................................Failed
- hook id: check-whitespace
- duration: 0.64s
- exit code: 2

gdb/testsuite/lib/gdb.exp:11717: new blank line at EOF.
...

PR build/33616
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33616

4 days agoAutomatic date update in version.in
GDB Administrator [Sun, 7 Dec 2025 00:00:07 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 days agohppa64: Set has_local_dynsyms when adding __text_seg/__data_seg
H.J. Lu [Mon, 1 Dec 2025 03:06:23 +0000 (11:06 +0800)] 
hppa64: Set has_local_dynsyms when adding __text_seg/__data_seg

commit 54fbc12d6404b645363f901110a21f4410067df5
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Nov 28 16:07:57 2025 +0800

    elf: Renumber local dynamic symbols only if needed

caused regressions for hppa64-linux which adds local dynamic symbols,
__text_seg and __data_seg in elf64_hppa_late_size_sections.  Set
has_local_dynsyms to true when adding __text_seg and __data_seg.

* elf64-hppa.c (elf64_hppa_late_size_sections): Set
has_local_dynsyms to true when adding __text_seg and __data_seg.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
5 days agoAutomatic date update in version.in
GDB Administrator [Sat, 6 Dec 2025 00:00:08 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 days agosim: make local variable 'const'
Andrew Burgess [Fri, 5 Dec 2025 14:15:11 +0000 (14:15 +0000)] 
sim: make local variable 'const'

This build error was reported to me off list:

  common/callback.c:993:13: error: initializing 'char *' with an expression of type 'const char *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
    993 |       char *q = strchr (m, ',');
        |             ^   ~~~~~~~~~~~~~~~

This is because with C23, strchr returns 'const char *' if a 'const
char *' is passed as an argument.

In this case M is 'const char *', so Q should also be 'const char *'.
And indeed, we don't write via Q at any time, so lets make it 'const'.

There should be no user visible changes after this commit.

5 days agogdb: display a symbol more often in multi-file list output
Andrew Burgess [Mon, 17 Nov 2025 14:08:57 +0000 (14:08 +0000)] 
gdb: display a symbol more often in multi-file list output

I noticed that when a command line 'list foo.c:10' displays multiple
files, the symbol would always be shown as "???", e.g.:

  file: "/tmp/foo.c", line number: 10, symbol: "???"

this is because, when the symtab_and_line is created for the
'foo.c:10', the pc and symbol are never filled in.

In this commit, I propose that, when we decide that the above header
line needs to be printed, we should attempt to lookup a symbol for the
relevant line, and if one is found, we can use that.

The symbol lookup is done by first calling find_pc_for_line, and then
using find_symbol_for_pc to find a suitable symbol.

Approved-By: Tom Tromey <tom@tromey.com>
5 days ago[gdb/testsuite] Use gdb_load in gdb.rocm/break-kernel-no-debug-info.exp
Lancelot SIX [Mon, 1 Dec 2025 14:29:52 +0000 (14:29 +0000)] 
[gdb/testsuite] Use gdb_load in gdb.rocm/break-kernel-no-debug-info.exp

The gdb.rocm/break-kernel-no-debug-info.exp builds a testcase without
debug info, and loads the binary in GDB with:

    gdb_test "file $::binfile" ".*No debugging symbols.*" "load file"

On some configurations (SLES with glibc-devel installed), the compiler
links /usr/lib64/crit1.o (which contains some debug information) into
the final binary.  As a result, the binary contains "some" debug
information, which makes the above pattern fail.  The testcase is still
valid as we only really need the GPU code object (embedded in the main
binary) to not contain debug information, so this patch proposes to
relax this first step by using "gdb_load" instead.

Tested on x86_64-linux + AMDGPU gfx1031.

Change-Id: Id903f62e170af69c001b39f4681602a54e2fdaf1
Approved-By: Tom Tromey <tom@tromey.com>
5 days agogdb: fix 'list' for multiple source file results
Andrew Burgess [Mon, 17 Nov 2025 11:43:36 +0000 (11:43 +0000)] 
gdb: fix 'list' for multiple source file results

This commit:

  commit c7a45b98a61451f05ff654c4fb72a9c9cb2fba36
  Date:   Thu Jun 12 15:37:50 2025 +0000

      gdb, linespec: avoid multiple locations with same PC

broke GDB's ability to list multiple source files using a 'list'
command.  In GDB 16 and earlier something like 'list foo.c:10' could
print multiple results if there were multiple 'foo.c' files compiled
into the executable.

The above commit added a filter to add_sal_to_sals (linespec.c) such
that multiple sals in the same program space, but with the same pc
value, could not be added, only the first sal would actually be
recorded.  The problem with this is that add_sal_to_sals is used from
decode_digits_list_mode (also linespec.c) where the pc value is forced
to zero.  This force to zero makes sense I think as there might not be
any compiled code for the requested line (this is for 'list' after
all), so there might not be a valid pc to use.

I'm not a fan of using '0' as a special pc value, there are embedded
targets where 0 is a valid pc value, but given we're already using 0
here, I propose to just roll with it.

So, my proposal is that, if the pc is 0, add_sal_to_sals should always
add the sal.  This fixes the decode_digits_list_mode, but should keep
the fix that c7a45b98a614 introduced.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33647

Approved-By: Tom Tromey <tom@tromey.com>
Reviewed-By: Kevin Buettner <kevinb@redhat.com>
5 days agox86-64: use BFD_RELOC_32_PLT_PCREL in favor of custom type
Jan Beulich [Fri, 5 Dec 2025 09:19:03 +0000 (10:19 +0100)] 
x86-64: use BFD_RELOC_32_PLT_PCREL in favor of custom type

No reason to have a separate type when the generic one has no (other)
meaning for this target.

5 days agox86-64: use BFD_RELOC_64_PLTOFF in favor of custom type
Jan Beulich [Fri, 5 Dec 2025 09:18:34 +0000 (10:18 +0100)] 
x86-64: use BFD_RELOC_64_PLTOFF in favor of custom type

No reason to have a separate type when the generic one has no (other)
meaning for this target.

5 days agobfd: drop BFD_RELOC_VPE4KMATH_*
Jan Beulich [Fri, 5 Dec 2025 09:17:51 +0000 (10:17 +0100)] 
bfd: drop BFD_RELOC_VPE4KMATH_*

These relocation types are entirely unused.

5 days agobfd: drop BFD_RELOC_I370_D12
Jan Beulich [Fri, 5 Dec 2025 09:17:19 +0000 (10:17 +0100)] 
bfd: drop BFD_RELOC_I370_D12

i370 support is long gone from binutils, and this relocation is entirely
unused.

5 days agoAdd AMD znver6 processor support
Umesh Kalvakuntla [Fri, 5 Dec 2025 09:12:51 +0000 (10:12 +0100)] 
Add AMD znver6 processor support

In --help option, adds znver6 to the list of CPUs under -march.

Please find the ISA descriptions for AVX512_BMM instructions below.

AVX512 Bit Manipulation Instructions
====================================
The AVX512BMM instructions include Bit Matrix Multiply and Bit Reversal
operations.

CPUID
-----
Support is indicated by the new CPUID 8000_0021, EAX bit 23, labeled AVX512_BMM.

Encoding
--------
VBMACOR16x16x16
EVEX.256.NP.MAP6.W0 80 /r VBMACOR16x16x16  ymm1, ymm2, ymm3/m256
EVEX.512.NP.MAP6.W0 80 /r VBMACOR16x16x16  zmm1, zmm2, zmm3/m512

VBMACXOR16x16x16
EVEX.256.NP.MAP6.W1 80 /r VBMACXOR16x16x16  ymm1, ymm2, ymm3/m256
EVEX.512.NP.MAP6.W1 80 /r VBMACXOR16x16x16  zmm1, zmm2, zmm3/m512

DESCRIPTION
-----------
256 BIT VERSIONS
----------------
16x16 non-transposed fused BMM-accumulate (BMAC) with OR/XOR reduction.
A ymm register holds a 16x16 bit matrix. The third source matrix for
accumulation is in ymm1.

512 BIT VERSIONS
----------------
2 parallel 16x16 non-transposed fused BMM-accumulate (BMAC) with OR/XOR
reduction.
Each 256-bit chunk of a zmm register holds a 16x16 bit matrix. The third source
matrices for accumulation are in zmm1.

VBITREVB
--------
EVEX.128.NP.MAP6.W0 81 /r VBITREVB  xmm1{k1}{z}, xmm2/m128
EVEX.256.NP.MAP6.W0 81 /r VBITREVB  ymm1{k1}{z}, ymm2/m256
EVEX.512.NP.MAP6.W0 81 /r VBITREVB  zmm1{k1}{z}, zmm2/m512

DESCRIPTION
-----------
Bit reversal within a byte boundary. Only applied to input bytes where the
corresponding mask bit is set; otherwise, bytes are left untouched or zeroed out
if zero masking is indicated.

gas/ChangeLog:

* NEWS: Add znver6 ARCH.
* config/tc-i386.c: Add znver6 ARCH, avx512_bmm SUBARCH.
* doc/c-i386.texi: Likewise.
* testsuite/gas/i386/i386.exp: Add znver6 test cases.
* testsuite/gas/i386/x86-64.exp: Add znver6 test cases.
* testsuite/gas/i386/arch-16-znver6.d: New test.
* testsuite/gas/i386/arch-16.d: New test.
* testsuite/gas/i386/arch-16.s: New test.
* testsuite/gas/i386/avx512_bmm.d: New test.
* testsuite/gas/i386/avx512_bmm.s: New test.
* testsuite/gas/i386/avx512_bmm_vl-inval.l: New test.
* testsuite/gas/i386/avx512_bmm_vl-inval.s: New test.
* testsuite/gas/i386/avx512_bmm_vl.d: New test.
* testsuite/gas/i386/avx512_bmm_vl.s: New test.
* testsuite/gas/i386/x86-64-arch-6-znver6.d: New test.
* testsuite/gas/i386/x86-64-arch-6.d: New test.
* testsuite/gas/i386/x86-64-arch-6.s: New test.
* testsuite/gas/i386/x86-64-avx512_bmm-bad.d: New test.
* testsuite/gas/i386/x86-64-avx512_bmm-bad.s: New test.
* testsuite/gas/i386/x86-64-avx512_bmm.d: New test.
* testsuite/gas/i386/x86-64-avx512_bmm.s: New test.
* testsuite/gas/i386/x86-64-avx512_bmm_vl-inval.l: New test.
* testsuite/gas/i386/x86-64-avx512_bmm_vl-inval.s: New test.
* testsuite/gas/i386/x86-64-avx512_bmm_vl.d: New test.
* testsuite/gas/i386/x86-64-avx512_bmm_vl.s: New test.

opcodes/ChangeLog:

* i386-dis-evex-len.h: Likewise.
* i386-dis-evex-w.h: Likewise.
* i386-dis-evex.h: Likewise.
* i386-dis.c: Add EVEX_W_MAP6_80, EVEX_W_MAP6_81,
  EVEX_LEN_MAP6_80_W_0, EVEX_LEN_MAP6_80_W_1.
* i386-gen.c: Likewise.
* i386-init.h: Re-generated.
* i386-mnem.h: Re-generated.
* i386-opc.h (enum i386_cpu): Add CpuAVX512_BMM.
(i386_cpu_flags): Add cpuvavx512_bmm.
* i386-opc.tbl: Add vbmacor16x16x16, vbmacxor16x16x16, vbitrevb.
* i386-tbl.h: Re-generated.

5 days agox86: sub-divide APX_F - NCI-NDD-NF and testing
Jan Beulich [Fri, 5 Dec 2025 09:12:34 +0000 (10:12 +0100)] 
x86: sub-divide APX_F - NCI-NDD-NF and testing

To reflect spec version 007's introduction of the three-way APX-NCI-NDD-NF
also introduce a respective ISA specifier, without that actually having a
counterpart in opcodes.

Add a testcase to cover all four new ISA specifiers.

5 days agox86: sub-divide APX_F - NF
Jan Beulich [Fri, 5 Dec 2025 09:12:12 +0000 (10:12 +0100)] 
x86: sub-divide APX_F - NF

While spec version 007 introduced the three-way APX-NCI-NDD-NF, let's
split the three aspects (NCI, NDD, and NF) in gas. For NF we only need to
guard the {nf} pseudo-prefix.

5 days agox86: sub-divide APX_F - NDD
Jan Beulich [Fri, 5 Dec 2025 09:12:00 +0000 (10:12 +0100)] 
x86: sub-divide APX_F - NDD

While spec version 007 introduced the three-way APX-NCI-NDD-NF, let's
split the three aspects (NCI, NDD, and NF) in gas. Note that NDD also
applies to a number of EVEX-encoded insns with EVEX.ndd clear.

Some extra logic is needed in cpu_flags_match() to avoid the need to
add APX_NDD to CPU_FLAGS_COMMON.

5 days agox86: sub-divide APX_F - NCI
Jan Beulich [Fri, 5 Dec 2025 09:11:27 +0000 (10:11 +0100)] 
x86: sub-divide APX_F - NCI

While spec version 007 introduced the three-way APX-NCI-NDD-NF, let's
split the three aspects (NCI, NDD, and NF) in gas.

While adjusting CMOVcc and CFCMOVcc, drop the bogus CpuCMOV dependencies.
Such a requirement was never specified in any public doc revision.

Note also that the EVEX-encoded forms of TEST were lacking CpuAPX_F so
far.

5 days agox86: correct {RD,WR}{FS,GS}BASE {dis,}assembly
Jan Beulich [Fri, 5 Dec 2025 08:10:28 +0000 (09:10 +0100)] 
x86: correct {RD,WR}{FS,GS}BASE {dis,}assembly

First they are valid only in 64-bit mode. And then an operand size prefix
has no meaning here, hence v_mode is wrong to use; switch to dq_mode.

5 days ago[gdb/testsuite] Fix gdb.base/long_long.exp on arm
Tom de Vries [Fri, 5 Dec 2025 07:24:06 +0000 (08:24 +0100)] 
[gdb/testsuite] Fix gdb.base/long_long.exp on arm

On armv7hl-suse-linux-gnu, I run into:
...
(gdb) p/f val.oct
$26 = -5.9822653797615723e-120
(gdb) FAIL: gdb.base/long_long.exp: p/f val.oct
...

There's some complicated logic here in the test-case:
...
if { $sizeof_double == 8 || $sizeof_long_double == 8 } {
    # ARM FPA floating point numbers are not strictly little endian or big
    # endian, but a hybrid.  They are in little endian format with the two
    # words swapped in big endian format.
    # EABI targets default to natural-endian VFP format.

    if { ([istarget "arm*-*-*"]) \
 && !([istarget "*-*-*eabi*"] || \
      [istarget "*-*-mingw32ce*"] || \
      [istarget "*-*-openbsd*"]) } then {
# assume the long long represents a floating point double in ARM format
gdb_test "p/f val.oct" "2.1386676354387559e\\+265"
    } else {
# assume the long long represents a floating point double in little
# endian format
gdb_test "p/f val.oct" "-5.9822653797615723e-120"
    }
} else {
    gdb_test "p/f val.oct" "-2.42716126e-15"
}
...
which makes the test-case expect the ARM FPA variant.

I think trying to pin down the exact circumstances under which we have ARM FPA
is unnecessary, so I could live with:
...
    set re_val_oct_f [string_to_regexp "-5.9822653797615723e-120"]
    if { [istarget "arm*-*-*"] } {
        set re_val_oct_f_arm_fpa [string_to_regexp "2.1386676354387559e+265"]
re_val_oct_f "$re_val_oct_f|$re_val_oct_f_arm_fpa"
    }
....

But instead, I propose to just drop the arm-specific part.

I doubt whether an ARM VPA setup is still part of any test matrix.  And if it
is, then I expect other tests to fail as well for the same reason.  The ARM
FPA logic is used only once in the test-case, but -5.9822653797615723e-120 is
used more frequently.

Indeed, I wonder the same about setups where -2.42716126e-15 is expected.
On such a setup, won't this fail as well:
...
gdb_test "x/2gf g" "3.5127005640885037e-303.*-5.9822653797615723e-120"
...
?

Unfortunately I'm not sure what setup to use to trigger the -2.42716126e-15
case.

Fix this as good as possible by choosing once between -5.9822653797615723e-120
and -2.42716126e-15, assigning it to re_val_oct_f, and using it everywhere
where those constants are used.

Tested on x86_64-linux.

Reviewed-by: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
PR testsuite/33669
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33669

6 days agoAutomatic date update in version.in
GDB Administrator [Fri, 5 Dec 2025 00:00:07 +0000 (00:00 +0000)] 
Automatic date update in version.in

6 days agogdb: small white space fix in print_gdb_hints
Andrew Burgess [Thu, 4 Dec 2025 15:21:08 +0000 (15:21 +0000)] 
gdb: small white space fix in print_gdb_hints

A small white space fix in print_gdb_hints.  There should be no user
visible changes after this commit.

Reviewed-By: Guinevere Larsen <guinevere@redhat.com>
6 days agogdb: remove some unnecessary code from print_gdb_hints
Andrew Burgess [Thu, 4 Dec 2025 15:18:02 +0000 (15:18 +0000)] 
gdb: remove some unnecessary code from print_gdb_hints

I noticed some code in print_gdb_hints that is unused.  I rolled a
patch, but while I was doing that commit:

  commit 06e470d8fc0ae0e83fe0977fdf8c011998980891
  Date:   Sat Nov 29 15:48:55 2025 +0100

      gdb: handle unlimited screen width case in print_gdb_hints

was merged that deleted some of the code I'd spotted.  All that's left
is a 'return' that can be removed, there's nothing after the 'if'
block, the function just returns.

There should be no user visible changes after this commit.

Reviewed-By: Guinevere Larsen <guinevere@redhat.com>
6 days agoFix 'ptype' of a certain Ada modular type
Tom Tromey [Thu, 4 Dec 2025 14:36:59 +0000 (07:36 -0700)] 
Fix 'ptype' of a certain Ada modular type

If an Ada modular type is the same size as gdb's own ULONGEST, ptype
will show "mod 0".  This happens because ada_modulus does:

    return (ULONGEST) high.const_val () + 1;

This patch cleans this up, replacing ada_modulus with a function to
return the upper bound (if available), and then fixing the various
callers.  The type-printing caller still does the "+1", but now this
is done with a gdb_mpz.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33690
Approved-By: Simon Marchi <simon.marchi@efficios.com>
6 days agogdb: remove find_target_at
Simon Marchi [Tue, 2 Dec 2025 21:09:26 +0000 (16:09 -0500)] 
gdb: remove find_target_at

... to make the current_inferior reference bubble up one level.  Since
find_target_at would become a trivial wrapper around
inferior::target_at, remove it.  I think it's clearer anyway to see
explicitly that the "subject" of the method call is the inferior.

Change-Id: I73ec44d37e7afea6e85b1689af65e32ae8e5a695
Approved-By: Tom Tromey <tom@tromey.com>
6 days agoaarch64: Enable `-M notes' by default
Alice Carlotti [Tue, 4 Nov 2025 12:22:52 +0000 (12:22 +0000)] 
aarch64: Enable `-M notes' by default

We already print other instruction comments, such as condition code
aliases, by default.  The `-M no-notes' option has been available in
Binutils for over 7 years, so if anyone does need the notes to be
disabled then they can do so explicitly.

6 days agoaarch64: Refactor sysreg operand printing
Alice Carlotti [Wed, 5 Nov 2025 12:06:14 +0000 (12:06 +0000)] 
aarch64: Refactor sysreg operand printing

This hopefully makes the logic clearer.  It also adds NULL checks before
recording notes, and explicitly compares the inexactness of inexact
matches (although this extra comparison isn't used for any existing
encodings).

6 days agoaarch64: Fix incorrect sysreg notes operand notes
Alice Carlotti [Tue, 4 Nov 2025 12:28:56 +0000 (12:28 +0000)] 
aarch64: Fix incorrect sysreg notes operand notes

When support for Armv8-R was added in 2020, aarch64_print_operand was
modified to check architecture features when searching for a system
register name.  However, this mismatch is then conflated with
read-only/write-only mismatches, leading to incorrect note emission when
reading a read-only or writing a write-only system register that is not
available in whichever of Armv8-A or Armv8-R we are using.

The original code also segfaults when parsing `msr mpuir_el1, w1'.  This
segfault arises while suggesting alternative assembler input with
corrected qualifiers, due to a missing NULL check when attempting to
emit notes.  The segfault is unreachable after this change, but a
subsequent patch will incorporate NULL checking anyway.

Once notes are enabled by default, an existing `mrs x0, mpuir_el1' test
will verify that the incorrect notes are no longer generated.

6 days agoaarch64: Improve comment for aarch64_opnd_info.sysreg.flags
Alice Carlotti [Wed, 5 Nov 2025 13:21:02 +0000 (13:21 +0000)] 
aarch64: Improve comment for aarch64_opnd_info.sysreg.flags

This field is used differently during assembly and disassembly.  It
would be nice if we could make this more consistent, but for now just
extend the comment to explain what is going on.

6 days agoReturn bool from ada_is_modular_type
Tom Tromey [Thu, 4 Dec 2025 14:15:52 +0000 (07:15 -0700)] 
Return bool from ada_is_modular_type

This changes ada_is_modular_type to return bool.

6 days agogdb: handle unlimited screen width case in print_gdb_hints
Patrick Monnerat [Sat, 29 Nov 2025 14:48:55 +0000 (15:48 +0100)] 
gdb: handle unlimited screen width case in print_gdb_hints

This avoids a crash when this function is called while screen width is
unlimited. In such a case (unconditionally occurring in insight), WIDTH
is returned as a negative signed integer, so it has to be compared to
another signed integer, not a size_t.

Also remove an unused WIDTH-sized variable that may fail in the above
case.

6 days agoAdd warning message to readelf for local symbols that reference beyond the end of...
Nick Clifton [Thu, 4 Dec 2025 11:29:47 +0000 (11:29 +0000)] 
Add warning message to readelf for local symbols that reference beyond the end of a mergeable section.

6 days ago[gdb/testsuite] Fix build-id check in gdb.python/py-missing-objfile.exp
Tom de Vries [Thu, 4 Dec 2025 09:29:52 +0000 (10:29 +0100)] 
[gdb/testsuite] Fix build-id check in gdb.python/py-missing-objfile.exp

I recently added two requires in test-case gdb.python/py-missing-objfile.exp:
...
# The following tests assume that the build-ids of binfile and libfile can be
# found in the core file.
require {expect_build_id_in_core_file $binfile}
require {expect_build_id_in_core_file $libfile}
...

However, at the point where the check is done, the files are no longer
available at that location, which makes the require fail.

First, make the problem visible, by making proc expect_build_id_in_core_file
throw an error if the filename argument specifies a non-existing file.

Then, fix test-case gdb.python/py-missing-objfile.exp by moving the calls to
expect_build_id_in_core_file to a point where the files exist.

Tested on x86_64-linux.

7 days agocopy_object: Re-indent
H.J. Lu [Thu, 4 Dec 2025 00:45:32 +0000 (08:45 +0800)] 
copy_object: Re-indent

* objcopy.c (copy_object): Re-indent.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
7 days agoAutomatic date update in version.in
GDB Administrator [Thu, 4 Dec 2025 00:00:07 +0000 (00:00 +0000)] 
Automatic date update in version.in