]> git.ipfire.org Git - thirdparty/binutils-gdb.git/log
thirdparty/binutils-gdb.git
8 hours agooss-fuzz: vms-alpha segfault in image_write_section master
Alan Modra [Sat, 13 Jun 2026 00:57:22 +0000 (10:27 +0930)] 
oss-fuzz: vms-alpha segfault in image_write_section

Yet another case where a fuzzed object file triggers a crash in the
vms-alpha support.

* vms-alpha.c (image_write_section): Don't segfault on NULL
image_section.

8 hours agocheck bfd_alloc/bfd_malloc return in elflink.c
Alan Modra [Fri, 12 Jun 2026 13:53:48 +0000 (23:23 +0930)] 
check bfd_alloc/bfd_malloc return in elflink.c

Add checks in a couple of places for a non-NULL return.  While we're
at it, don't use sprintf to concatenate two strings.

* elflink.c (bfd_elf_link_record_dynamic_symbol): Check than
bfd_malloc returns non-NULL.
(get_dynamic_reloc_section_name): Similarly check bfd_alloc.
Replace sprintf with two memcpys.  Remove old_name NULL check.

21 hours agoAdd tests for Ada "in" operator
Tom Tromey [Fri, 29 May 2026 19:48:37 +0000 (13:48 -0600)] 
Add tests for Ada "in" operator

Coverage testing showed that there were no existing tests of the Ada
"in" operator.  This patch adds tests for this.

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

23 hours agoAdjust gdb.python/py-events.exp for Cygwin/MinGW, "info proc" => "inferior"
Pedro Alves [Wed, 20 May 2026 10:22:56 +0000 (11:22 +0100)] 
Adjust gdb.python/py-events.exp for Cygwin/MinGW, "info proc" => "inferior"

The testcase is using "info proc" to extract the inferior's process
ID.  But "info proc" does not exist on all targets, including Windows.
Switch to using the get_inferior_pid routine from lib/gdb.exp, which
uses "inferior" instead.

With this fixed, the testcase passes cleanly on Cygwin.  I haven't
tested on MinGW (I'm not set up for Python testing there currently),
but at least (since the previous patches) the test should be able to
compile & run there now.

Also tested on x86_64-unknown-linux-gnu.

Change-Id: If6ff482ceb011d9afe5ed40ef7e4e2f2cad8cae8

23 hours agoAdjust gdb.python/py-events.exp for Cygwin/MinGW, no fork
Pedro Alves [Wed, 20 May 2026 10:22:56 +0000 (11:22 +0100)] 
Adjust gdb.python/py-events.exp for Cygwin/MinGW, no fork

The gdb.python/py-events.exp testcase currently uses fork, and relies
on "set detach-on-fork off".

Cygwin does support the fork syscall, but GDB can't follow forks
there, so "detach-on-fork off" has no effect.  And also, there is no
fork on native Windows, which makes the testcase unusable on MinGW
currently.

I don't see any reason the testcase needs to use fork or multiple
inferiors.  We can replace what those parts were testing by more
focused tests:

 - The clear_objfiles event was tested via following a fork.  Instead,
   test a more directed "file" command.

 - Two-inferior quit was being used to test that gdb.ExitedEvent has
   no "exit_code".  Quitting while an inferior is being debugged makes
   GDB kill the inferior.  What's really being tested is the kill
   path, so write an explicit (single-inferior) kill test.

Tested on x86_64-unknown-linux-gnu.

Change-Id: I21ee8af7b52653c6fdff9b4c1596cdde3cfe751a

23 hours agoAdjust gdb.python/py-events.exp for Cygwin/MinGW, thread IDs
Pedro Alves [Wed, 20 May 2026 10:22:56 +0000 (11:22 +0100)] 
Adjust gdb.python/py-events.exp for Cygwin/MinGW, thread IDs

This commit fixes a couple issues in gdb.python/py-events.exp for
Cygwin and MinGW:

1) - GDB prints Windows thread IDs in hex:

 (gdb) thread
 [Current thread is 1 (Thread 9528.0xa9c)]

The current code assumes decimal, so we only (incorrectly) extract the
"0" after the dot.

2) - Thread and process ID number spaces are different.

The current code assumes that the extracted thread ID is the same
number as the extracted process ID, which is not true on Windows.

Also tested on x86_64-unknown-linux-gnu.

Change-Id: Iebcc07c3ad0845b548334c0d5177b3ab9e9350cf

23 hours agoWindows gdb+gdbserver: Decode Cygwin ExitProcess codes
Pedro Alves [Wed, 20 May 2026 10:45:57 +0000 (11:45 +0100)] 
Windows gdb+gdbserver: Decode Cygwin ExitProcess codes

On native Cygwin, GDB misreports the inferior's exit reason in several
common cases, resulting in several gdb.base/exitsignal.exp failures:

 $ grep FAIL gdb.sum
 FAIL: gdb.base/exitsignal.exp: how=run: signal: program terminated with SIGSEGV (the program exited)
 FAIL: gdb.base/exitsignal.exp: how=run: signal: $_exitsignal is 11 (SIGSEGV) after SIGSEGV.
 FAIL: gdb.base/exitsignal.exp: how=run: signal: $_exitcode is still void after SIGSEGV
 FAIL: gdb.base/exitsignal.exp: how=run: signal: $_exitsignal is 11 (SIGSEGV) after restarting the inferior
 FAIL: gdb.base/exitsignal.exp: how=run: signal: $_exitcode is still void after restarting the inferior
 FAIL: gdb.base/exitsignal.exp: how=run: normal: continue to exit
 FAIL: gdb.base/exitsignal.exp: how=run: normal: $_exitcode is one after normal inferior is executed
 FAIL: gdb.base/exitsignal.exp: how=run: normal: $_exitsignal is still void after normal inferior is executed
 FAIL: gdb.base/exitsignal.exp: how=attach: normal: continue to exit (the program exited)
 FAIL: gdb.base/exitsignal.exp: how=attach: normal: $_exitcode is one after normal inferior is executed

For example, from gdb.log, the normal exit case:

 ...
 [Thread 14300.0x4214 (id 1) exited with code 1]
 [Thread 14300.0x1b1c (id 4) exited with code 1]
 [Thread 14300.0x1e2c (id 2) exited with code 1]

 Program terminated with signal SIGHUP, Hangup.
 The program no longer exists.
 (gdb) FAIL: gdb.base/exitsignal.exp: how=run: normal: continue to exit

The program in fact exited normally with code 1.  SIGHUP happens to be
signal 1, and GDB picked the wrong interpretation.

Similarly, for the signal termination case:

 ...
 continue
 Continuing.
 [Thread 4600.0x3104 (id 4) exited with code 2816]
 [Thread 4600.0x2bcc (id 3) exited with code 2816]
 [Thread 4600.0x2f44 (id 1) exited with code 2816]
 [Inferior 1 (process 4600) exited with code 05400]
 (gdb) FAIL: gdb.base/exitsignal.exp: how=run: signal: program terminated with SIGSEGV (the program exited)

Here the inferior died with SIGSEGV, but GDB reported exit decimal
2816 / octal 05400 / hex 0x0B00, which is SIGSEGV swapped into the
high byte of a waitpid exit status.

The problem is that Cygwin waitpid exit status and Windows exit codes
do not have the same encoding, and GDB & GDBserver do not know about
this.

This commit fixes it.  It adds a Cygwin-specific branch to the code
that determines the terminating signal and status of a program.  The
branch for native Windows/MinGW GDB is left intact, no behavior change
there.

The way to decode the exit codes is a little bit tricky, see detailed
comments added by the patch.  To exercise the "raw NTSTATUS error
code" path in windows_process_info::exit_process_to_target_status,
gdb.base/exitsignal.exp is extended to debug a native Windows program
that crashes with a segfault (STATUS_ACCESS_VIOLATION).

With this, gdb.base/exitsignal.exp passes cleanly on Cygwin.

Reviewed-By: Eli Zaretskii <eliz@gnu.org>
Change-Id: Icaebcc234b71927915c996fd120884604441415b

23 hours agoWindows gdb+gdbserver: Share exit status logic
Pedro Alves [Wed, 20 May 2026 10:45:57 +0000 (11:45 +0100)] 
Windows gdb+gdbserver: Share exit status logic

Move the exit status logic added by commit 559e7e5056 ("Improve
process exit status macros on MinGW") from both GDB and GDBserver to a
shared routine used by both.

The next patch extends this routine with Cygwin-specific decoding.

Change-Id: I4bf08c6beff0d1688064a81d49bbdd615643735e

23 hours agogdb/testsuite: Add mechanism to compile Windows native programs on Cygwin
Pedro Alves [Sat, 23 May 2026 02:08:31 +0000 (03:08 +0100)] 
gdb/testsuite: Add mechanism to compile Windows native programs on Cygwin

This adds a new "win32" option to gdb_compile that lets us compile
native Windows programs when testing Cygwin.  Will be used in a
following patch.

The testsuite tries to find the compiler to use automatically.  You
can also explicitly set it with WIN32_CC_FOR_TARGET.

Change-Id: I86e954494cf7f88164cdf1c9127be46d5437986f

23 hours agogdb.base/exitsignal.exp: Test attaching too
Pedro Alves [Sat, 23 May 2026 01:01:12 +0000 (02:01 +0100)] 
gdb.base/exitsignal.exp: Test attaching too

On some targets, like Cygwin (see the following commit), extracting
the exit code works differently depending on whether the inferior was
run by GDB, or GDB attached to an existing process.  Extend
gdb.base/exitsignal.exp to test both scenarios.

Note: We add a wait_for_gdb sleep loop to segv.c and normal.c so the
attach path can synchronize with GDB before the inferior runs.  For
simplicity, the run path pokes the same variable from setup, so
behavior there is unchanged.

The testcase passes cleanly on Linux, native and gdbserver, and on
MinGW too.  Cygwin still requires more fixes.

Change-Id: I9908aef0cea3eaec8134f05e347702baf753d10c

23 hours agogdb.base/exitsignal.exp: Exit with non-zero
Pedro Alves [Sat, 23 May 2026 01:01:12 +0000 (02:01 +0100)] 
gdb.base/exitsignal.exp: Exit with non-zero

gdb.base/exitsignal.exp currently tests exiting with exit code 0.
But, testing for 0 is typically more "dangerous" in the sense that
it's easy for some bug in GDB or the target backend to fail to extract
the exit code and return 0.  Make it test exit code 1 instead.

gdb.base/coredump-filter-build-id.exp currently reuses normal.c.  It
could still use it with this patch, but it seems better to me to
remove the coupling.  Simply add a new .c file for that testcase,
which still returns 0.

Change-Id: I49ccfdbbe4be4445172476e7dd4e06142c8a672e

23 hours agoAdjust gdb.base/exitsignal.exp for MinGW, separate program names
Pedro Alves [Sat, 23 May 2026 01:01:12 +0000 (02:01 +0100)] 
Adjust gdb.base/exitsignal.exp for MinGW, separate program names

Currently, gdb.base/exitsignal.exp on MinGW skips half the tests, like
so:

 # of expected passes            13
 # of untested testcases         1

... because the testcase actually compiles two programs, but the
second program is compiled using the same executable name as the
first, at a time when gdb still has the first executable open,
resulting in:

 .../x86_64-w64-mingw32/bin/ld.exe: cannot open output file C:/.../gdb.base/exitsignal/exitsignal.exe: Permission denied

The use of standard_testfile in the middle of a testcase is a bit
surprising.  Fix this by moving the second compilation to the top, and
give each executable its own name.

Move the bulk of test code to two procedures, one for testing exiting
with signal, another for testing normal exit.

With this, gdb.base/exitsignal.exp passes cleanly on
x86_64-w64-mingw32.

Change-Id: I9a1af298b0e4f62f38b5c4b14787d7e40a2b5e2c

23 hours agoAdjust gdb.base/exitsignal.exp for MinGW, second-chance SIGSEGV
Pedro Alves [Sat, 23 May 2026 02:08:31 +0000 (03:08 +0100)] 
Adjust gdb.base/exitsignal.exp for MinGW, second-chance SIGSEGV

On native Windows a segmentation fault is delivered as a SEH
exception, so GDB stops twice: once for the first-chance exception,
and -- if no SEH handler in the inferior catches it -- again for the
second-chance exception, after which the process dies.  The testcase
currently continues only once, resulting in:

 ...
 continue
 Continuing.

 Thread 1 received signal SIGSEGV, Segmentation fault.
 0x00007ff765ac1469 in main (argc=1, argv=0x9f2640) at C:/rocgdb/src.cascais-rsync/gdb/testsuite/gdb.base/segv.c:24
 24        *(volatile int *) 0;
 (gdb) PASS: gdb.base/exitsignal.exp: trigger SIGSEGV
 continue
 Continuing.

 Thread 1 received signal SIGSEGV, Segmentation fault.
 0x00007ff765ac1469 in main (argc=1, argv=0x9f2640) at C:/rocgdb/src.cascais-rsync/gdb/testsuite/gdb.base/segv.c:24
 24        *(volatile int *) 0;
 (gdb) FAIL: gdb.base/exitsignal.exp: program terminated with SIGSEGV
 ...

Add a second continue on MinGW to step past the second-chance stop.

With this, gdb.base/exitsignal.exp passes cleanly on MinGW:

 -FAIL: gdb.base/exitsignal.exp: program terminated with SIGSEGV
 +PASS: gdb.base/exitsignal.exp: trigger SIGSEGV, second-chance
 +PASS: gdb.base/exitsignal.exp: program terminated with SIGSEGV

Change-Id: Ibda1540a602b62c26a5b218d930402eccc3ba98f

23 hours agoAdjust gdb.base/exitsignal.exp for MinGW, trigger fault
Pedro Alves [Sat, 23 May 2026 02:08:31 +0000 (03:08 +0100)] 
Adjust gdb.base/exitsignal.exp for MinGW, trigger fault

gdb.base/segv.c uses raise(SIGSEGV) to generate a SIGSEGV.  On native
Windows that does not generate an EXCEPTION_ACCESS_VIOLATION; raise is
a pure userspace construct: it dispatches to the registered SIGSEGV
handler if there is one, otherwise calls abort.  GDB therefore never
sees an exception to intercept.  E.g.:

 ...
 continue
 Continuing.
 [Thread 1908.0x3308 (id 2) exited with code 3]
 [Inferior 1 (process 1908) exited with code 03]
 (gdb) FAIL: gdb.base/exitsignal.exp: trigger SIGSEGV (the program exited)
 continue
 The program is not being run.
 ...

Replace the raise with a real null dereference so the kernel actually
raises an access violation.

Note: I confirmed no other tests use segv.c.  segv.c and normal.c are
both "owned" by gdb.base/exitsignal.exp.

Change-Id: Ib54d9e6998cf9bfc18dcb5e76d31a9deb0458da4

23 hours agogdb/amd-dbgapi-target: Update xfer_partial to always use dbgapi
Lancelot SIX [Tue, 16 Apr 2024 08:26:36 +0000 (09:26 +0100)] 
gdb/amd-dbgapi-target: Update xfer_partial to always use dbgapi

On the Windows platform, the entire "global" address space is not
mapped in the inferior memory.  For such configuration, part of the
global address space lives in GPU memory, and can only be accessed via
rocm-dbgapi.

This patch updates amd_dbgapi_target::xfer_partial so it always calls
into amd-dbgapi to access the global address space.  GDB will still be
called to access host memory using xfer_global_memory callback.

To be sure that the callback request is not routed back to dbgapi, the
xfer_global_memory callback is modified to route the request to
whichever target sits below the amd-dbgapi target on the target stack.

Co-Authored-By: Pedro Alves <pedro@palves.net>
Change-Id: I2d5ca46edf65e2dec3606d18f7ad1d22d0275a63

23 hours agogdb/amd-dbgapi-target: Add amd-dbgapi-mingw-hdep.c for Windows
Lancelot SIX [Wed, 8 May 2024 10:36:28 +0000 (11:36 +0100)] 
gdb/amd-dbgapi-target: Add amd-dbgapi-mingw-hdep.c for Windows

This patch adds amd-dbgapi-mingw-hdep.c which provides the
implementations for all the host specific interactions with dbgapi on
MinGW.

Co-Authored-By: Pedro Alves <pedro@palves.net>
Change-Id: Ie244f2606b1e0af8f85b9113c3d93585eda893ed

23 hours agogdb/amd-dbgapi-target: Move Linux code to amd-dbagapi-posix-hdep.c
Lancelot SIX [Wed, 8 May 2024 10:15:22 +0000 (11:15 +0100)] 
gdb/amd-dbgapi-target: Move Linux code to amd-dbagapi-posix-hdep.c

The current amd-dbgapi-target.c file contains some code that is Linux
specific.  This patch extracts such code to host dependent files, so
they can be replaced for other host platforms.

The code in question is related to the event loop.  The way dbgapi
notifies GDB that there is a pending event is platform specific.  For
Linux (the only platform supported so far), this is done using a file
descriptor GDB can use in its main event loop.

This patch introduces an overall host-dependency infrastructure and
moves the Linux-specific code to amd-dbgapi-posix-hdep.c.  The "posix"
naming is because even though only Linux is supported, the code is
really plain POSIX code that would work on other POSIX platforms.
This also follows the existing posix-hdep.c nomenclature.

Co-Authored-By: Pedro Alves <pedro@palves.net>
Change-Id: Id3d4b947176e5cfe91b0ab64376fca1a6a8c6fc9

26 hours ago[gdb/build, clang] Fix ignored aligned attribute
Tom de Vries [Fri, 12 Jun 2026 10:41:08 +0000 (12:41 +0200)] 
[gdb/build, clang] Fix ignored aligned attribute

PR build/34279 reports a build failure with clang.

This is a regression since commit 6c85ef111b0 ("[gdb] Use using instead of
typedef"), which did:
...
-typedef long __attribute__ ((__aligned__ (4))) compat_x32_clock_t;
+using compat_x32_clock_t = long __attribute__ ((__aligned__ (4)));
...

The problem is that clang ignores the attribute.

Fix this by reverting this part of the commit.

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

27 hours agogas: deprecate .vtable_entry and .vtable_inherit
Richard Earnshaw [Thu, 11 Jun 2026 13:50:13 +0000 (14:50 +0100)] 
gas: deprecate .vtable_entry and .vtable_inherit

These ELF directives were a GNU extension to support the C++ ABI
that was in use before the introduction of the generic C++ ABI in
GCC-3.0.  They're obsolete now and many newer targets simply
do not provide the back-end support for them.

Flag them as deprecated in the NEWS file, and remove the documentation
for them.  Warn (once) if the directive is used in a source file.

37 hours agoPR 30308 yet again
Alan Modra [Thu, 11 Jun 2026 23:02:18 +0000 (08:32 +0930)] 
PR 30308 yet again

Commit cc28c46227cd removed the symbol_resolving recursion guards in
i386_intel_simplify_symbol.  The testcases we'd considered then just
involved simple equates, handled by symbol_equated_to.  However, more
complex expressions can also cause unbounded recursion.  This patch
restores the recursion guards.

* config/tc-i386-intel.c (i386_intel_simplify_symbol): Add
recursion guards.
* testsuite/gas/i386/intel-equ-loop.s,
* testsuite/gas/i386/intel-equ-loop.l: Extend testcase.

2 days agogdb/MicroBlaze: Add support for native linux gdb
Gopi Kumar Bulusu [Thu, 7 May 2026 12:17:40 +0000 (17:47 +0530)] 
gdb/MicroBlaze: Add support for native linux gdb

This patch adds support for native microblazeel-linux-gdb including
support for debugging with core dump files. Code is based on Xilinx/AMD
git repository used for Yocto builds with changes for proper indentation
and removal of commented out code.

Testing with native gdb has been checked to be working. Can load and run
a program using commands like break, step and finish. When a core file is
specified to gdb; registers can be examined using info reg. Tested using
qemu-system-microblazeel from AMD/Xilinx Yocto 2025.2 release.

Signed-off-by: David Holsgrove <david.holsgrove@petalogix.com>
Signed-off-by: Nathan Rossi <nathan.rossi@petalogix.com>
Signed-off-by: Mahesh Bodapati <mbodapat@xilinx.com>
Signed-off-by: Gopi Kumar Bulusu <gopi@sankhya.com>
Signed-off-by: Michael J. Eager <eager@eagercon.com>
2 days agogprof: Fix tests on Solaris [PR34237]
Rainer Orth [Thu, 11 Jun 2026 08:05:03 +0000 (10:05 +0200)] 
gprof: Fix tests on Solaris [PR34237]

The gprof tests FAIL on Solaris:

tst-gmon-gprof.sh ../gprof tst-gmon
--- expected
+++ actual
@@ -1,3 +1,4 @@
 f1 2000
 f2 1000
 f3 1
+main 1
FAIL

main is included in the call graph, probably because Solaris still uses
the original BSD gmon.out format.

This patch allows for that difference.  To distinguish between targets
with non-default handling, $target is passed to the test scripts.

As detailed in the PR, the powerpc with function descriptors special
case only applies to AIX, so that variant is guarded accordingly.

Tested on amd64-pc-solaris2.11, sparcv9-sun-solaris2.11, and
x86_64-pc-linux-gnu.

2026-06-08  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

gprof:
PR gprof/34237
* testsuite/Makefile.am (tst-gmon-gprof.out): Pass $(target) to
tst-gmon-gprof.sh.
(tst-gmon-gprof-l.out): Likewise.
(tst-gmon-gprof-l2.out): Likewise.
* testsuite/Makefile.in: Regenerate.

* testsuite/tst-gmon-gprof.sh (expected_dot): Remove.
<*-*-solaris2*>: Allow main in execution counters.
<powerpc-*-aix* | rs6000-*-aix*>: Handle function descriptor case here.
* testsuite/tst-gmon-gprof-l.sh: Likewise.
* testsuite/tst-gmon-gprof-l2.sh: Likewise.

2 days agomips-coff: mips_reflo_reloc buffer overflow
Alan Modra [Thu, 11 Jun 2026 01:40:40 +0000 (11:10 +0930)] 
mips-coff: mips_reflo_reloc buffer overflow

Like commit c2cb1bfb901e, but for mips-coff.  Make the hi reloc list
per-section rather than per-file, since fuzzers can generate objects
with cross-section refs where the hi reloc section data is freed
before the lo relocs are processed.

Also properly sanity check the hi reloc offset.

* libecoff.h (struct ecoff_tdata): Move mips_refhi_list to..
(struct ecoff_section_tdata): ..here.
(ecoff_section_data): Remove unused abfd arg.
* coff-alpha.c (alpha_relocate_section): Update ecoff_section_data.
* coff-mips.c (mips_refhi_reloc): Use bfd_reloc_offset_in_range.
Allocate ecoff_section_data as necessary.  Use that instead of
bfd tdata.
(mips_reflo_reloc): Adjust to suit tdata change.
* ecoff.c (_bfd_ecoff_bfd_free_cached_info): Likewise.

2 days ago[gdb] Use using instead of typedef
Tom de Vries [Thu, 11 Jun 2026 06:54:34 +0000 (08:54 +0200)] 
[gdb] Use using instead of typedef

After commit 1eed06ae51d ("[gdbsupport] Use using instead of typedef in
next_iterator") I wondered if I could do something similar using sed.

Result of:
...
$ find gdb* -type f -name "*.[ch]" -o -name "*.cc" \
    | egrep -v /testsuite/ \
    | xargs sed -i \
    's/^\([ \t]*\)typedef \([a-zA-Z_0-9:<>,.() ]*\) \([\*&][\*&]*\)\([a-zA-Z_0-9]*\);/\1using \4 = \2 \3;/'

$ find gdb* -type f -name "*.[ch]" -o -name "*.cc" \
    | egrep -v /testsuite/ \
    | xargs sed -i \
    's/^\([ \t]*\)typedef \([a-zA-Z_0-9:<>,.() ]*\) \([a-zA-Z_0-9]*\);/\1using \3 = \2;/'
...

Tested on x86_64-linux.

2 days agold: doc: Use consistent language for 'PE target'-only options
Jon Turney [Thu, 4 Jun 2026 13:22:37 +0000 (14:22 +0100)] 
ld: doc: Use consistent language for 'PE target'-only options

It seems like the 'i386 PE targeted' phrasing probably predates x86_64
PE support in binutils, and should have been touched when that was
added.

Even loosely interpreting that phrase to mean 'those two Intel
architectures, you know what I mean', this is less than helpful now that
PE aarch64 is a possibility.

Change the use of various phrases like '[This is an i386 PE specific
option]' to conistently use '[This option is specific to PE targeted
ports of the linker]' nearly everywhere.

The only options that really are specific in this way are
'--large-address-aware' (PE only) and '--high-entropy-va' (PE+ only), so
annotate those appropriately.

Do an editing pass of the various other mentions of 'PE'.

Also, add the 'PE only' annotation to the description of
'--leading-underscore' in the 'Options Specific to PE Targets' section,
to be consistent with all the others.

Also, since we've already mentioned that all the DllCharacteristics
flags are PE-specific, don't awkwardly mention it (again) as part of the
note about what Windows version support for that flag was introduced in.

Future work: the phrase 'PE targeted port of the linker' seems a bit
off, since cross-tools are a thing. Should it just be 'PE targeted linker'?

2026-06-01  Jon Turney  <jon.turney@dronecode.org.uk>

* ld.texi (Options): Use consistent language for 'PE target'-only
options.

2 days agoSort symtabs using their display filename
Tom Tromey [Tue, 9 Jun 2026 12:51:02 +0000 (06:51 -0600)] 
Sort symtabs using their display filename

While working on gnat-llvm, I found that many tests in
gdb.ada/info_auto_lang.exp were failing.  Investigating this, the
difference turned out to be a different sort order for the output.  I
then tracked this down to gnat-llvm emitting:

    <e3d>   DW_AT_name        : (indirect string, offset: 0xdd4): pck.adb
    ...
    <e45>   DW_AT_comp_dir    : (indirect string, offset: 0xddc): /home/tromey/AdaCore/binutils-gdb/gdb/testsuite/gdb.ada/mi_dyn_arr/

... whereas GCC emits:

    <108b>   DW_AT_name        : (indirect line string, offset: 0x10f): /home/tromey/gdb/binutils-gdb/gdb/testsuite/gdb.ada/mi_dyn_arr/pck.adb
    <108f>   DW_AT_comp_dir    : (indirect line string, offset: 0): /home/tromey/gdb/build/gdb/testsuite/outputs/gdb.ada/mi_dyn_arr

This distinction isn't relevant to the test, so I tried "set
filename-display basename".  However, this setting had no effect.

It seems to me that, for "info types" and the like, the output should
be sorted according to the user's display preferences.  This patch
implements this and adds a new DWARF assembler test.

Finally, this updates info_auto_lang.exp to be insensitive to this
quirk of gnat-llvm.

Approved-By: Andrew Burgess <aburgess@redhat.com>
2 days agogdb/testsuite: remove debug output messages from testsuite
Andrew Burgess [Wed, 10 Jun 2026 18:43:24 +0000 (19:43 +0100)] 
gdb/testsuite: remove debug output messages from testsuite

Over time I've managed to leave various debug logging messages in the
testsuite, all of which include the 'APB' tag that I use to make
searching for these easier.  None of these were required, they could
all be removed.

I have left the logging output in gdb.base/stap-probe.exp (but with
the 'APB' removed) as it looked slightly useful, and it's harmless to
keep it.  But all of the other logging lines I just removed.

There should be no change in what is tested after this commit.

2 days agogdb/breakpoint: remove assertion when printing internal breakpoints without locspecs
Sébastien Darche [Thu, 21 May 2026 15:12:17 +0000 (11:12 -0400)] 
gdb/breakpoint: remove assertion when printing internal breakpoints without locspecs

When debugging gdb with `set debug breakpoint on`, gdb would crash if
the inferior happened to unload (through dlclose ()) a shared library
that contains jit debugging symbols:

../../gdb/breakpoint.c:6473: internal-error: print_breakpoint_location:
Assertion `b->locspec != nullptr || (!user_breakpoint_p (b) && (b->type
== bp_shlib_event || b->type == bp_thread_event))' failed.
A problem internal to GDB has been detected [...]

This assertion was added in commit 5770f68 ("gdb: handle empty locspec
when printing breakpoints"). The assumption for this assert is that the
user may not call any (gdb-)debugging command between the time a shared
library is marked (bp_location->shlib_disabled is set) and the
breakpoint is actually removed. This would be true if the user called
`maint info breakpoints` as explained in the original commit message.

However, if `set debug breakpoint on` is called, gdb prints debugging
info as the shared library is being unloaded. The ~jiter_objfile_data
dtor deletes the breakpoint, which calls remove_breakpoint_1 on the
bp_location in the recently unloaded shared object. Since `debug
breakpoint` is enabled, we go through print_breakpoint_location with the
bp_location's shlib_disabled flag set, which results in the assert
above.

This commit removes the assertion as it is not true in all cases. I've
also included a minimal test case that loads a shared library with a
__jit_debug_register_code symbol. The test fails with the assert.

Approved-By: Andrew Burgess <aburgess@redhat.com>
Change-Id: Ia19c84f194a6f0c10315548c7f423bfd86ef0266

3 days ago[gdb/testsuite] Codespell fixes
Tom de Vries [Wed, 10 Jun 2026 09:43:35 +0000 (11:43 +0200)] 
[gdb/testsuite] Codespell fixes

Fix typos in gdb/testsuite using an interactive session:
...
$ codespell --toml gdb/pyproject.toml -w -i 3 gdb/testsuite
...

3 days ago[gdb/contrib] Fix UnicodeDecodeError in dwarf-to-dwarf-assembler.py
Tom de Vries [Wed, 10 Jun 2026 09:11:53 +0000 (11:11 +0200)] 
[gdb/contrib] Fix UnicodeDecodeError in dwarf-to-dwarf-assembler.py

When running dwarf-to-dwarf-assembler.py on outputs/gdb.rust/unicode/unicode,
I run into a UnicodeDecodeError for (using readelf -w):
...
 <4><9cf>: Abbrev Number: 10 (DW_TAG_variable)
    <9d3>   DW_AT_name        : (indirect string, offset: 0xab4): 𝕯
...
or more explicit using llvm-dwarfdump -v:
...
0x000009cf:         DW_TAG_variable [10]   (0x000009c2)
                      DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000ab4] \
                                                  = "\360\235\225\257")
...

Fix this by using UTF-8 instead of ascii decoding, which gets us instead:
...
  DW_AT_name 𝕯 DW_FORM_strp
...

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

3 days ago[gdb/contrib] Fix ELFParseError in dwarf-to-dwarf-assembler.py
Tom de Vries [Wed, 10 Jun 2026 07:54:22 +0000 (09:54 +0200)] 
[gdb/contrib] Fix ELFParseError in dwarf-to-dwarf-assembler.py

When running dwarf-to-dwarf-assembler.py on
outputs/gdb.dwarf2/implptr-64bit/implptr-64bit-d2-o8-a4-r4-t0, I run into:
...
elftools.common.exceptions.ELFParseError: expected 8, found 5
...
for the DWARF:
...
 <2><335>: Abbrev Number: 8 (DW_TAG_variable)
    <336>   DW_AT_name        : p
    <338>   DW_AT_location    : 6 byte block: f2 14 3 0 0 0 \
                                (DW_OP_GNU_implicit_pointer: <0x314> 0)
...

Pyelftools expects that DW_OP_GNU_implicit_pointer has an 8-byte reference
operand (because it's a 64-bit DWARF unit), but instead it has a 4-byte
reference.

The DWARF is correct, it's a cornercase of using DW_OP_GNU_implicit_pointer in
DWARF v2, where DW_FORM_ref_addr references have the same size as an address
on the target system, something that was changed in DWARF v3.

Handle this by catching the error and printing:
...
DW_AT_location "\xf2\x14\x03\x00\x00\x00" DW_FORM_block \
  # Failed to print DWARF expression: expected 8, found 5
...

Approved-By: Tom Tromey <tom@tromey.com>
3 days ago[gdb/contrib] Fix KeyError in dwarf-to-dwarf-assembler.py
Tom de Vries [Wed, 10 Jun 2026 07:54:22 +0000 (09:54 +0200)] 
[gdb/contrib] Fix KeyError in dwarf-to-dwarf-assembler.py

Executable outputs/gdb.threads/stepi-over-clone/stepi-over-clone contains the
following DWARF (using readelf -w):
...
    <31c5>   DW_AT_const_value : 8 byte block: ff ff ff ff ff ff ff ff
...
or more explicit using llvm-dwarfdump -v:
...
                DW_AT_const_value [DW_FORM_block1] \
  (<0x08> ff ff ff ff ff ff ff ff )
...

Before commit 18ad8c1a54d ("Emit DWARF expressions from
dwarf-to-dwarf-assembler.py"), the dwarf-to-dwarf-assembler.py script
generated:
...
DW_AT_const_value { MANUAL: Fill expr list } SPECIAL_expr
...
for this.

But since the commit, we run into a KeyError.

The problem is that we're trying to interpret some random data as a DWARF
expression.

Fix this by special-casing DW_AT_const_value, and generating instead:
...
DW_AT_const_value "\xff\xff\xff\xff\xff\xff\xff\xff" DW_FORM_block1
...
which mimics the style I found in gdb.dwarf2/info-locals-optimized-out.exp:
...
                DW_TAG_variable {
                    DW_AT_name const_bytes
                    DW_AT_type :$int_type_label
                    DW_AT_const_value "\x01\x01\x01\x01" DW_FORM_block1
}
...

Likewise for DW_AT_discr_list.

Another case for which the KeyError triggers, is DWARF from
outputs/gdb.ada/array_of_variant/p-minimal:
...
 <2><14a4>: Abbrev Number: 20 (DW_TAG_structure_type)
    <14a5>   DW_AT_name        : p__payload_t
    <14a9>   DW_AT_byte_size   : 18 byte block: \
                                 fd 63 14 0 0 97 94 1 99 45 0 0 0 23 7 9 fc 1a \
 (DW_OP_GNU_variable_value: <0x1463>; \
  DW_OP_push_object_address; \
  DW_OP_deref_size: 1; \
  DW_OP_call4: <0x1421>; \
  DW_OP_plus_uconst: 7; \
  DW_OP_const1s: -4; DW_OP_and)
...
because the pyelftools version that I'm using doesn't support
DW_OP_GNU_variable_value yet (supported starting v0.33).

Fix this by catching the KeyError, and falling back to the string case:
...
  DW_AT_byte_size \
  "\xfd\x63\x14\x00\x00\x97\x94\x01\x99\x45\x00\x00\x00\x23\x07\x09\xfc\x1a" \
  DW_FORM_exprloc # Failed to print op as DWARF expression: 0xfd
...

3 days agoPR 34204 dlltool SEGVs with --exclude-symbols
Alan Modra [Wed, 10 Jun 2026 02:10:59 +0000 (11:40 +0930)] 
PR 34204 dlltool SEGVs with --exclude-symbols

This fixes a segfault introduced by commit 45a7f5a29de7 which didn't
take into account that there was a use of leading_underscore in option
processing.

PR 34204
* dlltool.c (struct string_list): Make string a flexible array
member.
(add_excludes): Adjust to suit.  Extract code adding underscore
and informing..
(underscore_excludes): ..to here.  New function.
(main): Call underscore_excludes.

3 days agogdb, btrace: support libipt v2.2 events
Markus Metzger [Thu, 20 Nov 2025 11:21:41 +0000 (11:21 +0000)] 
gdb, btrace: support libipt v2.2 events

Add support for printing new events added in libipt v2.2 originating from
Event Tracing in combination with Flexible Return and Event Delivery
(FRED) and from Trigger Tracing.

Reviewed-By: Keith Seitz <keiths@redhat.com>
Reviewed-By: Eli Zaretskii <eliz@gnu.org>
3 days agogdb, btrace: fix wrong #endif comments
Markus Metzger [Mon, 4 May 2026 06:49:34 +0000 (06:49 +0000)] 
gdb, btrace: fix wrong #endif comments

Approved-By: Simon Marchi <simon.marchi@efficios.com>
3 days ago[gdb] Add missing i18n support to warning strings (part 5)
Tom de Vries [Tue, 9 Jun 2026 20:14:07 +0000 (22:14 +0200)] 
[gdb] Add missing i18n support to warning strings (part 5)

Add missing i18n support to some multi-line warning strings.

Approved-By: Tom Tromey <tom@tromey.com>
3 days ago[gdb] Add missing i18n support to warning strings (part 4)
Tom de Vries [Tue, 9 Jun 2026 20:14:07 +0000 (22:14 +0200)] 
[gdb] Add missing i18n support to warning strings (part 4)

Add missing i18n support to some warning strings.

Result of:
...
$ find gdb* -type f -name "*.[ch]" -o -name "*.cc" \
    | egrep -v /testsuite/ \
    | xargs sed -i \
        '/"[ \t]*%s[ \t]*"/b l;s/\([ \t]\)warning (\("[^"]*"\)\(.*\));/\1warning (_(\2)\3);/;:l'
...

Approved-By: Tom Tromey <tom@tromey.com>
3 days ago[gdb] Add missing i18n support to warning strings (part 3)
Tom de Vries [Tue, 9 Jun 2026 20:14:07 +0000 (22:14 +0200)] 
[gdb] Add missing i18n support to warning strings (part 3)

Add missing i18n support to some warning strings.

Result of:
...
$ find gdb* -type f -name "*.[ch]" -o -name "*.cc"
    | egrep -v /testsuite/ \
    | xargs sed -i \
        '/"[ \t]*%s[ \t]*"/b l;s/\([ \t]\)warning (\("[^"]*"\),$/\1warning (_(\2),/;:l'
...

Approved-By: Tom Tromey <tom@tromey.com>
3 days ago[gdb] Add missing i18n support to warning strings (part 2)
Tom de Vries [Tue, 9 Jun 2026 20:14:07 +0000 (22:14 +0200)] 
[gdb] Add missing i18n support to warning strings (part 2)

Add missing i18n support to some warning strings.

Result of:
...
$ find gdb* -type f -name "*.[ch]" -o -name "*.cc" \
    | egrep -v /testsuite/ \
    | xargs sed -i \
        '/"[ \t]*%s[ \t]*"/b l;s/\([ \t]\)warning (\("[^"]*"\)\([^)]*\));/\1warning (_(\2)\3);/;:l'
...

Approved-By: Tom Tromey <tom@tromey.com>
3 days ago[gdb] Add missing i18n support to warning strings (part 1)
Tom de Vries [Tue, 9 Jun 2026 20:14:07 +0000 (22:14 +0200)] 
[gdb] Add missing i18n support to warning strings (part 1)

Add missing i18n support to some warning strings.

Result of:
...
$ find gdb* -type f -name "*.[ch]" -o -name "*.cc" \
    | egrep -v /testsuite/ \
    | xargs sed -i \
        's/\([ \t]\)warning (\("[^"]*"\));/\1warning (_(\2));/'
...

Approved-By: Tom Tromey <tom@tromey.com>
3 days ago[gdb] Add missing i18n support to errors strings (part 5)
Tom de Vries [Tue, 9 Jun 2026 20:14:07 +0000 (22:14 +0200)] 
[gdb] Add missing i18n support to errors strings (part 5)

Add missing i18n support to some multi-line error strings.

Approved-By: Tom Tromey <tom@tromey.com>
3 days ago[gdb] Add missing i18n support to error strings (part 4)
Tom de Vries [Tue, 9 Jun 2026 20:14:07 +0000 (22:14 +0200)] 
[gdb] Add missing i18n support to error strings (part 4)

Add missing i18n support to some error strings.

Result of:
...
$ find gdb* -type f -name "*.[ch]" -o -name "*.cc" \
    | egrep -v /testsuite/ \
    | xargs sed -i \
        '/"[ \t]*%s[ \t]*"/b l;s/\([ \t]\)error (\("[^"]*"\)\(.*\));/\1error (_(\2)\3);/;:l'
...

Approved-By: Tom Tromey <tom@tromey.com>
3 days ago[gdb] Add missing i18n support to error strings (part 3)
Tom de Vries [Tue, 9 Jun 2026 20:14:07 +0000 (22:14 +0200)] 
[gdb] Add missing i18n support to error strings (part 3)

Add missing i18n support to some error strings.

Result of:
...
$ find gdb* -type f -name "*.[ch]" -o -name "*.cc" \
    | egrep -v /testsuite/ \
    | xargs sed -i \
        '/"[ \t]*%s[ \t]*"/b l;s/\([ \t]\)error (\("[^"]*"\)\([^)]*\));/\1error (_(\2)\3);/;:l'
...

Approved-By: Tom Tromey <tom@tromey.com>
3 days ago[gdb] Add missing i18n support to error strings (part 2)
Tom de Vries [Tue, 9 Jun 2026 20:14:07 +0000 (22:14 +0200)] 
[gdb] Add missing i18n support to error strings (part 2)

Add missing i18n support to some error strings.

Result of:
...
$ find gdb* -type f -name "*.[ch]" -o -name "*.cc" \
    | egrep -v /testsuite/ \
    | xargs sed -i \
        '/"[ \t]*%s[ \t]*"/b l;s/\([ \t]\)error (\("[^"]*"\),$/\1error (_(\2),/;:l'
...

Approved-By: Tom Tromey <tom@tromey.com>
3 days ago[gdb] Add missing i18n support to error strings (part 1)
Tom de Vries [Tue, 9 Jun 2026 20:14:06 +0000 (22:14 +0200)] 
[gdb] Add missing i18n support to error strings (part 1)

Add missing i18n support to some error strings.

Result of:
...
$ find gdb* -type f \
    | egrep -v /testsuite/ \
    | xargs sed -i \
          's/\([ \t]\)error (\("[^"]*"\));/\1error (_(\2));/'
...

Approved-By: Tom Tromey <tom@tromey.com>
3 days ago[gdb/testsuite] Fix typo in configure.ac
Tom de Vries [Tue, 9 Jun 2026 18:31:54 +0000 (20:31 +0200)] 
[gdb/testsuite] Fix typo in configure.ac

Fix a typo in gdb/testsuite/configure.ac, and regenerate
gdb/testsuite/configure.

Approved-By: Tom Tromey <tom@tromey.com>
3 days ago[gdb/build] Fix building gdb.pot
Tom de Vries [Tue, 9 Jun 2026 18:23:25 +0000 (20:23 +0200)] 
[gdb/build] Fix building gdb.pot

Since commit 8708a20e2bb ("gdb: store gdbtk object files into their sources
directory"), building gdb.pot is broken.

The commit added gdbtk/generic to CONFIG_SRC_SUBDIR, and building gdb.pot
breaks because the directory doesn't exist.

Fix this by ignoring the dir while building gdb.pot.

Approved-By: Tom Tromey <tom@tromey.com>
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=34212

3 days agoMake two Ada tests more robust
Tom Tromey [Tue, 9 Jun 2026 13:36:37 +0000 (07:36 -0600)] 
Make two Ada tests more robust

tasks.exp and task_watch.exp were failing when run with gnat-llvm.
Investigating these showed the same problem (which makes sense because
the tests use the same program).  In this code:

    for J in Task_List'Range loop  -- STOP_HERE
       Task_List (J).Call_Break_Me;
    end loop;

... with GCC, the breakpoint set on the 'for' line is only hit a
single time.  However, with gnat-llvm, the breakpoint is hit on every
iteration of the loop.  IMO this is a GCC bug.

Similarly, at the end of the function:

    null; -- STOP_HERE_2

... with gnat-llvm, a breakpoint set here was not being hit.  It seems
perhaps somewhat strange to set a breakpoint on a null statement at
the end of a function; and while this might possibly be a gnat-llvm
bug, this isn't really the point of this test.

This patch makes these tests more robust by arranging for the
breakpoints to be set before the loop and on a call, respectively.

Because this is Ada-specific, was reviewed internally, and is just a
minor test case adjustment, I am checking it in.

4 days ago[gdbsupport] Use using instead of typedef in next_iterator
Tom de Vries [Tue, 9 Jun 2026 12:37:16 +0000 (14:37 +0200)] 
[gdbsupport] Use using instead of typedef in next_iterator

Use using instead of typedef in next_iterator.  While we're at it, do the same
in basic_safe_iterator.

Suggested-By: Simon Marchi <simon.marchi@polymtl.ca>
Co-Authored-By: Simon Marchi <simon.marchi@polymtl.ca>
4 days ago[gdb] Add unit test for next_iterator
Tom de Vries [Tue, 9 Jun 2026 12:37:16 +0000 (14:37 +0200)] 
[gdb] Add unit test for next_iterator

I noticed that next_iterator doesn't have a selftest.  Add this.

4 days agogdb_py_tp_name: remove redundant PyErr_Clear
Matthieu Longo [Mon, 8 Jun 2026 10:27:44 +0000 (11:27 +0100)] 
gdb_py_tp_name: remove redundant PyErr_Clear

gdbpy_print_stack() already clears the error indicator.
Thus remove the following call to PyErr_Clear().

Approved-By: Andrew Burgess <aburgess@redhat.com>
4 days agogdb: Fix build for gnu hurd
Etienne Brateau [Tue, 9 Jun 2026 08:27:57 +0000 (10:27 +0200)] 
gdb: Fix build for gnu hurd

Commit 695fd5ec122 ("gdb: make find_memory_region_ftype a function_view")
broke the build for gnu hurd.  Fix this.

Approved-By: Tom de Vries <tdevries@suse.de>
5 days agogdb: fix typo gcs_availabe
Matthieu Longo [Wed, 20 May 2026 10:46:56 +0000 (11:46 +0100)] 
gdb: fix typo gcs_availabe

Approved-by: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
5 days agoRe: RISC-V: riscv_parse_subset_t's isa_spec is only parser input
Alan Modra [Sun, 7 Jun 2026 23:43:51 +0000 (09:13 +0930)] 
Re: RISC-V: riscv_parse_subset_t's isa_spec is only parser input

check_compiler_available fails with a ld segfault linking
int main (void) { return 0; }

Program received signal SIGSEGV, Segmentation fault.
0x0000000000466a64 in riscv_parse_add_subset (rps=rps@entry=0x7fffffffd450, subset=subset@entry=0x962ca0 "zaamo", major=-1, minor=-1, implicit=implicit@entry=true) at /home/alan/src/binutils-gdb/bfd/elfxx-riscv.c:1947
1947     riscv_get_default_ext_version (*rps->isa_spec, subset,
(gdb) p rps->isa_spec
$1 = (const enum riscv_spec_class *) 0x0

This was triggered when calling riscv_merge_attributes for crti.o
which had
(gdb) p ibfd->tdata.elf_obj_data->known_obj_attributes[OBJ_ATTR_PROC][Tag_RISCV_arch]
$5 = {type = 2, i = 0, s = 0x97e4c0 "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0_zmmul1p0"}

Fix the segfault by reinstating a NULL check removed with commit
413cf36d8e81

5 days agoAutomatic date update in version.in
GDB Administrator [Mon, 8 Jun 2026 00:00:08 +0000 (00:00 +0000)] 
Automatic date update in version.in

6 days agoAutomatic date update in version.in
GDB Administrator [Sun, 7 Jun 2026 00:00:08 +0000 (00:00 +0000)] 
Automatic date update in version.in

7 days agofilter_implib_symbols
Alan Modra [Sat, 6 Jun 2026 01:38:11 +0000 (11:08 +0930)] 
filter_implib_symbols

This tidies filter_implib_symbols implementations, which I noticed
returned unsigned int but took long symbol counts.  While unsigned int
is very likely sufficient, size_t is better.

_bfd_elf_filter_global_symbols is a linker-only function so really
should be moved to elflink.c, but I left it in elf.c as it calls
sym_is_global, a static function in elf.c.

* elf-bfd.h (struct elf_backend_data): Take size_t symcount
and return a size_t from elf_backend_filter_implib_symbols.
(_bfd_elf_filter_implib_symbols): Likewise.  Rename from
_bfd_elf_filter_global_symbols.
* elf.c (_bfd_elf_filter_implib_symbols): Likewise.  Use
size_t vars too, and avoid unnecessary casts.
* elf32-arm.c (elf32_arm_filter_cmse_symbols): Likewise.
(elf32_arm_filter_implib_symbols): Likewise.
* elflink.c (elf_output_implib): Avoid unneccesary casts.
Call elf_backend_filter_implib_symbols uncontitionally.
* elfxx-target.h (elf_backend_filter_implib_symbols): Define
fallback as _bfd_elf_filter_implib_symbols.

7 days agoDrop output bfd param from many elf linker functions
Alan Modra [Sat, 6 Jun 2026 01:36:40 +0000 (11:06 +0930)] 
Drop output bfd param from many elf linker functions

Functions that are always passed a non-NULL bfd_link_info* and are not
called by BFD_SEND using the output bfd, need not pass the output bfd
as a parameter.  It can be accessed via info->output_bfd.  Removing
the excess parameters result in a small code size reduction on
x86_64-linux --enable-targets=all ld built with a static libbfd, from
9896133 to 9893805 bytes.

7 days agogas s_comm_internal uninitialised access
Alan Modra [Sat, 6 Jun 2026 01:35:45 +0000 (11:05 +0930)] 
gas s_comm_internal uninitialised access

After elf_common_parse calls ignore_rest_of_line on some errors,
s_comm_internal calls demand_empty_rest_of_line.  These functions
cannot be both called, as they consume the end_of_stmt char in the
input buffer and the second call then consumes the next line of input,
which may not even be in the input buffer.

* config/obj-elf.c (elf_common_parse): Don't call
ignore_rest_of_line here.
* read.c (ignore_rest_of_line): Expand comment.

7 days agoAutomatic date update in version.in
GDB Administrator [Sat, 6 Jun 2026 00:00:07 +0000 (00:00 +0000)] 
Automatic date update in version.in

7 days agoEmit DWARF expressions from dwarf-to-dwarf-assembler.py
Tom Tromey [Fri, 22 May 2026 17:17:17 +0000 (11:17 -0600)] 
Emit DWARF expressions from dwarf-to-dwarf-assembler.py

This changes dwarf-to-dwarf-assembler.py to attempt to emit DWARF
expressions.  It is not close to perfect, since it relies on the
elftools formatting to some extent, but it does at least eliminate the
need to do a separate "readelf" step to try to work on the expression
by hand.

7 days agoUse double quotes in some gdb output
Tom Tromey [Wed, 22 Apr 2026 18:31:57 +0000 (12:31 -0600)] 
Use double quotes in some gdb output

I looked for spots where gdb was using `...' or ``...'' quoting, and
changed these to use double quotes instead.

I think it might be good to regularize output quoting in gdb.  My
proposal is to use double quotes, though single quotes would also be
fine.  Using `...', though, is a kind of older style and has fallen
out of favor in GNU; the relevant node is here:

    https://www.gnu.org/prep/standards/html_node/Quote-Characters.html

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

7 days ago[gdb] Drop nullptr in "get_selected_frame (nullptr)"
Tom de Vries [Fri, 5 Jun 2026 21:06:48 +0000 (23:06 +0200)] 
[gdb] Drop nullptr in "get_selected_frame (nullptr)"

I came across "get_selected_frame (nullptr)", and realized nullptr is the
default argument, so this can be simplified to "get_selected_frame ()".

Do so using the following script:
...
$ find gdb* -type f -name "*.[ch]" -o -name "*.cc" \
    | xargs sed -i 's/get_selected_frame (nullptr)/get_selected_frame ()/'
...
and likewise for "get_selected_frame (NULL)".

Tested on x86_64-linux.

Approved-By: Tom Tromey <tom@tromey.com>
7 days ago[gdb/build] Fix Wnon-pod-varargs in bppy_repr
Tom de Vries [Fri, 5 Jun 2026 21:03:42 +0000 (23:03 +0200)] 
[gdb/build] Fix Wnon-pod-varargs in bppy_repr

I build gdb with clang and ran into a build breaker:
...
gdb/python/py-breakpoint.c:1074:52: error: cannot pass object of non-trivial \
  type 'const std::string' (aka 'const basic_string<char>') through variadic \
  function; call will abort at runtime [-Wnon-pod-varargs]
 1074 |     return PyUnicode_FromFormat ("<%s (invalid)>", tp_name);
      |                                                    ^
...

This looks like fallout from commit dafd73bcda6 ("gdb/python: fix memory leak
in gdb_py_tp_name"), which changed the return type of gdbpy_py_obj_tp_name
from const char * to std::string.

We could fix this using tp_name.c_str (), but instead fix this by simplifying
the code using gdb_py_invalid_object_repr.

Tested on x86_64-linux.

Approved-By: Tom Tromey <tom@tromey.com>
7 days agoAdd two new warnings to warning.m4
Tom Tromey [Wed, 3 Jun 2026 19:03:31 +0000 (13:03 -0600)] 
Add two new warnings to warning.m4

I recently learned that GCC has improved -Wdangling-reference and
added -Wunterminated-string-initialization.  Both of these seem
sensible to me, so this patch adds them to warning.m4.

gdb rebuilds cleanly with this in place on x86-64 Fedora 43.

Reviewed-By: Tom de Vries <tdevries@suse.de>
8 days ago[gdb/testsuite] Add missing copyright notice in tclint-plugin.py
Tom de Vries [Fri, 5 Jun 2026 12:18:59 +0000 (14:18 +0200)] 
[gdb/testsuite] Add missing copyright notice in tclint-plugin.py

I ran:
...
$ ./gdb/contrib/license-check-new-files.sh -s gdb-17-branchpoint HEAD
Scanning directories gdb*/...
gdb/features/aarch64-fpmr.c: None
gdb/features/aarch64-fpmr.xml: FSFAP-no-warranty-disclaimer
gdb/syscalls/riscv-linux.xml: FSFAP
gdb/syscalls/riscv-linux.xml.in: FSFAP-no-warranty-disclaimer
gdb/testsuite/tclint-plugin.py: None
gdbsupport/unordered_dense/stl.h: MIT
...
and found out that I forgot to add a copyright notice to
gdb/testsuite/tclint-plugin.py.

Fix this by adding a copyright notice.

8 days agobfd/RISC-V: move _bfd_riscv_elf_merge_private_bfd_data()
Jan Beulich [Fri, 5 Jun 2026 09:12:00 +0000 (11:12 +0200)] 
bfd/RISC-V: move _bfd_riscv_elf_merge_private_bfd_data()

The sole size dependent parameter used there is ARCH_SIZE. For just this
there's no good reason to build all of the involved code twice. Make the
value a function parameter instead.

Reviewed-by: Jiawei <jiawei@iscas.ac.cn>
8 days agoRISC-V: drop dead code from subset parsing
Jan Beulich [Fri, 5 Jun 2026 09:11:40 +0000 (11:11 +0200)] 
RISC-V: drop dead code from subset parsing

In riscv_update_subset1(), when explicit_subset is NULL, errmsg_internal
is the empty string. There's no need then to pass this as an extra
argument to the error handler.

riscv_parsing_subset_version() can't return NULL. Dropping the respective
checks clarifies that there is no issue with a missing error message (gas
would rely on one being emitted when parsing fails).

Reviewed-by: Jiawei <jiawei@iscas.ac.cn>
8 days agoRISC-V: avoid buffer underrun in subset parsing
Jan Beulich [Fri, 5 Jun 2026 09:11:25 +0000 (11:11 +0200)] 
RISC-V: avoid buffer underrun in subset parsing

In both instances 'p' can be the first character. Inspecting the character
immediately ahead of it is then UB.

To increase similarity between the two checks (each), also move the
increment of q past the check for the (bogus) "<number>p" ending.

Correct indentation in nearby code, where it being wrong is actively
misleading.

Reviewed-by: Jiawei <jiawei@iscas.ac.cn>
8 days agoRISC-V: error handling for subset parsing
Jan Beulich [Fri, 5 Jun 2026 09:10:28 +0000 (11:10 +0200)] 
RISC-V: error handling for subset parsing

The parsing of both the argument of -march= and the operand(s) of
".option arch, ..." can fail. In such a case for .option (and equally
for .attribute) prior state should continue to be used, while for -march=
defaults should be put in place. In particular, extensions conflicting
with previously enabled extensions should not suddenly become available.

While re-indenting riscv_set_rvc() invocations, leverage that C implies
Zca (and hence a check for the latter suffices). Mirror that change to
riscv_set_arch() for consistency.

Reviewed-by: Jiawei <jiawei@iscas.ac.cn>
8 days agoRISC-V: riscv_parse_subset_t's isa_spec is only parser input
Jan Beulich [Fri, 5 Jun 2026 09:10:12 +0000 (11:10 +0200)] 
RISC-V: riscv_parse_subset_t's isa_spec is only parser input

Make the field pointer-to-const and drop indirection from
riscv_get_default_ext_version(). This way it's more clear that parsing
won't alter the field.

Reviewed-by: Jiawei <jiawei@iscas.ac.cn>
8 days agoRISC-V: riscv_set_arch() can fail
Jan Beulich [Fri, 5 Jun 2026 09:09:55 +0000 (11:09 +0200)] 
RISC-V: riscv_set_arch() can fail

In that case neither riscv_rps_as.subset_list nor file_arch_str would be
set, yet the NULL pointers would be happily passed into functions not
expecting such.

Reviewed-by: Jiawei <jiawei@iscas.ac.cn>
8 days agoRISC-V: match_*() improvements
Jan Beulich [Fri, 5 Jun 2026 09:09:38 +0000 (11:09 +0200)] 
RISC-V: match_*() improvements

Match functions referenced by macro insns should not
unconditionally invoke match_opcode(): The macro enumeration can change
(grow), making the function potentially yield false negatives.

In match_rs1_nonzero(), used solely by macro insns, add an assertion to
that effect.

While there also drop the pointless attribute from
match_rs1_nonzero_rs2_even()'s first parameter.

8 days agoRISC-V: fold redundant code in riscv_ip()
Jan Beulich [Fri, 5 Jun 2026 09:09:18 +0000 (11:09 +0200)] 
RISC-V: fold redundant code in riscv_ip()

The parsing of 'F' and 'O' .insn operands is pretty redundant. Have only a
single instance each of common code, with the inner switch()es merely
handling the actual value insertion. This in particular simplifies the
addition of new sub-forms.

Reviewed-by: Jiawei <jiawei@iscas.ac.cn>
8 days agoRISC-V: rename operand descriptor O4
Jan Beulich [Fri, 5 Jun 2026 09:08:48 +0000 (11:08 +0200)] 
RISC-V: rename operand descriptor O4

It's describing a 7-bit field, so O7 is the more consistent (with other
O<n> and F<n>) name. This way a subsequent change will also be a little
easier.

Reviewed-by: Jiawei <jiawei@iscas.ac.cn>
8 days agorestore KVX maintainer
Jan Beulich [Fri, 5 Jun 2026 09:08:14 +0000 (11:08 +0200)] 
restore KVX maintainer

... now that a new email address for Paul is known. This partly reverts
1669d187cb4a ('MAINTAINERS: move three people to "Past Maintainers"').

8 days agoAutomatic date update in version.in
GDB Administrator [Fri, 5 Jun 2026 00:00:08 +0000 (00:00 +0000)] 
Automatic date update in version.in

8 days ago[gdb] Drop executable mode in some files
Tom de Vries [Thu, 4 Jun 2026 20:06:20 +0000 (22:06 +0200)] 
[gdb] Drop executable mode in some files

During a review, Claude Code noticed that gdb/amd64-tdep.c has executable
mode.

This was added by accident in commit f9aa48dc545 ("gdb, amd64: extend the
amd64 prologue analyzer to skip register pushes").

Fix this, and similar problems in other files.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
8 days agogdb: z80: Guard against missing symtab in skip_prologue
Simon Marchi [Thu, 4 Jun 2026 19:46:48 +0000 (15:46 -0400)] 
gdb: z80: Guard against missing symtab in skip_prologue

With a Z80 ELF binary, "break main" crashes GDB internally.
"break *main" works.

The crash happens in z80_skip_prologue after find_sal_for_pc returns
a symtab_and_line whose symtab is NULL.  The code unconditionally calls:

  prologue_sal.symtab->compunit()->debugformat()

----- Backtrace -----
0x6385f3c7fc41 gdb_internal_backtrace_1
../../gdb/bt-utils.c:122
0x6385f3c7fc41 _Z22gdb_internal_backtracev
../../gdb/bt-utils.c:173
0x6385f3dd2313 handle_fatal_signal
../../gdb/event-top.c:1008
0x6385f3dd28b9 handle_sigsegv
../../gdb/event-top.c:1085
0x757e7704532f ???
./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
0x6385f40f8207 _ZNK15compunit_symtab11debugformatEv
../../gdb/symtab.h:1857
0x6385f40f8207 z80_skip_prologue
../../gdb/z80-tdep.c:499
0x6385f3c250bc _Z30gdbarch_skip_prologue_noexceptP7gdbarchm
../../gdb/arch-utils.c:1046
0x6385f3ff46f5 _Z17skip_prologue_salP15symtab_and_line
../../gdb/symtab.c:3765
0x6385f3ff4bba find_function_start_sal_1
../../gdb/symtab.c:3538
0x6385f3ff4c83 _Z23find_function_start_salmP11obj_sectionb
../../gdb/symtab.c:3549
0x6385f3e73c9e minsym_found
../../gdb/linespec.c:4078
0x6385f3e73c9e convert_linespec_to_sals
../../gdb/linespec.c:2290
0x6385f3e755f8 parse_linespec
../../gdb/linespec.c:2655
0x6385f3e76d35 location_spec_to_sals
../../gdb/linespec.c:3053
0x6385f3e771b0 _Z16decode_line_fullP13location_speciP13program_spaceP6symtabiP15linespec_resultPKcS8_
../../gdb/linespec.c:3129
0x6385f3c671d3 parse_breakpoint_sals
../../gdb/breakpoint.c:9084
0x6385f3c6b490 _Z17create_breakpointP7gdbarchP13location_specPKciiS4_bii6bptypei12auto_booleanPK14breakpoint_opsiiij
../../gdb/breakpoint.c:9319
0x6385f3c6be42 break_command_1
../../gdb/breakpoint.c:9478
0x6385f3cbe834 _Z8cmd_funcP16cmd_list_elementPKci
../../gdb/cli/cli-decode.c:2810
0x6385f4047c44 _Z15execute_commandPKci
../../gdb/top.c:632
0x6385f3dd3158 _Z15command_handlerPKc
../../gdb/event-top.c:611
0x6385f3dd4b60 _Z20command_line_handlerOSt10unique_ptrIcN3gdb13xfree_deleterIcEEE
../../gdb/event-top.c:844
0x6385f3dd3d74 gdb_rl_callback_handler
../../gdb/event-top.c:288
0x6385f41173e8 rl_callback_read_char
../../../readline/readline/callback.c:302
0x6385f3dd3eed gdb_rl_callback_read_char_wrapper_sjlj
../../gdb/event-top.c:197
0x6385f3dd40b3 gdb_rl_callback_read_char_wrapper_noexcept
../../gdb/event-top.c:240
0x6385f3dd40b3 gdb_rl_callback_read_char_wrapper
../../gdb/event-top.c:252
0x6385f4085c8f stdin_event_handler
../../gdb/ui.c:161
0x6385f41d7f85 gdb_wait_for_event
../../gdbsupport/event-loop.cc:694
0x6385f41d87e1 _Z16gdb_do_one_eventi
../../gdbsupport/event-loop.cc:263
0x6385f3e8be39 _ZN6interp12do_one_eventEi
../../gdb/interps.h:90
0x6385f3e8be39 start_event_loop
../../gdb/main.c:400
0x6385f3e8be39 captured_command_loop
../../gdb/main.c:465
0x6385f3e8e2c4 captured_main
../../gdb/main.c:1373
0x6385f3e8e2c4 _Z8gdb_mainP18captured_main_args
../../gdb/main.c:1392
0x6385f3bbf5bb main
../../gdb/gdb.c:38
---------------------
A fatal error internal to GDB has been detected, further
debugging is not possible.  GDB will now terminate.

How to reproduce:
  z80-...-gdb hello.elf
  (gdb) break main

Expected:
GDB should either set the breakpoint or fall back gracefully.

Actual:
GDB terminates with an internal segmentation fault.

Tested fix:
Adding null check for prologue_sal.symtab prevents the crash.

Change-Id: Iaaf0e1602127de08b85b3ed18e3c4877c89b8efd
Approved-By: Simon Marchi <simon.marchi@efficios.com>
8 days agogdb/python: fix memory leak in gdb_py_tp_name
Matthieu Longo [Tue, 26 May 2026 10:46:29 +0000 (11:46 +0100)] 
gdb/python: fix memory leak in gdb_py_tp_name

The current implementation of gdb_py_tp_name() leaks a reference to the
object returned by PyType_GetFullyQualifiedName() for Python >= 3.13, and
PyType_GetQualName() for Python >= 3.11.

Managing the strong reference on the returned PyObject* with a gdbpy_ref<>
fixes the reference count, but also causes the temporary object to be
deallocated on function exit. As a consequence, the 'const char *' returned
by PyUnicode_AsUTF8AndSize() becomes dangling and can no longer safely be
returned.

The proposed approach consists in changing gdb_py_tp_name() to return a
std::string, and forcing a copy of the 'const char *' value, statically
or dynamically allocated, stored in a temporary or non-temporary PyObject,
depending on the version of Python it was compiled with.
An unfortunate side effect of this fix is that every call sites where the
tp_name is printed, must now use `.c_str()' because PyErr_Format()
and its siblings cannot handle std::string.

Approved-By: Andrew Burgess <aburgess@redhat.com>
9 days agold: Drop pep-dll-{aarch64,x86_64}.c
Jon Turney [Fri, 22 May 2026 12:43:15 +0000 (13:43 +0100)] 
ld: Drop pep-dll-{aarch64,x86_64}.c

When configuring with
'--enable-targets=x86_64-w64-mingw32,aarch64-w64-mingw32', many
duplicate symbol errors are produced:

> /usr/lib/gcc/x86_64-pc-cygwin/16/../../../../x86_64-pc-cygwin/bin/ld: pep-dll-aarch64.o: in function `pep_dll_id_target':
> /wip/binutils-gdb/build/ld/../../ld/pe-dll.c:493: multiple definition of `pep_dll_id_target'; pep-dll.o:/wip/binutils-gdb/build/ld/../../ld/pe-dll.c:493: first defined here
> /usr/lib/gcc/x86_64-pc-cygwin/16/../../../../x86_64-pc-cygwin/bin/ld: pep-dll-aarch64.o: in function `pep_dll_add_excludes':
> /wip/binutils-gdb/build/ld/../../ld/pe-dll.c:586: multiple definition of `pep_dll_add_excludes'; pep-dll.o:/wip/binutils-gdb/build/ld/../../ld/pe-dll.c:586: first defined here
> /usr/lib/gcc/x86_64-pc-cygwin/16/../../../../x86_64-pc-cygwin/bin/ld: pep-dll-aarch64.o: in function `pep_find_data_imports':
> /wip/binutils-gdb/build/ld/../../ld/pe-dll.c:1444: multiple definition of `pep_find_data_imports'; pep-dll.o:/wip/binutils-gdb/build/ld/../../ld/pe-dll.c:1444: first defined here
> /usr/lib/gcc/x86_64-pc-cygwin/16/../../../../x86_64-pc-cygwin/bin/ld: pep-dll-aarch64.o: in function `pep_dll_generate_def_file':
> /wip/binutils-gdb/build/ld/../../ld/pe-dll.c:1877: multiple definition of `pep_dll_generate_def_file'; pep-dll.o:/wip/binutils-gdb/build/ld/../../ld/pe-dll.c:1877: first defined here
> /usr/lib/gcc/x86_64-pc-cygwin/16/../../../../x86_64-pc-cygwin/bin/ld: pep-dll-aarch64.o: in function `pep_create_import_fixup':
> etc.

On investigation, this is unsurprising, since we're compiling the same code twice. In
fact, configure.tgt has:

> arch64-*-pe* | aarch64-*-mingw*)
>                         targ_extra_ofiles="deffilep.o pep-dll-aarch64.o pe-dll.o pdb.o"
> x86_64-*-pe | x86_64-*-pep) targ_emul=i386pep ;
>                         targ_extra_ofiles="deffilep.o pdb.o pep-dll-x86_64.o pe-dll.o"
> x86_64-*-cygwin)        targ_emul=i386pep ;
>                         targ_extra_ofiles="deffilep.o pdb.o pep-dll.o pe-dll.o"
> x86_64-*-mingw*)        targ_emul=i386pep ;
>                         targ_extra_ofiles="deffilep.o pdb.o pep-dll.o pe-dll.o"

... so we're potentially including pep-dll.c compiled under three
different names!

I can't see anything in pe{,p}-dll.c which depends on the
COFF_WITH_peAArch64 or COFF_WITH_pex64 defines, so just remove all this.

(Neither pep-dll-aarch64.o or pep-dll-x86_64.o are listed in
ALL_EMUL_EXTRA_OFILES, so this multiple definition problem doesn't show
up when configured --enable-targets=all', but this seems like another
source of subtle bugs if those defines did do anything here...)

Cc'ed Evgeny (Hi!), because I think this crosses with not-yet-submitted
patches of his which do add some code conditional on COFF_WITH_peAArch64.

I imagine it's possible in code which *does* need to depend on the
output target to replace build time checks of COFF_WITH_pe{AArch64,x64}
with a runtime check of the output architecture (via
pe_details->pe_arch?).

Cc: Evgeny Karpov <evgeny.karpov@arm.com>
Fixes: c60b3806799a ("aarch64-pe support for LD, GAS and BFD")
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2026-05-29  Jon Turney  <jon.turney@dronecode.org.uk>

* Makefile.am (EXTRA_ld_new_SOURCES): Update.
* Makefile.in: Regenerate.
* configure.tgt (tar_extra_ofiles): Update.
* pep-dll-aarch64.c: Remove.
* pep-dll-x86_64.c: Remove.

9 days agogdb/frame: add FRAME_SCOPED_DEBUG_START_END
Andrew Burgess [Tue, 19 May 2026 15:21:58 +0000 (16:21 +0100)] 
gdb/frame: add FRAME_SCOPED_DEBUG_START_END

Add the FRAME_SCOPED_DEBUG_START_END macro, and make use of it in a
couple of places.

I find the frame debug output a little noisy, and it could be easier
to match up the entry/exit lines, by making use of
FRAME_SCOPED_DEBUG_START_END to print the frame level.

While I was adding the FRAME_SCOPED_DEBUG_START_END calls, there were
a couple of places where I also moved a variable declaration from the
top the a function into the function body.  And in another couple of
places there was some debug output that could be removed, where the
existing debug just printed the frame level (this is now handled by
the START/END macro).

There should be no user visible changes after this commit unless 'set
debug frame on' is used of course.

Approved-By: Tom Tromey <tom@tromey.com>
9 days agoLoongArch: Remove local hidden symbols testscase
zhaozhou [Mon, 25 May 2026 08:32:49 +0000 (16:32 +0800)] 
LoongArch: Remove local hidden symbols testscase

Remove the local symbol ldh definitions with hidden visibility from the
relax-call36-*.s tests.  The hidden visibility is meaningless for local
defined symbols and makes the test cases error.

9 days agold: enable elf32loongarch as extra target for elf64loongarch and vice versa
Xi Ruoyao [Thu, 14 May 2026 17:13:58 +0000 (01:13 +0800)] 
ld: enable elf32loongarch as extra target for elf64loongarch and vice versa

Allow people to build GCC with multilib support even without
--enable-targets=all in binutils configuration.

9 days agoAutomatic date update in version.in
GDB Administrator [Thu, 4 Jun 2026 00:00:07 +0000 (00:00 +0000)] 
Automatic date update in version.in

9 days agoelf_merge_st_other
Alan Modra [Wed, 3 Jun 2026 22:23:47 +0000 (07:53 +0930)] 
elf_merge_st_other

This fixes a potential problem with merging non-visibility bits in
st_other.  Non-visibilty bits in st_other have an architecture
dependent meaning, so they cannot just be copied from a foreign ELF
object file.  I think the safest thing to do in this situation is
ignore non-visibility st_other bits.  That's what this patch does.

PR 34062
* elflink.c (elf_merge_st_other): Replace abfd param with
obfd and ibfd parameters.  Do not call
elf_backend_merge_symbol_attribute when input xvec differs
from output xvec.
(_bfd_elf_merge_symbol, _bfd_elf_add_default_symbol),
(elf_link_add_object_symbols),
(_bfd_elf_copy_link_hash_symbol_type): Pass both output bfd
and input bfd to elf_merge_st_other.

9 days agoelflink.c: rename abfd and bed
Alan Modra [Wed, 3 Jun 2026 22:22:44 +0000 (07:52 +0930)] 
elflink.c: rename abfd and bed

This renames "abfd" function parameters to "obfd" when that parameter
is always the output bfd, and to "dynobj" when it is always the input
object used to attach dynamic sections.  "bed" variables which are set
to the output bfd or dynobj backend data are renamed to "obed".  (The
dynobj xvec must be the same as the output xvec, or bad things
happen.)  The idea is to make the use of bfd* parameter a little more
obvious when reading the source.

10 days agospu: .note.spu_name
Alan Modra [Tue, 2 Jun 2026 10:36:15 +0000 (20:06 +0930)] 
spu: .note.spu_name

This fixes a bug with the .note.spu_name section flags, which were
made SEC_LOAD without SEC_ALLOC.  That combination doesn't really make
sense and led to odd layout behaviour.  In addition .note.spu_name
now uses the normal note alignment, with some tweaks to keep its file
offset 16 byte aligned.  This tends to work better in the testsuite
when the standard scripts are not used and the note is merged with
other notes.

bfd/
* elf32-spu.c (spu_elf_create_sections): Remove SEC_LOAD from
.note.spu_name, and align to 4 bytes.
(spu_elf_fake_sections): Tweak .note.spu_name output section
alignment for layout.
(spu_elf_final_write_processing): New function.
(elf_backend_final_write_processing): Define.
binutils/
* testsuite/binutils-all/objcopy.exp (pr25662): Don't xfail spu.
ld/
* testsuite/ld-elf/orphan-region.d: Don't xfail spu.
* testsuite/ld-elf/pr23658-1e.d: Likewise.
* testsuite/ld-scripts/provide-8.d: Likewise.
* testsuite/ld-spu/ovl.d: Remove commented out old matches.
Adjust expected overlay file offset.
* testsuite/ld-spu/ovl2.d: Likewise.

10 days agogdb: handle missing arguments to 'maint test-remote-args'
Andrew Burgess [Tue, 2 Jun 2026 14:34:36 +0000 (15:34 +0100)] 
gdb: handle missing arguments to 'maint test-remote-args'

I noticed that the 'maint test-remote-args' command, implemented by
the test_remote_args_command function in remote.c, contains this code:

  static void
  test_remote_args_command (const char *args, int from_tty)
  {
    std::vector<std::string> split_args = gdb::remote_args::split (args);
    ... etc ...

The problem here is that gdb::remote_args::split expects a std::string,
and so ends up creating a std::string from ARGS.  However, ARGS can be
NULL, e.g. if a user does this:

  (gdb) maint test-remote-args

This ends up creating a std::string from a NULL pointer, which is
undefined behaviour.

Fix this by adding a check to test_remote_args_command, and throwing
an error if ARGS is NULL.  Add a new test to verify this case.

Additionally, fix a typo in the header comment for
test_remote_args_command.

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

11 days agold: run build-id test on more elf targets
Alan Modra [Tue, 2 Jun 2026 05:55:52 +0000 (15:25 +0930)] 
ld: run build-id test on more elf targets

11 days agoAutomatic date update in version.in
GDB Administrator [Tue, 2 Jun 2026 00:00:07 +0000 (00:00 +0000)] 
Automatic date update in version.in

11 days agogdb/aarch64: record/replay support for LRCPC3
Ezra Sitorus [Mon, 1 Jun 2026 22:36:46 +0000 (23:36 +0100)] 
gdb/aarch64: record/replay support for LRCPC3

FEAT_LRCPC3 introduces various load/store instructions with release
consistency for cases where ordering is required. This patch teaches GDB
to decode these instructions for recording and reversing.

The gdb.reverse/aarch64-lrcpc3.exp testcase verifies that the
instructions are recorded and correctly reversed. In particular, there
are some interesting cases to note:
* ldapur/stlur are SIMD instructions, but are not decoded in the simd
  function.
* There are writeback cases to cover too. These were taken from the
  binutils testcases: gas/testsuite/gas/aarch64/rcpc3.s.

The full testsuite was done on aarch64-none-linux-gnu without LRCPC3.
The gdb.arch and gdb.reverse tests were run on Shrinkwrap with LRCPC3
support.

Please note:
1) There is no support for LRCPC and LRCPC2 instructions
2) LRCPC3 is gated with +rcpc3 in GCC/binutils and LLVM.

Approved-by: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
11 days ago[gdb] Remove '/**<' comment marker
Tom de Vries [Mon, 1 Jun 2026 18:14:37 +0000 (20:14 +0200)] 
[gdb] Remove '/**<' comment marker

Another comment marker doxygen supports is "/**<".  Replace it with "/*".

Suggested-By: Kevin Buettner <kevinb@redhat.com>
Approved-By: Tom Tromey <tom@tromey.com>
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=34186

11 days ago[gdb] Remove \page marker
Tom de Vries [Mon, 1 Jun 2026 18:14:37 +0000 (20:14 +0200)] 
[gdb] Remove \page marker

Remove doxygen \page marker in gdb/gdbtypes.h.

Approved-By: Kevin Buettner <kevinb@redhat.com>
Approved-By: Tom Tromey <tom@tromey.com>
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=34186

11 days ago[gdb] Remove '/* *' multi-line comment marker
Tom de Vries [Mon, 1 Jun 2026 18:14:37 +0000 (20:14 +0200)] 
[gdb] Remove '/* *' multi-line comment marker

Doxygen supports a multi-line comment marker '/**'.  In GDB we're using
something slightly similar: '/* *' [1].

Drop this and just use '/*'.

Result of:
...
$ find gdb* -type f -name "*.[ch]" -o -name "*.def" \
    | egrep -v /testsuite/ \
    | xargs sed -i 's%/\* \* %/* %'
...
and manually reverting the change in the comment for BINOP_MUL in
gdb/std-operator.def.

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

Approved-By: Kevin Buettner <kevinb@redhat.com>
Approved-By: Tom Tromey <tom@tromey.com>
[1] https://sourceware.org/gdb/wiki/DoxygenForGDB

11 days ago[gdb/doc] Remove doxygen support
Tom de Vries [Mon, 1 Jun 2026 18:14:37 +0000 (20:14 +0200)] 
[gdb/doc] Remove doxygen support

We have some form of doxygen support, allowing to run "make doxy" in
build/gdb/doc, but in the result I didn't find any references to gdbsupport
(moved to top-level in 2019), so I'm assuming this is unmaintained for a long
time now.

Remove it.

Reviewed-by: Kevin Buettner <kevinb@redhat.com>
Approved-By: Tom Tromey <tom@tromey.com>
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=34186

11 days agoConvert dw2-const.exp to use the DWARF assembler
Tom Tromey [Fri, 22 May 2026 15:54:11 +0000 (09:54 -0600)] 
Convert dw2-const.exp to use the DWARF assembler

This patch converts dw2-const.exp to use the DWARF assembler rather
than a .S file.  The conversion was largely done using the script from
contrib.

Following a suggestion from Tom de Vries, this version sets addr_size
to 8.  This makes the test pass with -m32 as well.

Approved-By: Tom de Vries <tdevries@suse.de>
12 days ago[gdb/contrib] Add missing copyright notices
Tom de Vries [Mon, 1 Jun 2026 12:53:36 +0000 (14:53 +0200)] 
[gdb/contrib] Add missing copyright notices

I found a few files in gdb/contrib that were missing a copyright notice.

In codespell-ignore-words.txt, it was trivial to add, but I found a
codespell issue stating that it's not explicitly support, so I added a note
about that.

In codespell-dictionary.txt, I had to resort to a hack, using an "empty word"
rewrite rule:
...
-># Comment here.
...

Also, I found that empty lines are not allowed in codespell-dictionary.txt.  I
filed an issue about these two problems [1].

Since these two files were added in 2025, I've used 2025-2026 as copyright
years.

Tested by running "pre-commit run --all-files".

[1] https://github.com/codespell-project/codespell/issues/3901

12 days ago[pre-commit] Make gdb/doc codespell-clean
Tom de Vries [Mon, 1 Jun 2026 12:33:48 +0000 (14:33 +0200)] 
[pre-commit] Make gdb/doc codespell-clean

Fix typos in gdb/doc and replace "SME" with "sme" in
gdb/contrib/codespell-ignore-words.txt, and add "wither" and "stap".