]> git.ipfire.org Git - thirdparty/binutils-gdb.git/log
thirdparty/binutils-gdb.git
67 min agoAutomatic date update in version.in master
GDB Administrator [Fri, 30 Jan 2026 00:00:07 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 hours agoupdate gprofng doc/version.texi
Alan Modra [Thu, 29 Jan 2026 21:44:36 +0000 (08:14 +1030)] 
update gprofng doc/version.texi

3 hours agoregen gprof and gprofng configure
Alan Modra [Thu, 29 Jan 2026 21:06:37 +0000 (07:36 +1030)] 
regen gprof and gprofng configure

4 hours ago[gdb/python] Fix whitespace in py-ref.h
Tom de Vries [Thu, 29 Jan 2026 20:18:52 +0000 (21:18 +0100)] 
[gdb/python] Fix whitespace in py-ref.h

Fix a whitespace problem pre-commit complains about:
...
check-whitespace........................................................Failed
- hook id: check-whitespace
- exit code: 2

gdb/python/py-ref.h:58: indent with spaces.
+         "The __dict__ for this object.", nullptr },
...

5 hours agoRemove alloca from lookup_cmd
Tom Tromey [Thu, 22 Jan 2026 20:31:12 +0000 (13:31 -0700)] 
Remove alloca from lookup_cmd

lookup_cmd uses alloca to make a copy of a string, just for an error
message.  However, it's just as easy to use "%.*s" (already used once
in undef_cmd_error) and to pass in a string_view, avoiding the need
for an alloca and a copy.

Approved-By: Kevin Buettner <kevinb@redhat.com>
5 hours agoDon't make copies when calling find_cmd
Tom Tromey [Thu, 22 Jan 2026 20:19:13 +0000 (13:19 -0700)] 
Don't make copies when calling find_cmd

Currently both callers of find_cmd make a temporary string -- one with
std::string and one with the dreaded alloca.

However, as the previous change to find_cmd points out, these copies
are not needed.  Remove them and use a string_view instead.

Approved-By: Kevin Buettner <kevinb@redhat.com>
5 hours agoUse string_view in cli-decode.c:find_cmd
Tom Tromey [Thu, 22 Jan 2026 20:17:25 +0000 (13:17 -0700)] 
Use string_view in cli-decode.c:find_cmd

This changes cli-decode.c:find_cmd to use std::string_view.  I've made
this a separate patch to make the next patch more obvious.

Approved-By: Kevin Buettner <kevinb@redhat.com>
8 hours agogdb: make remaining Python extension objects inherit from PyObject
Matthieu Longo [Tue, 27 Jan 2026 12:33:42 +0000 (12:33 +0000)] 
gdb: make remaining Python extension objects inherit from PyObject

Previous patches made some Python extension objects ipublicly inherit
directly or indirectly from PyObject.
In the interest of consistency, this patch makes all remaining Python
extension objects still not inheriting from PyObject do so.

Approved-By: Tom Tromey <tom@tromey.com>
8 hours agogdb: cast all Python extension objects passed to gdbpy_ref_policy to PyObject*
Matthieu Longo [Sat, 25 Oct 2025 22:55:29 +0000 (23:55 +0100)] 
gdb: cast all Python extension objects passed to gdbpy_ref_policy to PyObject*

When enabling the Python limited API, pointers to Python C extension
objects can no longer be implicitly converted to 'PyObject *' by the
compiler.

gdbpy_ref_policy is a templated class that provides a generic interface
for incrementing and decrementing the reference counter on the given
object. It is used as a specialisation of the policy parameter in
gdb::ref_ptr, together with PyObject as the parameter type. As a result,
gdbpy_ref_policy always expects an argument derived from PyObject.

This patch fixes the resulting compilation issue by adding an explicit
static_cast to 'PyObject *' before passing the value to Py_INCREF and
Py_DECREF. As a side effect, these casts enforce, at compile time, that
the template type passed to gdbpy_ref_policy is a subclass of PyObject.
To provide a clearer diagnostic when an incorrect type is used, a
static_assert is added to gdbpy_ref_policy, avoiding obscure errors
originating from the static_cast. Finally, all C Python extension types
passed to gdbpy_ref_policy are updated to inherit from PyObject.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=23830
Approved-By: Tom Tromey <tom@tromey.com>
8 hours agogdb: new setters and getters for __dict__, and attributes
Matthieu Longo [Thu, 17 Jul 2025 17:36:41 +0000 (18:36 +0100)] 
gdb: new setters and getters for __dict__, and attributes

GDB is currently using the Python unlimited API. Migrating the codebase
to the Python limited API would have for benefit to make a GDB build
artifacts compatible with older and newer versions of Python that they
were built with.

This patch prepares the ground for migrating the existing C extension
types from static types to heap-allocated ones, by removing the
dependency on tp_dictoffset, which is unavailable when using the limited
API.

One of the most common incompatibilities in the current static type
declarations is the tp_dictoffset slot, which specifies the dictionary
offset within the instance structure. Historically, the unlimited
API has provided two approaches to supply a dictionary for __dict__:

 * A managed dictionary.
   Setting Py_TPFLAGS_MANAGED_DICT in tp_flags indicates that the
   instances of the type have a __dict__ attribute, and that the
   dictionary is managed by Python.
   According to the Python documentation, this is the recommended approach.
   However, this flag was introduced in 3.12, together with
   PyObject_VisitManagedDict() and PyObject_ClearManagedDict(), neither
   of which is part of the limited API (at least for now). As a result,
   this recommended approach is not viable in the context of the limited
   API.

 * An instance dictionary, for which the offset in the instance is
   provided via tp_dictoffset.
   According to the Python documentation, this "tp slot" is on the
   deprecation path, and Py_TPFLAGS_MANAGED_DICT should be used instead.
   Given the age of the GDB codebase and the requirement to support older
   Python versions (>= 3.4), no need to argue that today, the implementation
   of __dict__ relies on tp_dictoffset. However, in the context of the
   limited API, PyType_Slot does not provide a Py_tp_dictoffset member, so
   another approach is needed to provide __dict__ to instances of C extension
   types.

Given the constraints of the limited API, the proposed solution consists
in providing a dictionary through a common base class, gdbpy__dict__wrapper.
This helper class owns a dictionary member corresponding to __dict__, and
any C extension type requiring a __dict__ must inherit from it. Since
extension object must also be convertible to PyObject, this wrapper class
publicly inherits from PyObject as well.
Access to the dictionary is provided via a custom getter defined in a
PyGetSetDef, similarily to what was previously done with gdb_py_generic_dict().
Because __dict__ participates in attribute look-up, and since this dictionary
is neither managed by Python nor exposed via tp_dictoffset, custom
implementations of tp_getattro and tp_setattro are required to correctly
redirect attribute look-ups to the dictionary. These custom implementations
— equivalent to PyObject_GenericGetAttr() and PyObject_GenericSetAttr() —
must be installed via tp_getattro / tp_setattro for static types, or
Py_tp_getattro / Py_tp_setattro for heap-allocated types.

- gdbpy__dict__wrapper: a base class for C extension objects that own a
  __dict__.
- gdb_py_generic_dict_getter: a __dict__ getter for extension types
  derived from gdbpy__dict__wrapper.
- gdb_py_generic_getattro: equivalent of PyObject_GenericGetAttr, but
  fixes the look-up of __dict__.
- gdb_py_generic_setattro: equivalent of PyObject_GenericSetAttr, but
  fixes the look-up of __dict__.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=23830
Approved-By: Tom Tromey <tom@tromey.com>
8 hours agogdbpy_registry: cast C extension type object to PyObject * before Py_XINCREF
Matthieu Longo [Mon, 5 Jan 2026 11:14:28 +0000 (12:14 +0100)] 
gdbpy_registry: cast C extension type object to PyObject * before Py_XINCREF

When enabling the Python limited API, pointers to Python C extension
objects can no longer be implicitly converted to 'PyObject *' by the
compiler.

The lookup() method of gbdpy_registry returns a new reference to the
type object of the looked-up entry. It does so by calling Py_XINCREF()
to increment the reference counter of the returned type object. The
template parameter obj_type corresponds to the type of C extension
object type. With the Python limited API enabled, obj_type can no longer
be implicitly converted to 'PyObject *' when passed to Py_XINCREF().

This patch fixes the resulting compilation issue by adding an explicit
static_cast to 'PyObject *' before passing the value to Py_XINCREF().
As a side effect, this cast enforces, at compile time, that the template
type 'Storage::obj_type' passed to gdbpy_registry is a subclass of
PyObject. To provide a clearer diagnostic when an incorrect type is used,
a static_assert is added to gdbpy_registry, avoiding obscure errors
originating from the static_cast. Finally, the relevant C extension types
passed to gdbpy_registry are updated to inherit publicly from PyObject.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=23830
Approved-By: Tom Tromey <tom@tromey.com>
13 hours agoUpdate version now that the 2.46 branch has been created
Nick Clifton [Thu, 29 Jan 2026 11:31:16 +0000 (11:31 +0000)] 
Update version now that the 2.46 branch has been created

25 hours agoAutomatic date update in version.in
GDB Administrator [Thu, 29 Jan 2026 00:00:07 +0000 (00:00 +0000)] 
Automatic date update in version.in

27 hours agoPR 33852 Different objects for same input
Alan Modra [Wed, 28 Jan 2026 21:49:44 +0000 (08:19 +1030)] 
PR 33852 Different objects for same input

Testcase:
$ cat aff.s
 .quad x@ntpoff
$ gas/as-new -m64 aff.s -o t.o
with MALLOC_PERTURB_ this reliably shows uninitialised memory making
its way into the output.

R_390_TLS_LE64 howto was sized incorrectly, resulting in the
initialisation in s390_elf_cons zeroing only the first four bytes.

* elf64-s390.c (elf_howto_table <R_390_TLS_LE64>): Correct
size and bitsize.

39 hours agoPython limited API: migrate PyImport_ExtendInittab
Matthieu Longo [Tue, 6 Jan 2026 13:13:27 +0000 (13:13 +0000)] 
Python limited API: migrate PyImport_ExtendInittab

This patch replaces PyImport_ExtendInittab () with its limited C
API equivalent, PyImport_AppendInittab (), a convenience wrapper
around PyImport_ExtendInittab ().

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=23830
Approved-By: Tom Tromey <tom@tromey.com>
39 hours agoPython limited API: migrate Py_CompileStringExFlags and PyRun_SimpleString
Matthieu Longo [Tue, 6 Jan 2026 13:12:38 +0000 (13:12 +0000)] 
Python limited API: migrate Py_CompileStringExFlags and PyRun_SimpleString

This patch replaces Py_CompileStringExFlags () with its limited C API
equivalent, Py_CompileString (). The eval_python_command () helper is
now exposed through the private GDB Python API as a utility function.
PyRun_SimpleString () is replaced with eval_python_command () to avoid
code duplication.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=23830
Approved-By: Tom Tromey <tom@tromey.com>
40 hours agogas: segmentation fault in as_report_context
Alan Modra [Wed, 28 Jan 2026 07:38:09 +0000 (18:08 +1030)] 
gas: segmentation fault in as_report_context

After input_scrub_end when next_saved_file is NULL, it is possible
that macro_nest will be non-zero on files with errors.  If
output_file_close then has an error and reports it with as_fatal we
hit the segfault.

PR 33746
* input_scrub.c (as_report_context): Don't assume
next_saved_file is non-NULL.
(as_where): Likewise.

47 hours agoPR 33718 objcopy and strip of Solaris binaries
H.J. Lu [Sat, 27 Dec 2025 01:00:08 +0000 (09:00 +0800)] 
PR 33718 objcopy and strip of Solaris binaries

non-SHF_ALLOC SHT_SUNW_symsort and SHT_SUNW_symnsort sections aren't
removed when all symbols are removed.  Fix that.

PR 33718
PR 33684
* objcopy.c (is_strip_section_1): Handle SHT_SUNW_symsort and
SHT_SUNW_symnsort sections.

2 days agoAutomatic date update in version.in
GDB Administrator [Wed, 28 Jan 2026 00:00:08 +0000 (00:00 +0000)] 
Automatic date update in version.in

2 days agoregen pot files
Alan Modra [Tue, 27 Jan 2026 23:43:02 +0000 (10:13 +1030)] 
regen pot files

2 days agoRe: PR 33840 typo in elfnn-loongarch.c
Alan Modra [Tue, 27 Jan 2026 23:18:41 +0000 (09:48 +1030)] 
Re: PR 33840 typo in elfnn-loongarch.c

The second string with the typo was unused (and had unescaped %).
Remove it.

2 days agoPR 33840 typo in elfnn-loongarch.c
Alan Modra [Tue, 27 Jan 2026 22:53:21 +0000 (09:23 +1030)] 
PR 33840 typo in elfnn-loongarch.c

s/marching/matching/

2 days agold: testsuite: Simplify emulation check in libgot tests
Rainer Orth [Tue, 27 Jan 2026 17:26:59 +0000 (18:26 +0100)] 
ld: testsuite: Simplify emulation check in libgot tests

The x86 libgot-1 tests are the only ones in all testsuites that use a
new ld -V -m<emul under test> idiom to check whether to run the tests.

Rather than open-coding the check everywhere while relying on that
idiom, this patch introduces a new proc to directly check the ld -V
output for the emulation in question.

Tested on {x86_64,i686}-pc-linux-gnu and {amd64,i386}-pc-solaris2.11.

2026-01-24  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

ld:
* testsuite/lib/ld-lib.exp (ld_supports_emul): New proc.
* testsuite/ld-i386/binutils.exp: Use it.
* testsuite/ld-x86-64/binutils.exp: Likewise.

2 days agogdb/python: use gdbpy_is_value_object in more places
oltolm [Sat, 24 Jan 2026 12:23:49 +0000 (13:23 +0100)] 
gdb/python: use gdbpy_is_value_object in more places

Make more use of gdbpy_is_value_object in python/py-value.c

Approved-By: Andrew Burgess <aburgess@redhat.com>
2 days ago[bfd] Fix data race in bfd_check_format_matches
Tom de Vries [Tue, 27 Jan 2026 09:40:06 +0000 (10:40 +0100)] 
[bfd] Fix data race in bfd_check_format_matches

At the start of bfd_check_format_matches, we have this read of_bfd_section_id:
...
  unsigned int initial_section_id = _bfd_section_id;
...

In order to access the variable, it is required to hold the global BFD lock.

The function already contains code acquiring the lock:
...
  /* Locking is required here in order to manage _bfd_section_id.  */
  if (!bfd_lock ())
    {
      bfd_cache_set_uncloseable (abfd, old_in_format_matches, NULL);
      free (matching_vector);
      return false;
    }
...
so fix this by moving the read after it.

Tested on x86_64-linux.

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

2 days agoUpdate release readme
Nick Clifton [Tue, 27 Jan 2026 08:04:49 +0000 (08:04 +0000)] 
Update release readme

2 days agosanity check score reloc functions
Alan Modra [Tue, 27 Jan 2026 05:00:14 +0000 (15:30 +1030)] 
sanity check score reloc functions

Some of these already did some sanity checking, but
bfd_reloc_offset_in_range is better since it takes into account the
relocation field size too.

       * elf32-score.c (score_elf_hi16_reloc, score_elf_lo16_reloc),
       (score_elf_gprel15_with_gp, gprel32_with_gp),
       (score_elf_got_lo16_reloc): Use bfd_reloc_offset_in_range to
       sanity check reloc addresses.
       * elf32-score7.c (score_elf_hi16_reloc, score_elf_lo16_reloc),
       (score_elf_gprel15_with_gp, gprel32_with_gp),
       (score_elf_got_lo16_reloc): Likewise.

3 days agogdb/testsuite: remove guile "test byte at sp, before flush" test
Simon Marchi [Thu, 8 Jan 2026 19:51:54 +0000 (14:51 -0500)] 
gdb/testsuite: remove guile "test byte at sp, before flush" test

When I run:

    $ while make check TESTS="gdb.guile/scm-ports.exp" RUNTESTFLAGS="--target_board=native-extended-gdbserver"; do done

I eventually get:

    FAIL: gdb.guile/scm-ports.exp: buffered=1: test byte at sp, before flush

I don't know why I only see this (or see this more often) with the
native-extended-gdbserver board, I guess because it changes the timing
of things.  Also, this is with a debug/ASan/UBSan build of GDB, if that
matters.  This is with guile 3.0.

This is what the test attempts to do:

 1. create a rw memory port that is supposed to be buffered
 2. write the byte at $sp with a new value, expecting that byte to only
    be in the port's buffer
 3. read the memory at $sp (using parse-and-eval, bypassing the rw
    memory port), expecting to see the old byte value
 4. flush the memory port, expecting that to write to new byte value at
    $sp
 5. read the memory at $sp (using parse-and-eval again), expecting to
    see the new value

It is step 3 that fails.  My hypothesis is that even if the memory port
we write to is buffered, the write to the underlying memory can happen
before the "before flush" test happens.  The Guile Buffering doc [1]
says this:

    If you write data to a buffered port, it probably doesn’t go out to
    the mutable store directly. (This “probably” introduces some
    indeterminism in your program: what goes to the store, and when,
    depends on how full the buffer is. It is something that the user
    needs to explicitly be aware of.) The data is written to the store
    later – when the buffer fills up due to another write, or when
    force-output is called, or when close-port is called, or when the
    program exits, or even when the garbage collector runs.

Because of the mention of the garbage collector, I tried putting some
calls to gc-disable and gc-enable around that area, but it doesn't fix
it.

Given that the flushing behavior of the buffered port seems
non-deterministic, I think that the buffering behavior can't easily be
tested.  I propose to get rid of that specific aspect of the test.

As suggested by Tom de Vries, replace the "test byte at sp, before
flush" test with a "test byte at sp, before write" one.  I think this is
useful as a sanity check to help prove that the memory write did in fact
change the state of the program.

Change-Id: I2f0afd7b2ebb7738e675f58397677f2f9a4e06bb
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29825
Reviewed-By: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
3 days agoAutomatic date update in version.in
GDB Administrator [Tue, 27 Jan 2026 00:00:07 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 days agogdbserver: Add aarch64-windows support
Hannes Domani [Mon, 26 Jan 2026 18:34:16 +0000 (19:34 +0100)] 
gdbserver: Add aarch64-windows support

Approved-By: Tom Tromey <tom@tromey.com>
3 days agogdbserver: Move software breakpoint recognition code into win32-i386-low.cc
Hannes Domani [Mon, 26 Jan 2026 18:34:16 +0000 (19:34 +0100)] 
gdbserver: Move software breakpoint recognition code into win32-i386-low.cc

Approved-By: Tom Tromey <tom@tromey.com>
3 days agogdbserver: Move setting of process_info::tdesc into win32-i386-low.cc
Hannes Domani [Mon, 26 Jan 2026 18:34:16 +0000 (19:34 +0100)] 
gdbserver: Move setting of process_info::tdesc into win32-i386-low.cc

It's arch-specific, and since now win32_tdesc and wow64_win32_tdesc are
only used in this file, they are made static.

Approved-By: Tom Tromey <tom@tromey.com>
3 days agogdbserver: Update win32_target_ops to new stopped_data_addresses interface
Hannes Domani [Mon, 26 Jan 2026 18:34:16 +0000 (19:34 +0100)] 
gdbserver: Update win32_target_ops to new stopped_data_addresses interface

It will be used by the aarch64 port.

Approved-By: Tom Tromey <tom@tromey.com>
3 days agoMinor cleanups in expanded-symbol.[ch]
Tom Tromey [Mon, 26 Jan 2026 17:54:08 +0000 (10:54 -0700)] 
Minor cleanups in expanded-symbol.[ch]

I found a typo in expanded-symbol.h, then noticed some formatting
mistakes and some other incorrect comments.  This patch fixes all
these and removes some 'struct' keywords as well.

I'm checking this in as obvious.

3 days ago[gdb/testsuite] Fix gdb.dap/ada-non-ascii.exp for gcc < 10
Tom de Vries [Mon, 26 Jan 2026 14:36:26 +0000 (15:36 +0100)] 
[gdb/testsuite] Fix gdb.dap/ada-non-ascii.exp for gcc < 10

On openSUSE Leap 15.6, test-case gdb.dap/ada-non-ascii.exp passes with
gcc 10-12.

But with gcc 7-9 I see:
...
{"request_seq": 6, "type": "response", "command": "scopes", "success": true,
"body": {"scopes": [{"variablesReference": 1, "name": "Locals",
"presentationHint": "locals", "expensive": false, "namedVariables": 1,
"line": 22, "source": {"name": "prog.adb", "path":
"/data/vries/gdb/binutils-gdb.git/gdb/testsuite/gdb.dap/ada-non-ascii/prog.adb"}},
{"variablesReference": 2, "name": "Registers", "presentationHint": "registers",
"expensive": false, "namedVariables": 61, "line": 22, "source": {"name":
"prog.adb", "path":
"/data/vries/gdb/binutils-gdb.git/gdb/testsuite/gdb.dap/ada-non-ascii/prog.adb"}}]},
"seq": 18}
PASS: gdb.dap/ada-non-ascii.exp: get scopes success
PASS: gdb.dap/ada-non-ascii.exp: local scope
PASS: gdb.dap/ada-non-ascii.exp: register scope
FAIL: gdb.dap/ada-non-ascii.exp: correct number of locals
...

This is not dap-specific, also with the CLI I see:
...
$ gdb -q -batch prog -ex "break prog.adb:22" -ex run -ex "info locals"
  ...
<W03a0> = 3
...
vs.:
...
<W03a0> = 3
<W03a6> = 7
...

This corresponds to the debug info, for gcc 9 we have:
...
 <1><1866>: Abbrev Number: 3 (DW_TAG_subprogram)
    <1867>   DW_AT_name        : prog
 <2><1888>: Abbrev Number: 4 (DW_TAG_variable)
    <1889>   DW_AT_name        : W03a0
    <1894>   DW_AT_location    : 2 byte block: 91 6c    (DW_OP_fbreg: -20)
...
and for gcc 10 we have instead:
...
 <1><187d>: Abbrev Number: 3 (DW_TAG_subprogram)
    <187e>   DW_AT_name        : prog
 <2><189f>: Abbrev Number: 4 (DW_TAG_variable)
    <18a0>   DW_AT_name        : W03a0
    <18ab>   DW_AT_location    : 2 byte block: 91 6c    (DW_OP_fbreg: -20)
 <2><18ae>: Abbrev Number: 5 (DW_TAG_constant)
    <18af>   DW_AT_name        : W03a6
    <18ba>   DW_AT_const_value : 7
...

Fix this by allowing 1 local variable for gcc < 10.

Tested on x86_64-linux.

Approved-By: Tom Tromey <tom@tromey.com>
3 days agogdb: add noexcept to relevant methods of class ref_ptr
Matthieu Longo [Thu, 23 Oct 2025 16:20:50 +0000 (17:20 +0100)] 
gdb: add noexcept to relevant methods of class ref_ptr

This patch aims at improving code readability and maintainability
by adding the 'noexcept' attribute to some constructors and
methods of class 'ref_ptr' to make clear that no exception is
supposed to be raised from them.
As an additional benefit, the compiler doesn't need to generate
the stack unwinding code for those constructors and methods.

Approved-By: Tom Tromey <tom@tromey.com>
3 days agoobj_attr_v2_record: simplify logic when an attribute already exists
Matthieu Longo [Fri, 23 Jan 2026 15:38:57 +0000 (15:38 +0000)] 
obj_attr_v2_record: simplify logic when an attribute already exists

Suggested-By: Jan Beulich <jbeulich@suse.com>
Approved-By: Jan Beulich <jbeulich@suse.com>
3 days agobfd/ELF: fix BFD library build --enable-shared
Matthieu Longo [Thu, 22 Jan 2026 18:53:34 +0000 (18:53 +0000)] 
bfd/ELF: fix BFD library build --enable-shared

The patch series that added support for Object Attributes v2 introduced
regressions when building the BFD library as a shared object.

Incorrect usages of ATTRIBUTE_HIDDEN caused the following link-time errors:

/usr/bin/ld: config/obj-elf-attr.o: in function `obj_attr_v2_record':
obj-elf-attr.c: undefined reference to `bfd_elf_obj_attr_v2_init'
obj-elf-attr.c: undefined reference to `_bfd_obj_attr_v2_find_by_tag'
obj-elf-attr.c: undefined reference to `obj_attr_v2_t_append'
/usr/bin/ld: config/obj-elf-attr.o: in function `obj_attr_v2_subsection_record':
obj-elf-attr.c: undefined reference to `obj_attr_subsection_v2_t_append'
obj-elf-attr.c: undefined reference to `obj_attr_subsection_v2_t_remove'
obj-elf-attr.c: undefined reference to `obj_attr_subsection_v2_t_append'

This patch fixes the symbols visibility so that the BFD library links
correctly when built with --enable-shared.
The ATTRIBUTE_HIDDEN annotations were removed from bfd_elf_obj_attr_v2_init
and _bfd_obj_attr_v2_find_by_tag, and _bfd_obj_attr_v2_find_by_tag was renamed
to reflect the belonging to the public BFD API using the 'bfd_' prefix. The
doubly linked list helpers remain hidden and are instead exposed through wrapper
functions.

3 days agobinutils: xfail "gnu-debuglink (objdump 1)" on Solaris/amd64 [PR33243,PR33389]
Rainer Orth [Mon, 26 Jan 2026 09:12:04 +0000 (10:12 +0100)] 
binutils: xfail "gnu-debuglink (objdump 1)" on Solaris/amd64 [PR33243,PR33389]

As reported in PR binutils/33243, one test FAILs on Solaris/amd64:

FAIL: gnu-debuglink (objdump 1)

30c30,32
<   400660:     ff 35 b2 15 00 00 ff 25 b4 15 00 00 0f 1f 40 00     .5.....%......@.
---
>   400660:     ff 35 b2 15 00 00       push   0x15b2(%rip)        # 401c18 <_GLOBAL_OFFSET_TABLE_+0x8>
>   400666:     ff 25 b4 15 00 00       jmp    *0x15b4(%rip)        # 401c20 <_GLOBAL_OFFSET_TABLE_+0x10>
>   40066c:     0f 1f 40 00             nopl   0x0(%rax)

This is another instance of PR binutils/33389, so this patch xfail's the
test.

Tested on {amd64,i386}-pc-solaris2.11 and {x86_64,i686}-pc-linux-gnu.

2026-01-25  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

binutils:
PR binutils/33243
PR binutils/33389
* testsuite/binutils-all/compress.exp (test_gnu_debuglink): xfail
on Solaris/amd64.

3 days agoregen pot files
Alan Modra [Mon, 26 Jan 2026 05:40:39 +0000 (16:10 +1030)] 
regen pot files

3 days agoPR 33838 Truncated translation in objcopy.c
Alan Modra [Mon, 26 Jan 2026 03:53:29 +0000 (14:23 +1030)] 
PR 33838 Truncated translation in objcopy.c

The only macros allowed are the ones specially handled by gettext,
such as PRId64.

* objcopy.c (copy_usage): Don't use string literal
concatenation of macros in translated strings.

Patch from Andreas Schwab <schwab@linux-m68k.org>

3 days agoPR 33835 readelf incorrect handling of DWARF5 CU DIE addr_base attribute
Than McIntosh [Sun, 25 Jan 2026 14:19:10 +0000 (14:19 +0000)] 
PR 33835 readelf incorrect handling of DWARF5 CU DIE addr_base attribute

Users of "readelf" report problems running the tool's DWARF dump flag
on binaries built with the most recent version of the Go compiler (1.25),
Go bug report here https://github.com/golang/go/issues/77246

dwarf.c (skip_attribute <DW_FORM_string>): Skip terminating NUL too.

4 days agoAutomatic date update in version.in
GDB Administrator [Mon, 26 Jan 2026 00:00:08 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 days agoHard-coded plural in readelf.c
Alan Modra [Sun, 25 Jan 2026 22:02:35 +0000 (08:32 +1030)] 
Hard-coded plural in readelf.c

PR 33837
* readelf.c (process_got_section_contents): Use ngettext.

4 days agoregen gprofng config
Alan Modra [Sun, 25 Jan 2026 21:17:47 +0000 (07:47 +1030)] 
regen gprofng config

4 days agohppa64: Skip/xfail three ld tests on hppa*64*-*-*
John David Anglin [Sun, 25 Jan 2026 14:51:50 +0000 (09:51 -0500)] 
hppa64: Skip/xfail three ld tests on hppa*64*-*-*

The ver_def test fails because of the __text_seg and __data_seg
symbols in the dynamic symbol table.

The sec64k tests creates too many sections and fails.

The linux target doesn't currently have .data.rel.ro and fails the
regexp test for pr20995.

2026-01-24  John David Anglin  <danglin@gcc.gnu.org>

ld/testsuite/ChangeLog:

* ld-elf/readelf.exp: Skip ver_def on hppa*64*-*-*.
* ld-elf/sec64k.exp: Likewise.
* ld-elf/shared.exp: xfail pr20995 on all OSes.

4 days agoRegenerate autogenerated files
Nick Clifton [Sun, 25 Jan 2026 10:28:05 +0000 (10:28 +0000)] 
Regenerate autogenerated files

4 days agoAdd 2.46 release markers to NEWS files. Update BRANCHES. Update README.
Nick Clifton [Sun, 25 Jan 2026 08:47:26 +0000 (08:47 +0000)] 
Add 2.46 release markers to NEWS files.  Update BRANCHES.  Update README.

4 days agold: sframe: do not generate .sframe for PLT if no .sframe is in input BFDs
Indu Bhagat [Thu, 22 Jan 2026 08:00:36 +0000 (10:00 +0200)] 
ld: sframe: do not generate .sframe for PLT if no .sframe is in input BFDs

GNU ld creates SFrame stack trace info for the PLT. For x86 the linker-
created .sframe section is created in setup_gnu_properties.  For s390 it
is created in create_dynamic_sections.  For both, the section data is
itself emitted a bit later in late_size_sections.  Note that for aarch64 the
linker does not create .sframe for PLT yet.

Recall that a previous patch 832ca9ef670 uncoupled
--no-ld-generated-unwind-info from the linker-generated .sframe
sections.  This means that the linker now generates .sframe section (for
.plt*) for the first input BFD enthusiatically even when none of the
input BFDs have any .sframe section, unless --discard-sframe is also
added.  The issue is that these (unexpected) linker-generated .sframe
sections (on x86_64, and s390) may now trip the linking process, e.g.,
when using --orphan-handling=error together with a linker script that
treats .sframe differently than the default linker script.
https://sourceware.org/pipermail/binutils/2026-January/147826.html

Further, with SFrame sections to be soon marked KEEP for fixing
GC/SFrame (PR ld/32769), the presence of these linker generated SFrame
sections will also cause emission of an empty .sframe (for x86_64 and
s390x), even when all input bfd's have no .sframe section.

This patch avoids creation of .sframe for .plt* if none of the input
BFDs had any .sframe section.  This then avoids creation of empty
.sframe in linked objects on x86_64 and s390x, when none of the inputs
have SFrame sections.  This also fixes PR ld/33830.

For the code changes:
Reviewed-by: Jens Remus <jremus@linux.ibm.com>
New testcases have (since the above Reviewed-by) been added.  Since
--no-ld-generated-unwind-info is not supported on aarch64, add
target-specific ld tests.  Additionally add a generic test (for all
targets that support SFrame) to ensure no output .sframe is generated if
users says no --gsframe or similar.

bfd/
PR ld/33830
* elf-bfd.h (_bfd_elf_sframe_present_input_bfds): New
declaration.
* elf-sframe.c (_bfd_elf_sframe_present_input_bfds): New
definition.
* elf64-s390.c (elf_s390_create_dynamic_sections): Do not
generate .sframe for .plt unconditionally.
* elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties):
Likewise.
ld/testsuite/
PR ld/33830
* ld-s390/no-sframe.ld: Linker script with no specification for
SFrame sections.
* ld-s390/s390.exp: Add new test.
* ld-s390/sframe-command-line-2.d: New testcase that uses
--no-ld-generated-unwind-info and a linker script that has no
specific rules for .sframe.
* ld-x86-64/no-sframe.ld: Likewise for x86_64.
* ld-x86-64/sframe-command-line-2.d: Likewise for x86_64.
* ld-x86-64/x86-64.exp: Add new test.
* ld-sframe/no-ld-generated-sframe.d: Ensure no .sframe in
output if no .sframe in input.
* ld-sframe/no-sframe.ld: Linker script with no specification
for SFrame sections.
* ld-sframe/test.s: Add new test.

4 days agogas: aarch64: i386: s390: sframe: adjust sframe_ra_tracking_p
Indu Bhagat [Sun, 25 Jan 2026 03:11:59 +0000 (19:11 -0800)] 
gas: aarch64: i386: s390: sframe: adjust sframe_ra_tracking_p

Like the previous commit b600229503 which adjusted the implementation of
flex fde hook, make a similar change for sframe_ra_tracking_p.

Simply providing the definition to use boolean value direcly is
sufficient for the purpose, and helps generate better code.

gas/
* config/tc-aarch64.c (aarch64_sframe_ra_tracking_p): Remove.
* config/tc-aarch64.h (aarch64_sframe_ra_tracking_p): Remove.
(sframe_ra_tracking_p): Set to true.
* config/tc-i386.c (x86_sframe_ra_tracking_p): Remove.
* config/tc-i386.h (x86_sframe_ra_tracking_p): Remove.
(sframe_ra_tracking_p): Set to false.
* config/tc-s390.c (s390_sframe_ra_tracking_p): Remove.
* config/tc-s390.h (s390_sframe_ra_tracking_p): Remove.
(sframe_ra_tracking_p): Set to true.

5 days agoAutomatic date update in version.in
GDB Administrator [Sun, 25 Jan 2026 00:00:07 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 days agohppa64: Fix Linux link
John David Anglin [Sat, 24 Jan 2026 20:44:13 +0000 (15:44 -0500)] 
hppa64: Fix Linux link

The "BFD_ASSERT (r_symndx != STN_UNDEF)" assert is incorrect and
triggers linking Linux kernel.

2026-01-24  John David Anglin  <danglin@gcc.gnu.org>

bfd/ChangeLog:

* elf64-hppa.c (elf64_hppa_relocate_section): Remove asserts.

5 days agogas/NEWS: Add AArch64 updates
Alice Carlotti [Sat, 24 Jan 2026 03:19:49 +0000 (03:19 +0000)] 
gas/NEWS: Add AArch64 updates

5 days agoaarch64: Tidy architecture extensions documentation
Alice Carlotti [Sat, 24 Jan 2026 02:45:39 +0000 (02:45 +0000)] 
aarch64: Tidy architecture extensions documentation

Document mops_go, add some missing full stops, and fix alphabetization
mistakes.

5 days agoaarch64: Fix sme2p3 and f16f32dot feature dependencies
Alice Carlotti [Sat, 24 Jan 2026 02:42:16 +0000 (02:42 +0000)] 
aarch64: Fix sme2p3 and f16f32dot feature dependencies

These are changed to match the dependencies we agreed with LLVM.

5 days agoaarch64: Add -march=armv9.7-a option
Alice Carlotti [Sat, 24 Jan 2026 02:51:56 +0000 (02:51 +0000)] 
aarch64: Add -march=armv9.7-a option

5 days agoaarch64: Fix documentation of armv9.6-a dependencies
Alice Carlotti [Sat, 24 Jan 2026 02:49:22 +0000 (02:49 +0000)] 
aarch64: Fix documentation of armv9.6-a dependencies

The sve2p2 and fprcvt extensions were removed from -march=armv9.6-a, but
we forgot to update the documentation at the same time.

5 days agoaarch64: Remove redundant macros
Alice Carlotti [Sat, 24 Jan 2026 01:39:15 +0000 (01:39 +0000)] 
aarch64: Remove redundant macros

We no longer encode flags in the aarch64_hint_options value field, so
delete the HINT_VAL, HINT_FLAG and HINT_ENCODE macros.

5 days agoaarch64: Add support for TLBID system registers
Srinath Parvathaneni [Fri, 23 Jan 2026 22:25:30 +0000 (22:25 +0000)] 
aarch64: Add support for TLBID system registers

This patch adds support for following TLBID system registers.

* tlbididr_el1 (RO)
* vtlbid0_el2
* vtlbid1_el2
* vtlbid2_el2
* vtlbid3_el2
* vtlbidos0_el2
* vtlbidos1_el2
* vtlbidos2_el2
* vtlbidos3_el2

5 days agoaarch64: TLBI Domains changes for PLBI instruction
Srinath Parvathaneni [Fri, 23 Jan 2026 22:25:29 +0000 (22:25 +0000)] 
aarch64: TLBI Domains changes for PLBI instruction

For the PLBI instruction with optional register argument
<Rt> == 0b1111, with FEAT_TLBID enabled they are permitted to
have an Rt value which is not 0b11111 and this is allowed for
all the TLBI instructions with a <type> of ALLE1*, ALLE2* and
VMALL* and a <shareability> of IS or OS.

5 days agoaarch64: Enable TLBIP instructions with tlbid option
Srinath Parvathaneni [Fri, 23 Jan 2026 22:25:28 +0000 (22:25 +0000)] 
aarch64: Enable TLBIP instructions with tlbid option

TLBI Domains feature changes TLBI and TLBIP system instructions.
For all TLBIP *E1IS*, TLBIP *E1OS*, TLBIP *E2IS* and TLBIP *E2OS*
instructions that are currently dependent on FEAT_D128 (+d128),
will also be available with FEAT_TLBID (+tlbid).

5 days agoaarch64: Add support for FEAT_TLBID feature
Srinath Parvathaneni [Fri, 23 Jan 2026 22:25:27 +0000 (22:25 +0000)] 
aarch64: Add support for FEAT_TLBID feature

TLBI Domains feature changes TLBI and TLBIP system instructions.
For the TLBI instruction with optional register argument
<Rt> == 0b1111, with FEAT_TLBID enabled they are permitted to
have an Rt value which is not 0b11111 and this is allowed for
all the TLBI instructions with a <type> of ALLE1*, ALLE2*,
VMALL*, VMALLS12* or VMALLWS2* and a <shareability> of IS or OS.

This patch add support for FEAT_TLBID feature, which is enabled
by new +tlbid option.

5 days agold: testsuite: Relax libgot-1-i386 test for Solaris [PR33350]
Rainer Orth [Sat, 24 Jan 2026 07:08:48 +0000 (08:08 +0100)] 
ld: testsuite: Relax libgot-1-i386 test for Solaris [PR33350]

When running the ld testsuite with -melf_i386_sol2 instead of -melf_i386
on Solaris, one test regresses:

FAIL: Build libgot-1-i386.so

The issue is that one line in the --got-contents output differs
unexpectedly:

 Global Offset Table '.got.plt' contains 4 entries:
    Index:  Address      Reloc             Sym. Name + Addend/Value
-       0: 00200200                        20016c
-       1: 00200204                        0
-       2: 00200208                        0
-       3: 0020020c R_386_JUMP_SLOT        bar + 156
+       0: 00200270                        2001dc
+       1: 00200274                        0
+       2: 00200278                        0
+       3: 0020027c R_386_JUMP_SLOT        bar + 1c6

While ld-i386/libgot-1.rd already allows for differences in the
addresses, the addend is assumed to be fixed.  However, this is not the
case with -melf_i386_sol2.  The difference is that .hash, .dynsym, and
.symtab have additional entries as required by the Solaris ABI:

* In .dynsym and .symtab, _DYNAMIC, _GLOBAL_OFFSET_TABLE_, and
  _PROCEDURE_LINKAGE_TABLE_ are added.

* .symtab also gains _END_ and _START_.

This explains the differences in addresses and addends, but they are
completely benign.

This patch thus allows for arbitrary addends.

Tested on {i386,amd64}-pc-solaris2.11 with both -melf_i386_sol2 and
-melf_i386, and {i686,x86_64}-pc-linux-gnu.

2026-01-23  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

ld:
PR ld/33350
* testsuite/ld-i386/libgot-1.rd: Allow for different
R_386_JUMP_SLOT addends.

5 days agold: testsuite: Skip pr33577 tests with GNU extensions on Solaris [PR33577]
Rainer Orth [Sat, 24 Jan 2026 07:02:14 +0000 (08:02 +0100)] 
ld: testsuite: Skip pr33577 tests with GNU extensions on Solaris [PR33577]

Several of the ld-elfvers pr33577 tests FAIL on Solaris, for either or
both of two reasons:

* Tests using ld --hash-style=gnu cannot work on Solaris:
  .gnu.hash/SHT_GNU_HASH sections are a GNU extension not supported by
  Solaris ld.so.1.

* Similarly, binding different implementations of the same symbol to
  different symbol versions is a GNU extension that wasn't in the
  original Solaris specification of symbol versioning.  ld.so.1 doesn't
  support it and never will.

  This can be seen in the elfdump output for the .dynsym section:

Symbol Table Section:  .dynsym
  index     value size  type bind oth ver shndx         name

    [8]     0x630  0xd  FUNC GLOB  D   1H .text         foo
   [10]     0x620  0x6  FUNC GLOB  D    2 .text         foo

  foo is bound to both version 1 (the Base version) and version 2 (VERS_1
  from pr33577.map).

  Same for .symtab:

Symbol Table Section:  .symtab
  index    value size  type bind oth ver shndx       name

   [28]     0x620  0x6  FUNC GLOB  D    0 .text         foo
   [35]     0x630  0xd  FUNC GLOB  D    0 .text         foo@

  As I said, ld.so.1 doesn't support <symbol>@<version> (in this case the
  Base version) at all.

Therefore the tests that employ those extensions are guarded with
supports_gnu_osabi.

Tested on sparc{,v9}-sun-solaris2.11, sparc{,64}-unknown-linux-gnu,
{i386,amd64}-pc-solaris2.11, and {x86_64,i686}-pc-linux-gnu.

2026-01-23  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

ld:
PR ld/33577
* testsuite/ld-elfvers/vers.exp (base_symbol_test): Only run
pr33577a with libpr33577-versioned.so test on ELFOSABI_GNU
systems.
Likewise for run base_symbol_tests with --hash-style=gnu.

5 days agold: Make separate clauses where a label was before a declaration
Hans-Peter Nilsson [Sat, 24 Jan 2026 03:53:41 +0000 (04:53 +0100)] 
ld: Make separate clauses where a label was before a declaration

The default behavior of gcc changed from gcc-11.  With gcc-10 and
earlier versions, you got:

In file included from ../bfd/bfd.h:45,
                 from /src/ld/ldmisc.c:23:
/src/ld/ldmisc.c: In function 'vfinfo':
/src/ld/ldmisc.c:186:8: error: a label can only be part of a statement and a declaration is not a statement
  186 |        bool ll_type = false;
      |        ^~~~
/src/ld/ldmisc.c:581:8: error: a label can only be part of a statement and a declaration is not a statement
  581 |        bool ll_type = false;
      |        ^~~~
make[4]: *** [Makefile:1606: ldmisc.o] Error 1

Since gcc-10 matches the binutils/README requirement ("a C99 compliant
compiler and library") and as binutils policy is to adjust code to
handle earlier gcc versions, an obvious fix is to make a compound
statement for the code after the case-label.

ld:

* ldmisc.c (vfinfo) <case 'l' - two cases>: Make separate
compound statements where case-labels were part of a declaration.

5 days agoelf: Set has_local_dynsyms for forced local symbol
H.J. Lu [Thu, 15 Jan 2026 01:11:50 +0000 (09:11 +0800)] 
elf: Set has_local_dynsyms for forced local symbol

bfd_elf_link_record_dynamic_symbol may be called by mips backend after
a global symbol has been forced to local.  Set has_local_dynsyms to true
in this case.

bfd/

PR ld/33793
* elflink.c (bfd_elf_link_record_dynamic_symbol): Set
has_local_dynsyms to true for forced local symbol.

ld/

PR ld/33793
* testsuite/ld-mips-elf/mips-elf.exp: Run pr33793.
* testsuite/ld-mips-elf/pr33793.d: New file.
* testsuite/ld-mips-elf/pr33793.s: Likewise.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
5 days agowindres: quote the angled brackets to avoid confusing shell
Alibek Omarov [Thu, 22 Jan 2026 22:35:18 +0000 (03:35 +0500)] 
windres: quote the angled brackets to avoid confusing shell

When invoking windres with a preprocessor parameter that contains angled
brackets, the shell will try to interpret them, leading to an error.

For example with an empty test.rc file:

$ i686-w64-mingw32-windres '-DTEST=<foo>' -o test.o -i test.rc
sh: 1: cannot open foo: No such file
i686-w64-mingw32-windres: preprocessing failed.

After patch it correctly complains about no resources baked in:

$ ./i686-w64-mingw32-windres '-DTEST=<foo>' -o test.o -i test.rc
./i686-w64-mingw32-windres: no resources

Signed-off-by: Alibek Omarov <a1ba.omarov@gmail.com>
5 days agoopcodes: Fix branch displacement mask in M*Core disassembler
Michal Sobon [Fri, 23 Jan 2026 13:38:28 +0000 (14:38 +0100)] 
opcodes: Fix branch displacement mask in M*Core disassembler

The BT, BF, BR, and BSR instructions use the Scaled 11-Bit Displacement
addressing mode. According to the Motorola M*Core Reference Manual,
the instruction format has:
- bits 15-11: opcode
- bits 10-0: 11-bit signed displacement field

The displacement calculation is: PC <- PC + 2 + (sign-extended disp11 << 1)

The disassembler was incorrectly masking with 0x3FF (10 bits) instead of
0x7FF (11 bits). This masked off bit 10, which is the sign bit for the
11-bit signed displacement. As a result, negative (backward) branches
were incorrectly disassembled as forward branches.

opcodes/
* mcore-dis.c (print_insn_mcore): Fix displacement mask from
0x3FF to 0x7FF in BR case to correctly extract all 11 bits
including the sign bit.

Signed-off-by: Michal Sobon <msobon@hex-rays.com>
5 days agoamend supports_oa targets
Alan Modra [Sat, 24 Jan 2026 02:09:27 +0000 (12:39 +1030)] 
amend supports_oa targets

Add vxworks and windiss to supported targets.  is_elf_target excludes
them as a hack to work around multiple other elf test failures.

On these targets, fixes
FAIL: GNU attributes v1/v2: no support for directive .gnu_attribute

6 days agosframe: doc: prepare SFrame specification for release
Indu Bhagat [Sat, 24 Jan 2026 00:25:21 +0000 (16:25 -0800)] 
sframe: doc: prepare SFrame specification for release

Remove the DRAFT marker before release.  Currently needs to be done
manually.

libsframe/
* doc/sframe-spec.texi: Remove DRAFT marker.

6 days agogas: move obj_begin earlier
Alan Modra [Fri, 23 Jan 2026 23:22:40 +0000 (09:52 +1030)] 
gas: move obj_begin earlier

csky wants to set up ELF object attributes in its md_begin.

* as.c (perform_an_assembly_pass): Move obj_begin earlier.
* testsuite/gas/mmix/builtin1.d,
* testsuite/gas/mmix/builtin3.d: Adjust expected output.

6 days agofix fail of X32 DSO from x86-64 sframe.o
Alan Modra [Fri, 23 Jan 2026 23:20:57 +0000 (09:50 +1030)] 
fix fail of X32 DSO from x86-64 sframe.o

The testcase assumes binutils is configured without
--disable-separate-code.  Pass -z separate-code to generate the
expected output.

6 days agoscore: segfault on null hi16_rel_addr
Alan Modra [Fri, 23 Jan 2026 23:19:29 +0000 (09:49 +1030)] 
score: segfault on null hi16_rel_addr

On a fuzzed input object we hit a segfault when a LO16 reloc doesn't
have the required preceding HI16 reloc.

move score static hi16_rel_addr to elf_section_data, and check that
it is non-NULL before dereferencing.

6 days agoasan: mips ecoff integer overflow
Alan Modra [Fri, 23 Jan 2026 07:47:06 +0000 (18:17 +1030)] 
asan: mips ecoff integer overflow

Silence an inconsequential oss-fuzz complaint.

* ecofflink.c (lookup_line): Make lineno unsigned to avoid
integer overflow.  Sign extend without a conditional.

6 days agoAutomatic date update in version.in
GDB Administrator [Sat, 24 Jan 2026 00:00:06 +0000 (00:00 +0000)] 
Automatic date update in version.in

6 days agosframe: doc: minor typos and cosmetic fixes
Indu Bhagat [Fri, 23 Jan 2026 22:59:11 +0000 (14:59 -0800)] 
sframe: doc: minor typos and cosmetic fixes

libsframe/
* doc/sframe-spec.texi: Minor edits.

6 days agolibsframe: rename sframe_fre_* internal APIs to use data word instead of offset
Indu Bhagat [Fri, 23 Jan 2026 22:21:56 +0000 (14:21 -0800)] 
libsframe: rename sframe_fre_* internal APIs to use data word instead of offset

Rename three internal functions:
  - sframe_fre_get_offset_count to sframe_fre_get_dataword_count
  - sframe_fre_get_offset_size to sframe_fre_get_dataword_size
  - sframe_fre_offset_bytes_size to sframe_fre_datawords_bytes_size.

libsframe/
* sframe.c: Rename functions and variables.

6 days agolibsframe: rename flip_fre_stack_offsets to flip_fre_datawords
Indu Bhagat [Fri, 23 Jan 2026 22:21:35 +0000 (14:21 -0800)] 
libsframe: rename flip_fre_stack_offsets to flip_fre_datawords

Also adjust function level comment for flip_fre_datawords.

libsframe/
* sframe.c (flip_fre_stack_offsets): Rename to
flip_fre_datawords.

6 days agolibsframe: rename offset in user-facing sframe_frame_row_entry struct
Indu Bhagat [Fri, 23 Jan 2026 22:21:15 +0000 (14:21 -0800)] 
libsframe: rename offset in user-facing sframe_frame_row_entry struct

This patch is the first patch to align libsframe with the terminology
change of moving from 'offset' to 'data word'.  With the introduction of
flexible FDE type SFRAME_FDE_TYPE_FLEX, the variable-length data
following an SFrame FRE header can now represent signed offsets or
unsigned control data. Consequently, 'data word' is adopted as the more
generic term.

This change updates the names used in the user-facing
sframe_frame_row_entry structure.  While some API function names remain
unchanged to preserve existing contracts, the underlying data buffers
and size macros now reflect the data word' terminology.

libsframe is a tricky spot for such a terminology change: some of APIs
are still used to read (may be followed by endian swap) for dumping
SFrame V2 sections in textual format.  Some classic examples are
sframe_decode_fre, and flip_fre (both are static functions).  But moving
forward, using the term 'data word' for such APIs and their internal too
may be better.  Subsequent commits will achieve just that.

include/
* sframe-api.h (MAX_NUM_DATAWORDS): Rename from
MAX_NUM_STACK_OFFSETS.
(MAX_DATAWORD_BYTES): Rename from MAX_OFFSET_BYTES.
(struct sframe_frame_row_entry): Rename fre_offsets to
fre_datawords.
libsframe/
* sframe.c (sframe_fre_sanity_check_p): Use MAX_NUM_DATAWORDS.
(sframe_get_fre_offset): Update internal pointers to use
'offsets' and access fre_datawords.
(sframe_get_fre_udata): Rename local variables to
dataword_cnt/dataword_size and update to use
SFRAME_FRE_DATAWORD_* constants.
(sframe_decode_fre): Use fre_datawords and MAX_DATAWORD_BYTES.
(sframe_encoder_add_fre): Use fre_datawords.
(sframe_encoder_write_fre): Use fre_datawords.

6 days agoinclude: gas: sframe: fix terminology from offset to data word
Indu Bhagat [Fri, 23 Jan 2026 22:20:54 +0000 (14:20 -0800)] 
include: gas: sframe: fix terminology from offset to data word

In SFrame V3, with the addition of flexible FDE type, the
variable-length array of bytes trailing the SFrame FRE header are no
longer exclusively interpreted as signed offsets. This data can now
include unsigned control data, unsigned padding word data or signed
offset data. Consequently, using the term "offsets" to describe this
trailing data is inaccurate and can be confusing.

This patch switches the terminology to 'Data Word' across the assembler
and the SFrame header file. Note that, the term 'Word' is used
colloquially here, the actual size (1, 2, or 4 bytes) remains determined
by the applicable bits in the FRE info byte.

gas/
* gen-sframe.c: Rename SFrame FRE 'offset' to 'data word'.
include/
* sframe.h (SFRAME_FRE_DATAWORD_1B, SFRAME_FRE_DATAWORD_2B,
SFRAME_FRE_DATAWORD_4B): New constants.
(struct sframe_fre_info): Update bitfield documentation.
(SFRAME_V3_FRE_DATAWORD_COUNT): New macro.
(SFRAME_V3_FRE_DATAWORD_SIZE): New macro.

6 days agosframe: doc: terminology change from offset to data word
Indu Bhagat [Fri, 23 Jan 2026 22:20:33 +0000 (14:20 -0800)] 
sframe: doc: terminology change from offset to data word

ChangeLog:
* libsframe/doc/sframe-spec.texi

6 days agoSimplify cp_print_class_member
Tom Tromey [Sun, 23 Apr 2023 15:58:14 +0000 (09:58 -0600)] 
Simplify cp_print_class_member

I noticed that cp_print_class_member's calling convention can be
simplified.  In particular it seems cleaner for it to simply take a
value and a stream; and the "prefix" argument is only ever set to one
value.

This version also renames the function, to indicate a bit more clearly
what it actually does.

Regression tested on x86-64 Fedora 40.

Reviewed-By: Keith Seitz <keiths@redhat.com>
6 days agoAdd aarch64-windows support
Hannes Domani [Fri, 23 Jan 2026 19:07:04 +0000 (20:07 +0100)] 
Add aarch64-windows support

This makes most debugging work, except unwinding doesn't always work
from inside dlls where no debug info is available, because SEH unwinding
is not implemented.

The number of available hardware breakpoints is taken from
ID_AA64DFR0_EL1 (registry key "CP 4028").
As for hardware watchpoints, even though ARM64_MAX_WATCHPOINTS is 2,
testing showed that only 1 ever works, so it's fixed to that value.

Reviewed-By: Eli Zaretskii <eliz@gnu.org>
Approved-By: Tom Tromey <tom@tromey.com>
6 days agoMove setting size of long to windows-tdep
Hannes Domani [Fri, 23 Jan 2026 19:07:04 +0000 (20:07 +0100)] 
Move setting size of long to windows-tdep

It's 32bit for all (non-cygwin) Windows ABIs.

Approved-By: Tom Tromey <tom@tromey.com>
6 days agoMove auto_wide_charset gdbarch method to windows-tdep
Hannes Domani [Fri, 23 Jan 2026 19:07:04 +0000 (20:07 +0100)] 
Move auto_wide_charset gdbarch method to windows-tdep

It's UTF-16 for all Windows ABIs.

Approved-By: Tom Tromey <tom@tromey.com>
6 days agoMove software breakpoint recognition code into x86-windows-nat.c
Hannes Domani [Fri, 23 Jan 2026 19:07:04 +0000 (20:07 +0100)] 
Move software breakpoint recognition code into x86-windows-nat.c

Approved-By: Tom Tromey <tom@tromey.com>
Reviewed-By: Christina Schimpe <christina.schimpe@intel.com>
6 days agoMove x86 selector code into x86-windows-nat.c
Hannes Domani [Fri, 23 Jan 2026 19:07:04 +0000 (20:07 +0100)] 
Move x86 selector code into x86-windows-nat.c

Approved-By: Tom Tromey <tom@tromey.com>
Reviewed-By: Christina Schimpe <christina.schimpe@intel.com>
6 days agoMove x86 register code into x86-windows-nat.c
Hannes Domani [Fri, 23 Jan 2026 19:07:04 +0000 (20:07 +0100)] 
Move x86 register code into x86-windows-nat.c

Reviewed-By: Christina Schimpe <christina.schimpe@intel.com>
Approved-By: Tom Tromey <tom@tromey.com>
6 days agoMove x86 debug registers and related code into x86-windows-nat.c
Hannes Domani [Fri, 23 Jan 2026 19:07:04 +0000 (20:07 +0100)] 
Move x86 debug registers and related code into x86-windows-nat.c

Approved-By: Tom Tromey <tom@tromey.com>
6 days agoCreate x86-windows-nat.c
Hannes Domani [Fri, 23 Jan 2026 19:07:04 +0000 (20:07 +0100)] 
Create x86-windows-nat.c

Also creates the x86_windows_per_inferior and x86_windows_nat_target
derived classes in there which will then hold the arch-specific data and
function overrides.

Approved-By: Tom Tromey <tom@tromey.com>
6 days agoMove struct declarations into windows-nat.h
Hannes Domani [Fri, 23 Jan 2026 19:07:04 +0000 (20:07 +0100)] 
Move struct declarations into windows-nat.h

This is done as preparation for aarch64-windows-nat, since both x86 and
aarch64 will use them as base (after the x86 parts are split off into
x86-windows-nat).

Approved-By: Tom Tromey <tom@tromey.com>
6 days agoSimplify windows_nat_target::resume
Hannes Domani [Fri, 23 Jan 2026 19:07:04 +0000 (20:07 +0100)] 
Simplify windows_nat_target::resume

Now the thread context is only needed for setting the trace bit, so move
the rest out of the with_context lambda.

Approved-By: Tom Tromey <tom@tromey.com>
Reviewed-By: Christina Schimpe <christina.schimpe@intel.com>
6 days agoRemove duplicate code from windows_nat_target::resume
Hannes Domani [Fri, 23 Jan 2026 19:07:04 +0000 (20:07 +0100)] 
Remove duplicate code from windows_nat_target::resume

Updating the debug registers and calling SetThreadContext is already
done in windows_continue, called directly afterwards, so this removes it
from windows_nat_target::resume.

Approved-By: Tom Tromey <tom@tromey.com>
6 days agoSome cleanups to "pretend language" handling
Tom Tromey [Sat, 22 Nov 2025 18:03:57 +0000 (11:03 -0700)] 
Some cleanups to "pretend language" handling

I noticed that the "pretend language" handling in the DWARF reader
doesn't work as intended; the problem code in dwarf2_per_cu::set_lang
is:

  if (unit_type () == DW_UT_partial)
    return;

The issue here is that this subverts the very purpose of having a
"pretend" language.

Some background: when Jakub wrote dwz, we also added support for this
style of DWARF compression to gdb.  Now, dwz only shares DIEs in a
"top level" way -- i.e., at the time (and as far as I know, continuing
to today), it would not emit a DW_TAG_imported_unit inside a
namespace.  So, when implementing this we also implemented an
optimization, namely that gdb would not re-read every imported unit a
la '#include', but instead would make symtabs for each included unit
(partial units didn't yet exist).

However, an imported/partial unit might not have a language -- but a
language is necessary for interpreting the DIEs.  This is where the
"pretend" language comes from.  When reading a CU, any included
partial units that do not have a language of their own will inherit
that CU's language.

This patch started by removing the DW_UT_partial check.  This of
course caused assertion failures in some modes, as set_lang also
asserts that the language cannot change.  But, it's possible for a CU
to be prepared multiple times, and for different invocations to
provide different languages.

This is not a scenario we allowed for in the early days.  Nowadays,
though, it seems to me that it's basically fine in practice, with the
reason being that sharing DIEs that differ semantically but not
syntactically across different languages is hard to achieve.

We do see this some cross-language sharing in a limited way -- "dwz
-5" will emit inclusions from both C and C++ CUs for the
gdb.fortran/mixed-lang-stack.exp test -- but note that this sharing is
limited to things that are common between C and C++, like "float".

Therefore this patch replaces the assertions in set_lang with some
compare-exchanges.

Finally I changed cutu_reader to use a std::optional for the pretend
language.  I think this makes it more clear what is happening.  And,
while doing this I found a spot in the cooked indexer where
language_minimal was passed in, but where the importing CU's language
should have been used.

I regression tested this on x86-64 Fedora 40 using the default board,
plus the cc-with-gdb-index, cc-with-debug-names, and cc-with-dwz-5
boards.

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

6 days agoUpdate black to 26.1.0
Tom Tromey [Thu, 22 Jan 2026 20:41:02 +0000 (13:41 -0700)] 
Update black to 26.1.0

"pre-commit autoupdate" suggests a new version of black.  This version
seems to want to change how destructuring assignments are formatted.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
6 days agoaarch64 test: fix clashing test name
Matthieu Longo [Fri, 23 Jan 2026 11:30:37 +0000 (11:30 +0000)] 
aarch64 test: fix clashing test name

6 days agofix build failures due to incorrect format specifier for uint64_t
Matthieu Longo [Thu, 22 Jan 2026 15:15:05 +0000 (15:15 +0000)] 
fix build failures due to incorrect format specifier for uint64_t

6 days agoReword the section of the AI Acceptance Policy that refers to labelling submissions.
Nick Clifton [Fri, 23 Jan 2026 10:47:06 +0000 (10:47 +0000)] 
Reword the section of the AI Acceptance Policy that refers to labelling submissions.

6 days agogdb/tui: return std::string from tui_get_function_from_frame
Andrew Burgess [Thu, 22 Jan 2026 14:09:37 +0000 (14:09 +0000)] 
gdb/tui: return std::string from tui_get_function_from_frame

Update tui_get_function_from_frame to return a std::string rather than
a pointer into a static buffer.

The value returned from tui_get_function_from_frame is passed to
tui_location_tracker::set_location, which already stores the data in a
std::string; this just moves the string creation earlier.

I don't think there was anything particularly wrong with the old code,
but I'm not a huge fan of returning data in static buffers unless
there's a really good reason, and it doesn't feel like there's a
really good reason in this case.

The current approach in tui_get_function_from_frame is to call
print_address_symbolic, and then to pull the function name from the
result.  There is an argument that this approach could be improved,
but I've not done that in this commit, nor do I plan to do that any
time soon.  As such the new code should do exactly what the old code
did.

There should be no user visible changes after this commit.

Approved-By: Tom Tromey <tom@tromey.com>
6 days agold: bring vfinfo() in parity with printf() for format specifiers ll[d|i|x]
Matthieu Longo [Thu, 22 Jan 2026 17:34:39 +0000 (17:34 +0000)] 
ld: bring vfinfo() in parity with printf() for format specifiers ll[d|i|x]

vfinfo() does not currently support the double-'l' ('ll') length
modifier for 'd', 'u', and 'x' conversion specifiers. This caused
incorrect behavior when using PRI[d|u|x][32|64] on some platforms,
and is error-prone for developers who reasonably expect
printf-compatible semantics.

This patch adds support for ll[d|u|x] to align vfinfo() with printf()
and improve portability and robustness.