]> git.ipfire.org Git - thirdparty/binutils-gdb.git/log
thirdparty/binutils-gdb.git
12 days ago[gdb/testsuite] Add Term::get_string_with_attrs in tuiterm
Tom de Vries [Thu, 24 Jul 2025 10:06:40 +0000 (12:06 +0200)] 
[gdb/testsuite] Add Term::get_string_with_attrs in tuiterm

While reading a gdb.log for test-case gdb.tui/main-2.exp, I noticed that this
line was somewhat hard to read:
...
screen line 6: '<fg:cyan><intensity:bold>|<fg:default><intensity:normal>B+>    21 <reverse:1>  return 0;<reverse:0>                                                         <fg:cyan><intensity:bold>|<fg:default><intensity:normal>'
...
because of the border attributes.

Then I realized that the test-case is only interested in the text between the
borders, so I added a proc Term::get_string_with_attrs that allows me to drop
the borders, getting us instead:
...
screen line 6: 'B+>    21 <reverse:1>  return 0;<reverse:0>                                                         '
...

Tested on aarch64-linux.

12 days ago[gdb/testsuite] Use TERM=ansiw in tuiterm for bsd
Tom de Vries [Thu, 24 Jul 2025 09:48:29 +0000 (11:48 +0200)] 
[gdb/testsuite] Use TERM=ansiw in tuiterm for bsd

TERM=ansi is different on freebsd and linux.  Consequently, many TUI
test-cases (gdb.tui/*.exp and gdb.python/tui*.exp) fail on freebsd.

One of the problems is that send_gdb "<cmd>\r\n" is needed instead of
send_gdb "<cmd>\n".

This is because gdb_send "layout regs\n" translates to
"layout regs<KEY_DOWN>", which evidently missing the carriage return part.

While we can work around this, there are other problems.  There is no color
support, and the cursor keys fail to scroll the source window.

So I went looking for an alternative to TERM=ansi on freebsd, and came across
TERM=ansiw.  Using this didn't work out of the box, but with the fixes in
this series it now does.

I also briefly looked at TERM=ansis, which is interesting because it's
available on both linux and freebsd, but ansiw is a better choice for now.
I've filed PR33179 to document what I learned, with the aim to eventually
follow up and address two test-case failures with TERM=ansis on linux.

Tested on x86_64-freebsd.

12 days ago[gdb/testsuite] Log on return in Term::_log_cur
Tom de Vries [Thu, 24 Jul 2025 07:18:57 +0000 (09:18 +0200)] 
[gdb/testsuite] Log on return in Term::_log_cur

Proc Term::_log_cur logs the cursor update of code in its body argument:
...
    proc _ctl_0x08 {} {
        _log_cur "Backspace" {
            variable _cur_col

            if {$_cur_col > 0} {
                incr _cur_col -1
            }
        }
    }
...
giving us for instance:
...
+++ Backspace, cursor: (2, 0) -> (2, 0)
...

But if we rewrite the code to use a return:
...
    if { $_cur_col == 0 } {
return
    }
    incr _cur_col -1
...
and the return is triggered, the log message disappears.

Fix this by wrapping the "uplevel $body" in a catch:
...
- uplevel $body
+ set code [catch {uplevel $body} result]
...

Tested on aarch64-linux.

12 days agoAutomatic date update in version.in
GDB Administrator [Thu, 24 Jul 2025 00:03:51 +0000 (00:03 +0000)] 
Automatic date update in version.in

12 days agogold: configury: fix obsolete macros
Pietro Monteiro [Wed, 23 Jul 2025 23:49:50 +0000 (19:49 -0400)] 
gold: configury: fix obsolete macros

Running `autoreconf -vf -Wall' in the gold directory shows errors about the use
of obsolete macros.  This patch fix the issues with macros used directly by
configure.ac. However, it doesn't fix all warnings.  There are autoconf warnings
about macros from files in config and one automake warning about a target being
shadowed.  It cuts a lot of the noise down and makes an upgrade to autoconf
2.71+ easier.

https://www.gnu.org/software/automake/manual/1.12.2/html_node/Obsolete-Macros.html#index-AM_005fCONFIG_005fHEADER
https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Obsolete-Macros.html#index-AC_005fOUTPUT-2133

gold/ChangeLog:

* aclocal.m4: Regenerate.
* configure: Regenerate.
* configure.ac: Replace AM_CONFIG_HEADER by AC_CONFIG_HEADERS. Replace
        AC_OUTPUT(file list) by AC_CONFIG_FILES([file list])\nAC_OUTPUT.

Approved-by: Alan Modra <amodra@gmail.com>
13 days ago[gdb/testsuite] Fix Term::_csi_m with no args
Tom de Vries [Wed, 23 Jul 2025 20:14:58 +0000 (22:14 +0200)] 
[gdb/testsuite] Fix Term::_csi_m with no args

When calling Term::_csi_m with no args, default behaviour needs to be applied,
which is equivalent to "Term::_csi_m 0" [1].

However, while "Term::_csi_m 0" works, as well as 'Term::_csi_m ""', calling
Term::_csi_m with no args has no effect.

Fix this by implementing the default behaviour in Term::_csi_m.

Tested on aarch64-linux.

Approved-By: Tom Tromey <tom@tromey.com>
[1] https://vt100.net/docs/vt510-rm/SGR.html

13 days ago[gdb/testsuite] Handle auto_left_margin in tuiterm
Tom de Vries [Wed, 23 Jul 2025 19:11:41 +0000 (21:11 +0200)] 
[gdb/testsuite] Handle auto_left_margin in tuiterm

The terminal capability bw (aka as auto_left_margin) controls whether a
backspace at the start of a line wraps to the last column of the previous
line.

For tuiterm, we use TERM=ansi, and on linux at least that capability is off.

Consequently the current implementation of Term::_ctl_0x08 doesn't wrap.

Add this capability in Term::_ctl_0x08, and add a unit test.

Tested on aarch64-linux.

Approved-By: Tom Tromey <tom@tromey.com>
13 days agogdbserver: use reference in range for loop
Simon Marchi [Wed, 23 Jul 2025 18:41:42 +0000 (14:41 -0400)] 
gdbserver: use reference in range for loop

The armhf buildbot fails to build GDB, with:

    ../../binutils-gdb/gdbserver/server.cc: In function ‘void handle_general_set(char*)’:
    ../../binutils-gdb/gdbserver/server.cc:1021:23: error: loop variable ‘<structured bindings>’ creates a copy from type ‘const std::pair<thread_info*, enum_flags<gdb_thread_option> >’ [-Werror=range-loop-construct]
     1021 |       for (const auto [thread, options] : set_options)
          |                       ^~~~~~~~~~~~~~~~~
    ../../binutils-gdb/gdbserver/server.cc:1021:23: note: use reference type to prevent copying
     1021 |       for (const auto [thread, options] : set_options)
          |                       ^~~~~~~~~~~~~~~~~
          |                       &

I did not use a reference on purpose, because the pair is very small.  I
don't see the problem when building on amd64, I presume it is because
the pair is considered too big to copy on a 32-bit architecture, but not
on a 64-bit architecture.

In any case, fix it by adding a reference.

Change-Id: I8e95235d6e53f032361950cf6e0c7d46b082f951

13 days ago[gdb/testsuite] Handle Horizontal Position Absolute in tuiterm
Tom de Vries [Wed, 23 Jul 2025 18:28:46 +0000 (20:28 +0200)] 
[gdb/testsuite] Handle Horizontal Position Absolute in tuiterm

I ran the tui testsuite on freebsd with TERM=ansiw, and investigated the first
failure, in test-case gdb.tui/tui-init-source.exp.

The problem turned out to be the lack of handling a Horizontal Position
Absolute [1] sequence "^[[80`" in tuiterm.

Add Term::_csi_`, forwarding to Term::_csi_G which handles Cursor Horizontal
Absolute [2].

Tested on x86_64-linux.

Approved-By: Tom Tromey <tom@tromey.com>
[1] https://vt100.net/docs/vt510-rm/HPA.html
[2] https://vt100.net/docs/vt510-rm/CHA.html

13 days ago[gdb/testsuite] Fix Cursor Horizontal Absolute clipping
Tom de Vries [Wed, 23 Jul 2025 18:28:46 +0000 (20:28 +0200)] 
[gdb/testsuite] Fix Cursor Horizontal Absolute clipping

I looked at the tuiterm implementation of Cursor Horizontal Absolute:
...
    proc _csi_G {args} {
set arg [_default [lindex $args 0] 1]

_log_cur "Cursor Horizontal Absolute ($arg)" {
    variable _cur_col
    variable _cols

    set _cur_col [expr {min ($arg - 1, $_cols)}]
}
    }
...
and noticed a problem with the clipping behavior.

If we have say $_cols == 80, and we do _csi_G 81 we get $_cur_col == 80, while
$_cur_col is zero-based and should be in the 0..79 range.

Fix this by using:
...
    set _cur_col [expr {min ($arg, $_cols)} - 1]
...
which gets us $_cur_col == 79.

Add two boundary tests to gdb.tui/tuiterm.exp.

Tested on x86_64-linux.

Approved-By: Tom Tromey <tom@tromey.com>
13 days agogdb, gdbserver: use structured bindings in a few places
Simon Marchi [Wed, 9 Jul 2025 13:17:50 +0000 (09:17 -0400)] 
gdb, gdbserver: use structured bindings in a few places

I wanted to change one of these, so I searched for more similar
instances, while at it.  I think this looks a bit tidier, over unpacking
the pairs by hand.

Change-Id: Ife4b678f7a6aed01803434197c564d2ab93532a7
Approved-By: Tom Tromey <tom@tromey.com>
13 days agoPR 33197 [AVR] Incorrect syntax in generated ldscript
Alan Modra [Wed, 23 Jul 2025 12:22:31 +0000 (21:52 +0930)] 
PR 33197 [AVR] Incorrect syntax in generated ldscript

Rearrange scripttempl/avr.sc to avoid oddities of shells expanding
${RELOCATING+stuff} in here documents where "stuff" contains quoted
strings.  Also I think it is better to avoid multi-line "stuff" as it
can be tricky to spot the ending brace.

13 days agolibctf: don't run tests requiring deduplicating linker unless one is in use
Nick Alcock [Thu, 17 Jul 2025 16:45:02 +0000 (17:45 +0100)] 
libctf: don't run tests requiring deduplicating linker unless one is in use

Before now, we were relying on gcc -B to repoint GCC at our freshly-built
linker, and assuming we could use this to run tests that do linker dedup.

This is, alas, not reliable (building --with-ld=/an/absolute/path bypasses
-B searches for the linker), and we would like the libctf tests in
particular to not fail if the compiler uses a linker that cannot deduplicate
(simply skipping such tests).

Add a new testsuite function that tries to link one of the lookup tests'
testcases (which is known to produce conflicting types, i.e. a dict with
per-translation-unit children) and then does an objdump and greps it for
signs of the per-translation-unit children.  If there are none, the linker
probably just concatenated the sections: i.e., it is not a linker that
can deduplicate CTF.

libctf/
PR libctf/33162
* testsuite/config/default.exp (objdump): Introduce.
(OBJDUMPFLAGS): Likewise.
* testsuite/lib/ctf-lib.exp (check_ctf_linker_dedup): New.
* testsuite/libctf-lookup/lookup.exp: Use it.
* testsuite/libctf-regression/libctf-repeat-cu.exp: Likewise.
* testsuite/libctf-regression/regression.exp: Likewise.

13 days agolibctf: exclude always-emitted Solaris symbols from the symtypetab
Rainer Orth [Wed, 16 Jul 2025 15:55:51 +0000 (16:55 +0100)] 
libctf: exclude always-emitted Solaris symbols from the symtypetab

If we're skipping _BEGIN_ and _END_ we should certainly skip all the other
ABI-required always-emitted symbols given in ld/emultempl/solaris2*em as
well.  (This fixes a couple of diagnostics tests, but that's just because
the tests are quite sensitive to CTF section sizes, and introducing any
symtypetab entries for those tests perturbs those.)

Some of these are usually STT_NOTYPE, but not always: if programs already
emitted the symbol they might end up with any type, in particular
STT_OBJECT, and appear in the symtypetabs.

[nca: added commit log, added more symbols]

libctf/
PR libctf/33162
* ctf-serialize.c (ctf_symtab_skippable): Skip
more always-emitted Solaris symbols.

13 days agolibctf: get libctf-nobfd.ver from the right place with Solaris ld
Nick Alcock [Wed, 16 Jul 2025 13:43:25 +0000 (14:43 +0100)] 
libctf: get libctf-nobfd.ver from the right place with Solaris ld

We generate de-commented version scripts for Solaris ld (whose
-z gnu-version-script linker option does not support comments),
but after we switched to generating libctf-nobfd.ver itself, we
failed to adjust this code to pick it up from the new location.

libctf/
PR libctf/33161
* configure.ac: Fix libctf-nobfd.ver path on Solaris.
* configure: Regenerated.

13 days agolibctf: do not use mmap on Solaris 11
Rainer Orth [Wed, 16 Jul 2025 12:10:05 +0000 (13:10 +0100)] 
libctf: do not use mmap on Solaris 11

Writable mmaps and read are inconsistent with each other on Solaris 11.4,
which breaks archive writing.  Simply assert that Solaris 2.11 doesn't have
mmap, falling back to read(): the archive format is being bumped shortly, to
one with completely different writeout code, so this workaround need not
stay for long.

[nca: added commit log]

libctf/
PR libctf/29292
* configure.ac: Turn off mmap on Solaris 2.11.
* configure: Regenerated.

13 days agogas: sframe: fix PR gas/33170
Indu Bhagat [Thu, 17 Jul 2025 22:17:36 +0000 (15:17 -0700)] 
gas: sframe: fix PR gas/33170

SFrame generation code assumes that since DW_CFA_restore means
restoration of the state of the register to the one at the beginning of
the function, there must be a state to restore to (hence the gas_assert
(cie_fre)).

This assumption needs adjustment.  DW_CFA_restore may be present in the
very beginning of a (e.g., cold) function, with no initialized state for
SFrame functions to restore to.

gas/
PR gas/33170
* gas/gen-sframe.c (sframe_xlate_do_restore): Use current FRE if
CIE FRE is not yet setup.
gas/testsuite/
PR gas/33170
* gas/cfi-sframe/cfi-sframe.exp: New test.
* gas/cfi-sframe/cfi-sframe-x86_64-pr33170.d: New test.
* gas/cfi-sframe/cfi-sframe-x86_64-pr33170.s: New test.

13 days agoAutomatic date update in version.in
GDB Administrator [Wed, 23 Jul 2025 00:01:55 +0000 (00:01 +0000)] 
Automatic date update in version.in

2 weeks ago[gdb/testsuite] Modernize gdb.base/command-line-input.exp
Tom de Vries [Tue, 22 Jul 2025 20:26:05 +0000 (22:26 +0200)] 
[gdb/testsuite] Modernize gdb.base/command-line-input.exp

Modernize test-case gdb.base/command-line-input.exp using clean_restart,
multi_line and string_to_regexp.

Tested on x86_64-linux.

Approved-By: Andrew Burgess <aburgess@redhat.com>
2 weeks ago[gdb/cli] Clear line buffer on ^C
Tom de Vries [Tue, 22 Jul 2025 20:26:05 +0000 (22:26 +0200)] 
[gdb/cli] Clear line buffer on ^C

Gdb has the ability to gather input over several lines [1], for instance this:
...
(gdb) print 1
$1 = 1
(gdb)
...
can also be typed as:
...
(gdb) print\
 1
$2 = 1
(gdb)
...

Furthermore, if we type a command but change our mind, we can abort using ^C
and start over using a fresh gdb prompt [2]:
...
(gdb) print 1❌️ Quit
(gdb) echo 1\n
1
(gdb)
...

Now say we type a multi-line command but abort it, we get:
...
(gdb) print\
 1❌️ Quit
(gdb) echo 1\n
❌️ Undefined command: "printecho".  Try "help".
(gdb)
...

Using "set trace-commands on", we can see what happened:
...
+printecho 1\n
..

Gdb has prepended the first line of the cancelled multi-line command to the
following command.

Fix this by clearing current_ui->line_buffer on catching a gdb_exception in
start_event_loop.

Tested on x86_64-linux.

Approved-By: Andrew Burgess <aburgess@redhat.com>
PR cli/33063
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33063

[1] https://sourceware.org/gdb/current/onlinedocs/gdb.html/Output.html
[2] https://sourceware.org/gdb/current/onlinedocs/gdb.html/Quitting-GDB.html

2 weeks agogdb: Remove redundant parameter for filename completion
Guinevere Larsen [Tue, 22 Jul 2025 14:35:15 +0000 (11:35 -0300)] 
gdb: Remove redundant parameter for filename completion

As I was working on an unrelated patch, I noticed that all calls to
make_source_files_completion_list had both parameters of the function
call being the same pointer.  I think we can remove that redundancy and
make that call with just one parameter.

Approved-By: Andrew Burgess <aburgess@redhat.com>
2 weeks agogdb/solib-svr4: fix indent
Simon Marchi [Tue, 22 Jul 2025 17:47:04 +0000 (13:47 -0400)] 
gdb/solib-svr4: fix indent

Change-Id: I63f78f359f55ec15fb3296a1a9ce28c9d01d663b

2 weeks agogdb: use skip_spaces in info_linker_namespace_command
Simon Marchi [Fri, 11 Jul 2025 17:22:23 +0000 (13:22 -0400)] 
gdb: use skip_spaces in info_linker_namespace_command

Change-Id: I02c7daed3740e319ee27d3512a2b941f666b103b
Approved-By: Andrew Burgess <aburgess@redhat.com>
2 weeks agogdb: fix formatting in solib.c
Simon Marchi [Fri, 11 Jul 2025 17:22:22 +0000 (13:22 -0400)] 
gdb: fix formatting in solib.c

I found these two small nits while working in this file.

Change-Id: Ibdaa57262f3fe363b039fbad746e285fa7b52f8b
Approved-By: Andrew Burgess <aburgess@redhat.com>
2 weeks agoUpdated translations for various sub-directories
Nick Clifton [Tue, 22 Jul 2025 14:58:21 +0000 (15:58 +0100)] 
Updated translations for various sub-directories

2 weeks agoRemove steps for adding .dirstamp when creating pre-release tarball
Nick Clifton [Tue, 22 Jul 2025 14:40:00 +0000 (15:40 +0100)] 
Remove steps for adding .dirstamp when creating pre-release tarball

2 weeks agold: Rename a file on Windows fails if target already exists
Torbjörn SVENSSON [Fri, 18 Jul 2025 15:04:09 +0000 (17:04 +0200)] 
ld: Rename a file on Windows fails if target already exists

To rename a file on Windows, the target name cannot exist. Removing file
prior to renaming ensures this is handled.
To remove a file on Windows, the file cannot be open. Closing the bfd
handle ensures this is handled.
Moved call to free on isympp / osympp to after bfd is closed to align
with comment earlier in the cmdline_add_object_only_section function.

Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
2 weeks agoFix failing test: i386-avx-reverse
Shiven Kashyap [Tue, 22 Jul 2025 08:32:57 +0000 (14:02 +0530)] 
Fix failing test: i386-avx-reverse

Running the standalone test `gdb.reverse` with the target board configuration `unix/-fPIE/-pie` leads to the following failure:
'''
FAIL: gdb.reverse/i386-avx-reverse.exp: verify ymm15 before vbroadcastsd
'''

This happens because the test expects values stored in `dyn_buf0`, but instead (in the test source) the address of the buffer itself
got broadcast to xmm15 (and thus to ymm15).
This happened because the pointer to the start of `dyn_buf0` wasn't dereferenced (see 'vpbroadcast_test' in 'i386-avx-reverse.c'):
'''
asm volatile ("vbroadcastss %0, %%xmm15": : "m" (dyn_buf0));
 ^
'''
and this consequently lead to the test failing for the next instruction (`vbroadcastsd`), which depended on the correct value being broadcast to the register.

Also, updated the corresponding expected output (gdb.reverse/i386-avx-reverse.exp) to match.

Tested on x86-64 Linux.

Signed-off-by: Shiven Kashyap <shivenkashyap24@gmail.com>
Approved-By: Guinevere Larsen <guinevere@redhat.com>
2 weeks agoRISC-V: Don't allocate dynamic relocation if it's section was discarded
Nelson Chu [Thu, 3 Jul 2025 03:16:25 +0000 (11:16 +0800)] 
RISC-V: Don't allocate dynamic relocation if it's section was discarded

2 weeks agoRISC-V: Fix the assert fail when linking discarded sections under -pie for got
Nelson Chu [Thu, 3 Jul 2025 03:16:24 +0000 (11:16 +0800)] 
RISC-V: Fix the assert fail when linking discarded sections under -pie for got

Considering the following case,
% cat tmp.s
.option pic
.text
.global _start
_start:
nop
.section .discard.s, "ax"
la x1, _start
% cat tmp.ld
OUTPUT_ARCH(riscv)
ENTRY(_start)
SECTIONS
{
  /DISCARD/ : { *(.discard.*) }
  . = 0x10000;
  .text : { *(.text) }
  . = 0x20000;
  .got  : { *(.got) *(.got.plt)}
  . = 0x30000;
  .data : { *(.data) *(.data.*) }
}
% riscv64-unknown-linux-gnu-as tmp.s -o tmp.o
% riscv64-unknown-linux-gnu-ld -pie -Ttmp.ld tmp.o
riscv64-unknown-linux-gnu-ld: BFD (GNU Binutils) 2.44.50.20250624 assertion fail binutils-gdb/bfd/elfnn-riscv.c:3638

This happens when pie and the input sections, which refers to the global
symbol by got, are all discarded.  Since referenced sections are all discarded,
we won't go into relocate_section for those sections, the got entry also won't
be initialized.  Therefore, we will get assert fail when adding the RELATIVE
reloc in the finish_dynamic_symbol.

After seeing other target codes, there are two root causes as follows,

1. risc-v may call bfd_elf_link_record_dynamic_symbol in the allocate_dynrelocs
   for not only undefweak symbols.

2. risc-v is missing the code to add RELATIVE to R_RISCV_GOT entries in the
   relocate_section if a symbol is not dynamic and is not undefined weak under
   pic and pie.

If we call bfd_elf_link_record_dynamic_symbol, then the global symbol will be
forced to dynamic, so the h->dynindx will forced to be a number rather than -1,
even it should be -1.  Once h->dynindx != -1 and pic/pie, it will go into
finish_dynamic_symbol and insert RELATIVE/64 relocs for the got entry;  For the
above case there are two issues,

1. The global symbol _start is forced to be dynamic in the allocate_dynrelocs.
   when pie and all the referenced section are discarded, it won't go into
   relocate_section to initialize the got entry, so it will cause assert fail
   when adding RELATIVE reloc in the finish_dynamic_symbol.  The assert fail
   represents another problem - if we don't initialize the got entry in the
   relocate_section under pie, which means we don't need to go into the
   finish_dynamic_symbol and don't need a RELATIVE reloc for the got entry,
   it should be NONE reloc.

2. Without linking any discarded section, it originally forces every RELATIVE
   relocs added for every got by the finish_dynamic_symbol.  Even The final
   result looks correct under pie (genearte a RELATIVE reloc for got entry),
   not sure if it may cause other problems for some special cases, excpet the
   above one.

Therefore, this patch try to fix the above assert fail, and also clarify the
behavior of the allocate_dynrelocs which should only call bfd_elf_link_record_dynamic_symbol
for undefweak symbols, and add the missing code to generate RELATIVE reloc to
R_RISCV_GOT entries in the relocate_section if a symbol is not dynamic and is
not undefined weak under pic and pie.

Passed the gcc/binutils regressions of riscv-gnu-toolchain at least.

2 weeks agoRISC-V: Indent and reorder backend define functions for bfd/elfnn-riscv.c
Nelson Chu [Tue, 22 Jul 2025 05:39:23 +0000 (13:39 +0800)] 
RISC-V: Indent and reorder backend define functions for bfd/elfnn-riscv.c

2 weeks agoAutomatic date update in version.in
GDB Administrator [Tue, 22 Jul 2025 00:01:48 +0000 (00:01 +0000)] 
Automatic date update in version.in

2 weeks agogdb: remove unused includes
Simon Marchi [Mon, 21 Jul 2025 19:30:01 +0000 (15:30 -0400)] 
gdb: remove unused includes

Remove a bunch of includes reported as unused by clangd.

Change-Id: I3f05f98a298036fadf1acce4ddc198405ec056ee

2 weeks agogdb/solib-svr4: remove an unnecessary static cast
Simon Marchi [Mon, 21 Jul 2025 19:25:53 +0000 (15:25 -0400)] 
gdb/solib-svr4: remove an unnecessary static cast

The type is already lm_info_svr4.

Change-Id: Id681eb1685462610b202c76147739ac885555f6b

2 weeks agoaarch64: Use an enum to refer to indices in the opcode table
Richard Earnshaw [Mon, 21 Jul 2025 15:40:12 +0000 (16:40 +0100)] 
aarch64: Use an enum to refer to indices in the opcode table

The indices into the auto-generated tables for opcodes are relatively
unstable.  Adding a new opcode can permute the code significantly.
But most of this churn is down to changes in the index values.  To
minimize this use enumerated constants.  While the index values
change, the enumeration names will need to do so far less often, so
most of the changes in the generated code become localized to the
addition (occasionally removal) of opcodes.  This change also makes
the state-change comments unnecessary.  The enumeration names contain
the same information (and more), so these are simply deleted.

The enumeration values are placed in a new header file, aarch64-tbl-2.h,
so aarch64-gen gains a new option to build this header and the Makefile
rules are adjusted accordingly.

2 weeks agoaarch64: use an enumeration for operand indices.
Richard Earnshaw [Mon, 14 Jul 2025 16:30:01 +0000 (17:30 +0100)] 
aarch64: use an enumeration for operand indices.

The generated aarch64 operand tables use index values into an array.  But if
the table of operands is modified by inserting a new operand into the middle
of the table, *all* the index values can change, leading to a lot of
churn in the generated output.

include/opcode/aarch64.h already provides an enumeration for the operands,
so make use of that instead of printing out the raw index values.

2 weeks agoaarch64: Fix operand name MOPS_WB_Rd -> MOPS_WB_Rn
Richard Earnshaw [Tue, 15 Jul 2025 16:32:20 +0000 (17:32 +0100)] 
aarch64: Fix operand name MOPS_WB_Rd -> MOPS_WB_Rn

This field was misnamed in aarch64_opcode_table.  It previously didn't
matter too much as the name field only appeared in dumps.  But it
doesn't match the enum in include/opcode/aarch64.h and we will shortly
start to rely on that.

2 weeks agoaarch64: minor code cleanups to aarch64-gen.c
Richard Earnshaw [Mon, 21 Jul 2025 14:42:55 +0000 (15:42 +0100)] 
aarch64: minor code cleanups to aarch64-gen.c

Fix some overly-long lines.

2 weeks agogdb/solib-svr4: remove unused svr4_solib_ops method declarations
Simon Marchi [Fri, 18 Jul 2025 19:19:16 +0000 (15:19 -0400)] 
gdb/solib-svr4: remove unused svr4_solib_ops method declarations

These method declarations are unused, remove them.  I guess that when
writing a previous patch, changed some free functions to be methods,
then changed my mind, and forgot to remove the declarations.

Change-Id: I7452bb773af0f32c4aae2fe6a4fc663ec65c3f15

2 weeks agoRemove NaCl/arm target support
H.J. Lu [Sun, 28 Jun 2020 17:50:19 +0000 (10:50 -0700)] 
Remove NaCl/arm target support

NaCl has been deprecated:

https://developer.chrome.com/docs/native-client/migration/

It is now in the process of being removed from llvm:

https://github.com/llvm/llvm-project/pull/133661

Remove NaCl/arm target support from bfd, binutils, gas and ld.

bfd/

* Makefile.am (BFD32_BACKENDS): Remove elf-nacl.lo.
(BFD32_BACKENDS_CFILES): Remove elf-nacl.c.
(SOURCE_HFILES): Remove elf-nacl.h.
* Makefile.in: Regenerated.
* config.bfd: Add *-*-nacl* to obsolete targets.
Remove *-*-nacl* targets.
* configure.ac: Remove nacl target vectors.
* elf-bfd.h (elf_target_os): Remove is_nacl.
* elf-nacl.c: Removed.
* elf-nacl.h: Likewise.
* elf32-arm.c: Don't include "elf-nacl.h".
(elf32_arm_nacl_plt0_entry): Removed.
(elf32_arm_nacl_plt_entry): Likewise.
(elf32_arm_stub_long_branch_arm_nacl): Likewise.
(elf32_arm_stub_long_branch_arm_nacl_pic): Likewise.
(arm_movw_immediate): Likewise.
(arm_movt_immediate): Likewise.
(arm_nacl_put_plt0): Likewise.
(elf32_arm_nacl_link_hash_table_create): Likewise.
(elf32_arm_nacl_modify_segment_map): Likewise.
(elf32_arm_nacl_final_write_processing): Likewise.
(elf32_arm_nacl_plt_sym_val): Likewise.
(elf32_arm_stub_cmse_branch_thumb_only): Remove
long_branch_arm_nacl and long_branch_arm_nacl_pic entries.
(arm_type_of_stub): Updated.
(elf32_arm_create_or_find_stub_sec): Likewise.
(arm_stub_required_alignment): Likewise.
(elf32_arm_allocate_plt_entry): Likewise.
(elf32_arm_populate_plt_entry): Likewise.
(elf32_arm_finish_dynamic_sections): Likewise.
(elf32_arm_output_plt_map_1): Likewise.
(elf32_arm_output_arch_local_syms): Likewise.
Remove elf32_arm_nacl_bed.
* targets.c: Remove NaCl target vectors.
* bfd-in2.h: Regenerated.
* configure: Likewise.
* po/SRC-POTFILES.in: Likewise.

binutils/

* NEWS: Mention NaCl target support removal.
* testsuite/lib/binutils-common.exp: Remove NaCl target support.

gas/

* NEWS: Mention NaCl target support removal.
* configure.tgt: Likewise.
* config/tc-arm.c: Remove NaCl target support.
* testsuite/gas/arm/any-armv8m.d: Likewise.
* testsuite/gas/arm/any-cmse-main.d: Likewise.
* testsuite/gas/arm/any-cmse.d: Likewise.
* testsuite/gas/arm/any-idiv.d: Likewise.
* testsuite/gas/arm/arch4t-eabi.d: Likewise.
* testsuite/gas/arm/arch4t.d: Likewise.
* testsuite/gas/arm/armv8m.base-idiv.d: Likewise.
* testsuite/gas/arm/armv9-a_arch.d: Likewise.
* testsuite/gas/arm/attr-abi-hardfp-use-0.d: Likewise.
* testsuite/gas/arm/attr-abi-hardfp-use-1.d: Likewise.
* testsuite/gas/arm/attr-abi-hardfp-use-2.d: Likewise.
* testsuite/gas/arm/attr-abi-hardfp-use-3.d: Likewise.
* testsuite/gas/arm/attr-any-armv4t.d: Likewise.
* testsuite/gas/arm/attr-any-thumbv6.d: Likewise.
* testsuite/gas/arm/attr-arch-assumption.d: Likewise.
* testsuite/gas/arm/attr-cpu-directive.d: Likewise.
* testsuite/gas/arm/attr-default.d: Likewise.
* testsuite/gas/arm/attr-empty-string.d: Likewise.
* testsuite/gas/arm/attr-ext-fpv5-d16.d: Likewise.
* testsuite/gas/arm/attr-ext-fpv5.d: Likewise.
* testsuite/gas/arm/attr-ext-idiv.d: Likewise.
* testsuite/gas/arm/attr-ext-mp.d: Likewise.
* testsuite/gas/arm/attr-ext-neon-fp16.d: Likewise.
* testsuite/gas/arm/attr-ext-neon-vfpv3.d: Likewise.
* testsuite/gas/arm/attr-ext-neon-vfpv4.d: Likewise.
* testsuite/gas/arm/attr-ext-sec.d: Likewise.
* testsuite/gas/arm/attr-ext-vfpv3-d16-fp16.d: Likewise.
* testsuite/gas/arm/attr-ext-vfpv3-d16.d: Likewise.
* testsuite/gas/arm/attr-ext-vfpv3-fp16.d: Likewise.
* testsuite/gas/arm/attr-ext-vfpv3.d: Likewise.
* testsuite/gas/arm/attr-ext-vfpv3xd-fp.d: Likewise.
* testsuite/gas/arm/attr-ext-vfpv3xd.d: Likewise.
* testsuite/gas/arm/attr-ext-vfpv4-d16.d: Likewise.
* testsuite/gas/arm/attr-ext-vfpv4-sp-d16.d: Likewise.
* testsuite/gas/arm/attr-ext-vfpv4.d: Likewise.
* testsuite/gas/arm/attr-march-all.d: Likewise.
* testsuite/gas/arm/attr-march-armv1.d: Likewise.
* testsuite/gas/arm/attr-march-armv2.d: Likewise.
* testsuite/gas/arm/attr-march-armv2a.d: Likewise.
* testsuite/gas/arm/attr-march-armv2s.d: Likewise.
* testsuite/gas/arm/attr-march-armv3.d: Likewise.
* testsuite/gas/arm/attr-march-armv3m.d: Likewise.
* testsuite/gas/arm/attr-march-armv4.d: Likewise.
* testsuite/gas/arm/attr-march-armv4t.d: Likewise.
* testsuite/gas/arm/attr-march-armv4txm.d: Likewise.
* testsuite/gas/arm/attr-march-armv4xm.d: Likewise.
* testsuite/gas/arm/attr-march-armv5.d: Likewise.
* testsuite/gas/arm/attr-march-armv5t.d: Likewise.
* testsuite/gas/arm/attr-march-armv5te.d: Likewise.
* testsuite/gas/arm/attr-march-armv5tej.d: Likewise.
* testsuite/gas/arm/attr-march-armv5texp.d: Likewise.
* testsuite/gas/arm/attr-march-armv5txm.d: Likewise.
* testsuite/gas/arm/attr-march-armv6-m+os.d: Likewise.
* testsuite/gas/arm/attr-march-armv6-m.d: Likewise.
* testsuite/gas/arm/attr-march-armv6.d: Likewise.
* testsuite/gas/arm/attr-march-armv6j.d: Likewise.
* testsuite/gas/arm/attr-march-armv6k+sec.d: Likewise.
* testsuite/gas/arm/attr-march-armv6k.d: Likewise.
* testsuite/gas/arm/attr-march-armv6kt2.d: Likewise.
* testsuite/gas/arm/attr-march-armv6kz.d: Likewise.
* testsuite/gas/arm/attr-march-armv6kzt2.d: Likewise.
* testsuite/gas/arm/attr-march-armv6s-m.d: Likewise.
* testsuite/gas/arm/attr-march-armv6t2.d: Likewise.
* testsuite/gas/arm/attr-march-armv6z.d: Likewise.
* testsuite/gas/arm/attr-march-armv6zk.d: Likewise.
* testsuite/gas/arm/attr-march-armv6zkt2.d: Likewise.
* testsuite/gas/arm/attr-march-armv6zt2.d: Likewise.
* testsuite/gas/arm/attr-march-armv7-a+idiv.d: Likewise.
* testsuite/gas/arm/attr-march-armv7-a+mp.d: Likewise.
* testsuite/gas/arm/attr-march-armv7-a+sec+virt.d: Likewise.
* testsuite/gas/arm/attr-march-armv7-a+sec.d: Likewise.
* testsuite/gas/arm/attr-march-armv7-a+virt.d: Likewise.
* testsuite/gas/arm/attr-march-armv7-a.d: Likewise.
* testsuite/gas/arm/attr-march-armv7-m.d: Likewise.
* testsuite/gas/arm/attr-march-armv7-r+mp.d: Likewise.
* testsuite/gas/arm/attr-march-armv7-r.d: Likewise.
* testsuite/gas/arm/attr-march-armv7.d: Likewise.
* testsuite/gas/arm/attr-march-armv7a.d: Likewise.
* testsuite/gas/arm/attr-march-armv7em.d: Likewise.
* testsuite/gas/arm/attr-march-armv7m.d: Likewise.
* testsuite/gas/arm/attr-march-armv7r.d: Likewise.
* testsuite/gas/arm/attr-march-armv7ve.d: Likewise.
* testsuite/gas/arm/attr-march-armv8-a+crypto.d: Likewise.
* testsuite/gas/arm/attr-march-armv8-a+fp.d: Likewise.
* testsuite/gas/arm/attr-march-armv8-a+rdma.d: Likewise.
* testsuite/gas/arm/attr-march-armv8-a+simd.d: Likewise.
* testsuite/gas/arm/attr-march-armv8-a.d: Likewise.
* testsuite/gas/arm/attr-march-armv8-r+crypto.d: Likewise.
* testsuite/gas/arm/attr-march-armv8-r+fp.d: Likewise.
* testsuite/gas/arm/attr-march-armv8-r+simd.d: Likewise.
* testsuite/gas/arm/attr-march-armv8-r.d: Likewise.
* testsuite/gas/arm/attr-march-armv8_1-a+simd.d: Likewise.
* testsuite/gas/arm/attr-march-armv8_1-m.main.d: Likewise.
* testsuite/gas/arm/attr-march-armv8_4-a.d: Likewise.
* testsuite/gas/arm/attr-march-armv8_5-a.d: Likewise.
* testsuite/gas/arm/attr-march-armv8_6-a.d: Likewise.
* testsuite/gas/arm/attr-march-armv8_7-a.d: Likewise.
* testsuite/gas/arm/attr-march-armv8_8-a.d: Likewise.
* testsuite/gas/arm/attr-march-armv8_9-a.d: Likewise.
* testsuite/gas/arm/attr-march-armv9_1-a.d: Likewise.
* testsuite/gas/arm/attr-march-armv9_2-a.d: Likewise.
* testsuite/gas/arm/attr-march-armv9_3-a.d: Likewise.
* testsuite/gas/arm/attr-march-armv9_4-a.d: Likewise.
* testsuite/gas/arm/attr-march-armv9_5-a.d: Likewise.
* testsuite/gas/arm/attr-march-armv8m.base.d: Likewise.
* testsuite/gas/arm/attr-march-armv8m.main.d: Likewise.
* testsuite/gas/arm/attr-march-armv8m.main.dsp.d: Likewise.
* testsuite/gas/arm/attr-march-iwmmxt.d: Likewise.
* testsuite/gas/arm/attr-march-iwmmxt2.d: Likewise.
* testsuite/gas/arm/attr-march-xscale.d: Likewise.
* testsuite/gas/arm/attr-mcpu.d: Likewise.
* testsuite/gas/arm/attr-mfpu-arm1020e.d: Likewise.
* testsuite/gas/arm/attr-mfpu-arm1020t.d: Likewise.
* testsuite/gas/arm/attr-mfpu-arm1136jf-s.d: Likewise.
* testsuite/gas/arm/attr-mfpu-arm1136jfs.d: Likewise.
* testsuite/gas/arm/attr-mfpu-neon-fp16.d: Likewise.
* testsuite/gas/arm/attr-mfpu-neon.d: Likewise.
* testsuite/gas/arm/attr-mfpu-softvfp+vfp.d: Likewise.
* testsuite/gas/arm/attr-mfpu-softvfp.d: Likewise.
* testsuite/gas/arm/attr-mfpu-vfp.d: Likewise.
* testsuite/gas/arm/attr-mfpu-vfp10-r0.d: Likewise.
* testsuite/gas/arm/attr-mfpu-vfp10.d: Likewise.
* testsuite/gas/arm/attr-mfpu-vfp3.d: Likewise.
* testsuite/gas/arm/attr-mfpu-vfp9.d: Likewise.
* testsuite/gas/arm/attr-mfpu-vfpv2.d: Likewise.
* testsuite/gas/arm/attr-mfpu-vfpv3-d16.d: Likewise.
* testsuite/gas/arm/attr-mfpu-vfpv3.d: Likewise.
* testsuite/gas/arm/attr-mfpu-vfpv4-d16.d: Likewise.
* testsuite/gas/arm/attr-mfpu-vfpv4.d: Likewise.
* testsuite/gas/arm/attr-mfpu-vfpxd.d: Likewise.
* testsuite/gas/arm/attr-names.d: Likewise.
* testsuite/gas/arm/attr-non-null-terminated-string.d: Likewise.
* testsuite/gas/arm/attr-order.d: Likewise.
* testsuite/gas/arm/attr-override-cpu-directive.d: Likewise.
* testsuite/gas/arm/attr-override-mcpu.d: Likewise.
* testsuite/gas/arm/bl-local-2.d: Likewise.
* testsuite/gas/arm/bl-local-v4t.d: Likewise.
* testsuite/gas/arm/blx-local.d: Likewise.
* testsuite/gas/arm/branch-reloc.d: Likewise.
* testsuite/gas/arm/directives.d: Likewise.
* testsuite/gas/arm/got_prel.d: Likewise.
* testsuite/gas/arm/mapdir.d: Likewise.
* testsuite/gas/arm/mapmisc.d: Likewise.
* testsuite/gas/arm/mapsecs.d: Likewise.
* testsuite/gas/arm/mapshort-eabi.d: Likewise.
* testsuite/gas/arm/mov-highregs-any.d: Likewise.
* testsuite/gas/arm/mov-lowregs-any.d: Likewise.
* testsuite/gas/arm/note-march-armv2.d: Likewise.
* testsuite/gas/arm/note-march-armv2a.d: Likewise.
* testsuite/gas/arm/note-march-armv3.d: Likewise.
* testsuite/gas/arm/note-march-armv3m.d: Likewise.
* testsuite/gas/arm/note-march-armv4.d: Likewise.
* testsuite/gas/arm/note-march-armv4t.d: Likewise.
* testsuite/gas/arm/note-march-armv5.d: Likewise.
* testsuite/gas/arm/note-march-armv5t.d: Likewise.
* testsuite/gas/arm/note-march-armv5te.d: Likewise.
* testsuite/gas/arm/note-march-iwmmxt.d: Likewise.
* testsuite/gas/arm/note-march-iwmmxt2.d: Likewise.
* testsuite/gas/arm/note-march-xscale.d: Likewise.
* testsuite/gas/arm/pr12198-1.d: Likewise.
* testsuite/gas/arm/pr12198-2.d: Likewise.
* testsuite/gas/arm/thumb-eabi.d: Likewise.
* testsuite/gas/arm/thumb.d: Likewise.
* testsuite/gas/arm/thumbrel.d: Likewise.
* config/te-nacl.h: Removed.

ld/

* Makefile.am (ALL_EMULATION_SOURCES): Remove earmelf_nacl.c and
and earmelfb_nacl.c.
Remove NaCl dep files.
* NEWS: Mention NaCl target support removal.
* configure.tgt: Remove NaCl target support.
* Makefile.in: Regenerated.
* configure: Likewise.
* po/BLD-POTFILES.in: Likewise.
* emulparams/armelf_nacl.sh: Removed.
* emulparams/armelfb_nacl.sh: Likewise.
* emulparams/elf_nacl.sh: Likewise.
* testsuite/ld-arm/farcall-arm-nacl-pic.d: Likewise.
* testsuite/ld-arm/farcall-arm-nacl.d: Likewise.
* testsuite/ld-arm/farcall-data-nacl.d: Likewise.
* testsuite/ld-arm/farcall-thumb2-purecode-consecutive-veneer.d:
Adjusted.
* testsuite/ld-arm/arm-elf.exp: Remove NaCl target support.
* testsuite/ld-arm/cortex-a8-far.d: Likewise.
* testsuite/ld-arm/non-contiguous-arm3.d: Likewise.
* testsuite/ld-arm/non-contiguous-arm6.d: Likewise.
* testsuite/ld-elf/binutils.exp: Likewise.
* testsuite/ld-elf/build-id.exp: Likewise.
* testsuite/ld-elf/ehdr_start-missing.d: Likewise.
* testsuite/ld-elf/ehdr_start-shared.d: Likewise.
* testsuite/ld-elf/ehdr_start-userdef.d: Likewise.
* testsuite/ld-elf/ehdr_start-weak.d: Likewise.
* testsuite/ld-elf/ehdr_start.d: Likewise.
* testsuite/ld-elf/elf.exp: Likewise.
* testsuite/ld-elf/export-class.exp: Likewise.
* testsuite/ld-elf/fatal-warnings-1a.d: Likewise.
* testsuite/ld-elf/fatal-warnings-1b.d: Likewise.
* testsuite/ld-elf/orphan-region.d: Likewise.
* testsuite/ld-elf/package-note.exp: Likewise.
* testsuite/ld-elf/pr16322.d: Likewise.
* testsuite/ld-elf/pr16498a.d: Likewise.
* testsuite/ld-elf/pr16498b.d: Likewise.
* testsuite/ld-elf/pr19162.d: Likewise.
* testsuite/ld-elf/pr22269a.d: Likewise.
* testsuite/ld-elf/pr22269b.d: Likewise.
* testsuite/ld-elf/pr22393-1a.d: Likewise.
* testsuite/ld-elf/pr22393-1b.d: Likewise.
* testsuite/ld-elf/pr22393-1c.d: Likewise.
* testsuite/ld-elf/pr22393-1d.d: Likewise.
* testsuite/ld-elf/pr22393-1e.d: Likewise.
* testsuite/ld-elf/pr22393-1f.d: Likewise.
* testsuite/ld-elf/pr22393-2a.rd: Likewise.
* testsuite/ld-elf/pr22393-2b.rd: Likewise.
* testsuite/ld-elf/pr23900-1-32.rd: Likewise.
* testsuite/ld-elf/pr23900-1-64.rd: Likewise.
* testsuite/ld-elf/pr23900-1.d: Likewise.
* testsuite/ld-elf/pr23900-2a.d: Likewise.
* testsuite/ld-elf/pr23900-2b.d: Likewise.
* testsuite/ld-elf/pr30508.d: Likewise.
* testsuite/ld-elf/pr30907-1.d: Likewise.
* testsuite/ld-elf/pr30907-2.d: Likewise.
* testsuite/ld-elf/pr32341.d: Likewise.
* testsuite/ld-elf/shared.exp: Likewise.
* testsuite/ld-elf/tls.exp: Likewise.
* testsuite/ld-elf/tls_common.exp: Likewise.
* testsuite/ld-elfvers/vers.exp: Likewise.
* testsuite/ld-elfvsb/elfvsb.exp: Likewise.
* testsuite/ld-elfweak/elfweak.exp: Likewise.
* testsuite/ld-gc/gc.exp: Likewise.
* testsuite/ld-ifunc/binutils.exp: Likewise.
* testsuite/ld-pie/pie.exp: Likewise.
* testsuite/ld-plugin/lto-binutils.exp: Likewise.
* testsuite/ld-plugin/lto.exp: Likewise.
* testsuite/ld-scripts/rgn-at3.d: Likewise.
* testsuite/ld-shared/shared.exp: Likewise.
* testsuite/ld-size/size.exp: Likewise.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2 weeks agogold: Remove NaCl target support
H.J. Lu [Sat, 19 Jul 2025 20:55:56 +0000 (13:55 -0700)] 
gold: Remove NaCl target support

NaCl has been deprecated:

https://developer.chrome.com/docs/native-client/migration/

It is now in the process of being removed from llvm:

https://github.com/llvm/llvm-project/pull/133661

Remove NaCl target support from gold.

* Makefile.am (CCFILES): Remove nacl.cc.
(HFILES): Remove nacl.h.
* Makefile.in: Regenerated.
* aarch64.cc: Don't include nacl.h.
* arm.cc: Don't include nacl.h.
(Target_arm_nacl): Removed.
(Output_data_plt_arm_nacl): Likewise.
(target_selector_arm): Replace Target_arm_nacl with
Target_selector_arm.
* i386.cc: Don't include nacl.h.
(Output_data_plt_i386_nacl): Removed.
(Target_i386_nacl): Likewise.
(target_selector_i386): Replace Target_selector_i386_nacl with
Target_selector_i386.
* mips.cc: Don't include nacl.h.
(Target_mips_nacl): Removed.
(Target_selector_mips_nacl): Likewise.
(target_selector_mips32): Replace Target_selector_mips_nacl with
Target_selector_mips.
(target_selector_mips32el): Likewise.
(target_selector_mips64): Likewise.
(target_selector_mips64el): Likewise.
* nacl.cc: Removed.
* nacl.h: Likewise.
* x86_64.cc: Don't include nacl.h.
(Output_data_plt_x86_64_nacl): Removed.
(Target_x86_64_nacl): Likewise.
(target_selector_x86_64): Replace Target_x86_64_nacl with
Target_selector_x86_64.
(target_selector_x32): Likewise.
* po/POTFILES.in: Regenerated.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2 weeks agoAutomatic date update in version.in
GDB Administrator [Mon, 21 Jul 2025 00:00:39 +0000 (00:00 +0000)] 
Automatic date update in version.in

2 weeks agoAutomatic date update in version.in
GDB Administrator [Sun, 20 Jul 2025 00:01:29 +0000 (00:01 +0000)] 
Automatic date update in version.in

2 weeks agogprofng: do not skip weak symbols
Dmitrii Bordukov [Sat, 19 Jul 2025 12:21:46 +0000 (15:21 +0300)] 
gprofng: do not skip weak symbols

PR gprofng/33151

gprofng ignores functions that are compiled as weak symbols. This
heavily affects C++ class methods that are always compiled by g++
and clang++ as weak symbols. In this case 'gprofng display text'
just displays <static>@ADDRESS(<FILENAME>) instead of proper method
name.

The bug has been introduced in the commit 470a0288a818.

2 weeks ago[gdb/cli] Document \001 and \002 usage for set prompt
Tom de Vries [Sat, 19 Jul 2025 15:37:01 +0000 (17:37 +0200)] 
[gdb/cli] Document \001 and \002 usage for set prompt

PR cli/28887 reports the following problem when using a custom prompt.

First, we set up the custom prompt (with ^ marking the position of the
blinking cursor on the line above):
...
$ gdb -q -ex "set prompt \033[31mgdb$ \033[0m"
gdb$
     ^
...

Then we type some string, and enter it into the command history:
...
gdb$ some long command
❌️ Undefined command: "some".  Try "help".
gdb$
     ^
...

We use C-p to fetch the previous command:
...
gdb$ some long command
                      ^
...
Sofar, so good.

Finally, we use C-a which should move the cursor to just after the prompt, but
instead we get:
...
gdb$ some long command
              ^
...

This is fixed by using \001 and \002:
...
(gdb) set prompt \001\033[31m\002gdb$ \001\033[0m\002
...
aka as RL_PROMPT_START_IGNORE and RL_PROMPT_END_IGNORE [1].

Add an example to the documentation showing the use of these markers.

The added example is the equivalent of the "\[\e[0;34m\](gdb)\[\e[0m\]"
example documented at gdb.prompt.substitute_string that can be used with
"set extended-prompt".

While working on this, I noticed that "show prompt" doesn't show back the
original string, using '\e' instead of '\033':
...
gdb$ show prompt
Gdb's prompt is "\001\e[31m\002gdb$ \001\e[0m\002".
...
and that the shown string can't be used as an argument to "set prompt":
...
gdb$ set prompt \001\e[31m\002gdb$ \001\e[0m\002
e[31mgdb$ e[0m
...

I've filed this as PR cli/33184.

Approved-By: Eli Zaretskii <eliz@gnu.org>
[1] https://tiswww.case.edu/php/chet/readline/readline.html

2 weeks ago[gdb/testsuite] Restructure gdb.base/backtrace-through-cu-nodebug.exp
Tom de Vries [Sat, 19 Jul 2025 15:08:44 +0000 (17:08 +0200)] 
[gdb/testsuite] Restructure gdb.base/backtrace-through-cu-nodebug.exp

I noticed that the test names in test-case
gdb.base/backtrace-through-cu-nodebug.exp are a bit inconsistent:
...
PASS: $exp: no-cfi: maint frame-unwinder disable ARCH
PASS: $exp: verify no-filters unwind fail without CFI
PASS: $exp: maint flush register-cache
PASS: $exp: verify unwind fail without CFI
PASS: $exp: cfi: maint frame-unwinder disable ARCH
PASS: $exp: Verify unwinding works based only on CFI information
...

There's both a no-cfi prefix, and "without CFI".

Fix this by using proc_with_prefix, getting us a consistent prefix:
...
PASS: $exp: no-cfi: maint frame-unwinder disable ARCH
PASS: $exp: no-cfi: verify no-filters unwind fail
PASS: $exp: no-cfi: maint flush register-cache
PASS: $exp: no-cfi: verify unwind fail
PASS: $exp: cfi: maint frame-unwinder disable ARCH
PASS: $exp: cfi: Verify unwinding works
...

While we're at it, use multi_line to make a regexp more readable.

Tested on aarch64-linux.

Reviewed-By: Keith Seitz <keiths@redhat.com>
2 weeks ago[gdb/testsuite] Fix gdb.base/backtrace-through-cu-nodebug.exp without python support
Tom de Vries [Sat, 19 Jul 2025 15:08:44 +0000 (17:08 +0200)] 
[gdb/testsuite] Fix gdb.base/backtrace-through-cu-nodebug.exp without python support

With a gdb build without python support, and test-case
gdb.base/backtrace-through-cu-nodebug.exp I run into:
...
(gdb) bt^M
Required frame unwinder may have been disabled, \
  see 'maint info frame-unwinders'^M
(gdb) FAIL: $exp: verify unwind fail without CFI
...

With a gdb build with python support we have instead:
...
(gdb) bt^M
Python Exception <class 'gdb.error'>: \
  Required frame unwinder may have been disabled, \
  see 'maint info frame-unwinders'^M
(gdb) PASS: $exp: verify unwind fail without CFI
...
but if I change the "bt" into "bt -no-filters" I get the same FAIL and
corresponding output.

So there are two scenarios here.

In the first:
- the bt command is called
- frame #0 is printed
- trying to get the next frame fails and an error is thrown, aborting the
  backtrace
- the error is caught and printed

In the second:
- the bt command is called
- the frame filter is applied
- doing so triggers the same error, which is caught and printed by
  gdbpy_apply_frame_filter, returning EXT_LANG_BT_NO_FILTERS
- frame #0 is printed
- getting the next frame fails, and the backtrace stops

It seems worthwhile to exercise both scenarios if possible, so add a
"bt -no-filters" test.

Fix the FAIL by updating the regexp to allow both scenarios.

Tested on aarch64-linux.

Reviewed-By: Keith Seitz <keiths@redhat.com>
2 weeks ago[gdb/testsuite] Fix gdb.multi/pending-bp.exp without python support
Tom de Vries [Sat, 19 Jul 2025 15:08:44 +0000 (17:08 +0200)] 
[gdb/testsuite] Fix gdb.multi/pending-bp.exp without python support

With a gdb build without python support and test-case
gdb.multi/pending-bp.exp, I run into:
...
(gdb) python bp=[b for b in gdb.breakpoints() if b.number == 5][0]^M
Python scripting is not supported in this copy of GDB.^M
(gdb) FAIL: $exp: py_test_toggle_thread: find Python gdb.Breakpoint object
...

Fix this by requiring python support for part of the test-case.

Tested on aarch64-linux.

Reviewed-By: Keith Seitz <keiths@redhat.com>
2 weeks ago[gdb/testsuite] Fix gdb.base/break-dbg.exp without xml support
Tom de Vries [Sat, 19 Jul 2025 15:08:44 +0000 (17:08 +0200)] 
[gdb/testsuite] Fix gdb.base/break-dbg.exp without xml support

With a gdb build without xml support and test-case gdb.base/break-dbg.exp, I
run into:
...
(gdb) catch syscall^M
warning: Can not parse XML syscalls information; \
  XML support was disabled at compile time.^M
Catchpoint 11 (any syscall)^M
(gdb) FAIL: $exp: catch syscall
...

Fix this by updating the regexp.

Tested on aarch64-linux.

Reviewed-By: Keith Seitz <keiths@redhat.com>
2 weeks agoRe: RELOC_AGAINST_DISCARDED_SECTION zero size reloc sections
Alan Modra [Sat, 19 Jul 2025 05:57:04 +0000 (15:27 +0930)] 
Re: RELOC_AGAINST_DISCARDED_SECTION zero size reloc sections

Update the testsuite, so that is_generic ELF targets still do the
linkonce1 test (as linkonce3).

2 weeks agoAutomatic date update in version.in
GDB Administrator [Sat, 19 Jul 2025 00:01:16 +0000 (00:01 +0000)] 
Automatic date update in version.in

2 weeks agoRELOC_AGAINST_DISCARDED_SECTION zero size reloc sections
Alan Modra [Thu, 17 Jul 2025 23:56:10 +0000 (09:26 +0930)] 
RELOC_AGAINST_DISCARDED_SECTION zero size reloc sections

For some reason the initial implementation (commit 0672748ac053) of
this macro didn't allow discarding of all relocs in a section, perhaps
because doing so would require a testsuite change.  This patch allows
zero size relocation sections to result, and adjusts the testsuite.
i386, x86_64, ppc and ppc64 code that avoids a memmove is also changed
to allow zero size reloc sections, and arc fixed to actually adjust
the reloc section header.

2 weeks ago[gdb/testsuite] Fix gdb.arch/amd64-disp-step-self-call.exp on freebsd
Tom de Vries [Fri, 18 Jul 2025 17:51:46 +0000 (19:51 +0200)] 
[gdb/testsuite] Fix gdb.arch/amd64-disp-step-self-call.exp on freebsd

On x86_64-freebsd, with test-case gdb.arch/amd64-disp-step-self-call.exp, I
run into:
...
(gdb) continue
Continuing.

Program received signal SIGBUS, Bus error.
Object-specific hardware error.
0x000000080051492c in alarm () from /lib/libc.so.7
(gdb) FAIL: $exp: continue to breakpoint: test_call
...

The behaviour is not specific to gdb, it can be reproduced by running the
test-case executable:
...
$ ./outputs/gdb.arch/amd64-disp-step-self-call/amd64-disp-step-self-call
Bus error (core dumped)
$
...

The bus error happens when executing this instruction in alarm:
...
0000000000093910 <alarm>:
   ...
   9392c: 0f 29 45 d0                   movaps %xmm0, -0x30(%rbp)
...
because $rbp is not 16-byte aligned.

This can be fixed by adding the missing frame setup instructions at the start
of main in amd64-disp-step-self-call.S:
...
 main:
+ pushq %rbp
+ movq %rsp, %rbp
...

Instead, fix this by moving main from the assembly file to the c file, which
has the same effect.

Also remove the done label, which looks like a copy-past left-over.  Instead,
add an unreachable function and use it where appropriate.

Do the same for i386 case (which makes the source files identical for the
amd64 and i386 case, but I decided to leave it like that).

Tested on x86_64-freebsd and x86_64-linux.

2 weeks agogdb/testsuite: mark the start of each gdb.in.* log file
Andrew Burgess [Wed, 16 Jul 2025 14:30:48 +0000 (15:30 +0100)] 
gdb/testsuite: mark the start of each gdb.in.* log file

Emit a line in the gdb.log file each time a new gdb.in.NUM command log
is started.  The gdb.log line includes the full filename for the new
gdb.in.NUM file.

This change will make it trivial to go from a FAIL in the gdb.log file
to the gdb.in.NUM file that (should) reproduce the failure.  When I
encounter a failing test one of my first steps is usually to identify
the gdb.in.NUM file and try re-running it to see if that reproduces
the failure.  Some tests create many very similar gdb.in.NUM files, so
finding the exact one can sometimes be difficult.  With this patch
that task is now trivial.

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

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2 weeks agold: Limit PR ld/25617 tests to glibc targets
H.J. Lu [Thu, 17 Jul 2025 12:34:22 +0000 (05:34 -0700)] 
ld: Limit PR ld/25617 tests to glibc targets

Since PR ld/25617 tests expects glibc specific features, limit PR ld/25617
tests to glibc targets.

PR ld/33169
* testsuite/ld-elf/no-section-header.exp: Return if not glibc
targets.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2 weeks agoFix more unused variable warnings
Alan Modra [Fri, 18 Jul 2025 07:23:38 +0000 (16:53 +0930)] 
Fix more unused variable warnings

2 weeks agoFix unused variable warnings
Alan Modra [Fri, 18 Jul 2025 05:10:17 +0000 (14:40 +0930)] 
Fix unused variable warnings

2 weeks agoasan: undefined shift
Alan Modra [Fri, 18 Jul 2025 04:56:56 +0000 (14:26 +0930)] 
asan: undefined shift

 .bundle_align_mode 32
 nop
read.c:776:26: runtime error: shift exponent 32 is too large for
32-bit type 'unsigned int'

Avoid this by using wider types in the expressions.

2 weeks agovisium: use RELOC_AGAINST_DISCARDED_SECTION
Alan Modra [Thu, 17 Jul 2025 23:54:30 +0000 (09:24 +0930)] 
visium: use RELOC_AGAINST_DISCARDED_SECTION

The initial visium support added in commit d924db559be9 didn't make
use of RELOC_AGAINST_DISCARDED_SECTION, and so lacked code to remove
relocations in debug sections.

2 weeks agoMETAG_RELOC_AGAINST_DISCARDED_SECTION
Alan Modra [Thu, 17 Jul 2025 23:52:43 +0000 (09:22 +0930)] 
METAG_RELOC_AGAINST_DISCARDED_SECTION

Delete this macro which duplicates RELOC_AGAINST_DISCARDED_SECTION,
and instead add an rnone parameter to the standard version.

2 weeks agoAutomatic date update in version.in
GDB Administrator [Fri, 18 Jul 2025 00:01:20 +0000 (00:01 +0000)] 
Automatic date update in version.in

2 weeks ago[gdb/testsuite] Use pagination_prompt var more often
Tom de Vries [Thu, 17 Jul 2025 20:06:38 +0000 (22:06 +0200)] 
[gdb/testsuite] Use pagination_prompt var more often

In some test-cases, matching the pagination prompt is split up to address a
matching race but that's no longer necessary, thanks to commit c3f814a1433
("Fix paginate-*.exp races").

Fix this by using the pagination_prompt variable.

Tested on x86_64-linux.

Approved-By: Andrew Burgess <aburgess@redhat.com>
2 weeks ago[gdb/testsuite] Require minimum width in gdb.base/style.exp
Tom de Vries [Thu, 17 Jul 2025 20:06:38 +0000 (22:06 +0200)] 
[gdb/testsuite] Require minimum width in gdb.base/style.exp

In test-case gdb.base/style.exp, we have proc test_pagination_prompt_styling,
which:
- determines a "desired width" by parsing the output of "info files",
- sets width to the "desired width", and
- runs "info files" again.

The "desired width" on my system is 88, but if I override it to 65, I run
into:
...
(gdb) info files^M
Symbols from "^[[32;49;22;27m/data/vries/gdb/leap-15-6/build/gdb/testsuite/outputs/gdb.base/style/style^[[m".^M
--Type <RET> for more, q to quit, c to continue without paging--^M
^MFAIL: gdb.base/style.exp: check pagination prompt styling (timeout)
...
with make target check, and with check-read1 into:
...
(gdb) info files^M
Symbols from "^[[32;49;22;27m/data/vries/gdb/leap-15-6/build/gdb/testsuite/outputs/gdb.base/style/style^[[m".^M
--Type <RET> for more, q to quit, c to continue without paging--^M
^M^[[A^M
Native process:^M
        Using the running image of child process 6179.^M
--Type <RET> for more, q to quit, c to continue without paging--ERROR: Window too small.
UNRESOLVED: gdb.base/style.exp: check pagination prompt styling
...

This is caused by the following.

The size of the pagination prompt is 64:
...
         1         2         3         4         5         6
1234567890123456789012345678901234567890123456789012345678901234
--Type <RET> for more, q to quit, c to continue without paging--
...
and because we have TERM=ansi and width == 65, readline wraps at 64:
...
(gdb) maint info screen
Number of characters gdb thinks are in a line is 65.
Number of characters readline reports are in a line is 64.
...

In other words, readline wraps when printing the pagination prompt.

This causes some unusual output, and the test is not prepared to handle this.

Fix this by requiring that desired_width is at least
<length of pagination prompt> + 2.

Tested on x86_64-linux.

Approved-By: Andrew Burgess <aburgess@redhat.com>
PR testsuite/33167
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33167

2 weeks ago[gdb/testsuite] Fix regexp in gdb.base/style.exp
Tom de Vries [Thu, 17 Jul 2025 20:06:38 +0000 (22:06 +0200)] 
[gdb/testsuite] Fix regexp in gdb.base/style.exp

In test-case gdb.base/style.exp, we have proc test_pagination_prompt_styling,
which:
- determines a "desired width" by parsing the output of "info files",
- sets width to the "desired width", and
- runs "info files" again.

The "desired width" on my system is 88, but if I override it to 66, I run into:
...
FAIL: gdb.base/style.exp: check pagination prompt styling
...
due to the test classifying this line as a bad line:
...
  $hex - $hex is .init_array in --Type <RET> for more, ...
...

This is due to a bug in this regexp:
...
    # For lines that don't match this pattern, we cannot comment on
    # where the style reset should occur, so lets just claim the line
    # is fine.
    if { ![regexp "\\s+$::hex - $::hex is \[^\r\n\]+ in " $str] } {
return true
    }
...
which is supposed to determine whether the line needs to contain a style
reset.

For aforementioned line, the regexp matches, so the test concludes that the
line should have a style reset, and because it hasn't, it classifies it as a
bad line.

Fix this by making the regexp more strict:
...
    if { ![regexp "\\s+$::hex - $::hex is \[^\r\n\]+ in \033" $str] } {
...

Tested on x86_64-linux.

Approved-By: Andrew Burgess <aburgess@redhat.com>
2 weeks ago[gdb/testsuite] Stabilize test name in gdb.base/style.exp
Tom de Vries [Thu, 17 Jul 2025 20:06:38 +0000 (22:06 +0200)] 
[gdb/testsuite] Stabilize test name in gdb.base/style.exp

With test-case gdb.base/style.exp, I get:
...
PASS: gdb.base/style.exp: set width 88
...

The 88 is not a constant, it's a variable:
...
gdb_test_no_output "set width $desired_width"
...
which is calculated by parsing the output of "info files".

When running with target board unix/-m32, I get instead:
...
PASS: gdb.base/style.exp: set width 67
...

Stabilize the test name by using instead:
...
PASS: gdb.base/style.exp: set width to desired width
...

Tested on x86_64-linux.

Approved-By: Andrew Burgess <aburgess@redhat.com>
2 weeks agogdb/risc-v: fix ISA string detection for disassembly
Marek Pikuła [Wed, 28 May 2025 11:54:47 +0000 (13:54 +0200)] 
gdb/risc-v: fix ISA string detection for disassembly

Commit 3f61a38 introduced a regression where the ISA string was no
longer detected based on the ELF header. The mechanism was changed from
directly referencing `abfd` to using `disassembler_info->section`, which
was not properly initialized for RISC-V.

The previous implementation ignored the object in scope, leading to
issues such as failing to decode RVV instructions when a library was
compiled as `rv64gcv` and the main application as `rv64gc`.

This patch resolves both problems by initializing
`disassembler_info->section` with the object currently in scope,
ensuring correct ISA string detection during disassembly.

Approved-By: Andrew Burgess <aburgess@redhat.com>
2 weeks agogdb: fix formatting in solib.c
Simon Marchi [Thu, 17 Jul 2025 12:30:41 +0000 (08:30 -0400)] 
gdb: fix formatting in solib.c

Change-Id: I7ae1ca4a822ecc2805025fac59a22af5d2a41166

2 weeks agobinutils: drop unused note_size, contents, old variables
Sam James [Thu, 17 Jul 2025 12:18:05 +0000 (13:18 +0100)] 
binutils: drop unused note_size, contents, old variables

GCC trunk recently had improvements to its -Wunused-but-set-variable which
picked up that contents and hence note_size & old aren't used at all in the
end.

* objcopy.c (merge_gnu_build_notes): Drop unused 'note_size', 'contents',
and 'old' variables.

2 weeks agobfd: drop unused elt_no
Sam James [Thu, 17 Jul 2025 12:16:31 +0000 (13:16 +0100)] 
bfd: drop unused elt_no

GCC trunk recently had improvements to its -Wunused-but-set-variable which
picked up that elt_no isn't used at all in the end.

* archive.c (_bfd_compute_and_write_armap): Drop unused elt_no.

2 weeks agoRemove sframe relocs against discarded sections
Alan Modra [Thu, 17 Jul 2025 05:12:31 +0000 (14:42 +0930)] 
Remove sframe relocs against discarded sections

Commit d7f343eaad3f testsuite change resulted in a regression for
s390x-linux.  This extends the x86_64 fix to other targets.

PR ld/33156
* elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Remove .sframe
relocs too.

2 weeks agoreadelf v850 notes
Alan Modra [Wed, 16 Jul 2025 23:27:11 +0000 (08:57 +0930)] 
readelf v850 notes

This patch was prompted by a clang warning:
readelf.c:23317:37: warning: pointer comparison always evaluates to false [-Wtautological-compare]
 23317 |           || inote.namedata + inote.namesz < inote.namedata)
       |                                            ^

Use the same sanity checks as used by process_notes_at.  (See commit
5396a86e4396).  While we are at it, print all the v850 note info in
one place to properly handle error conditions.

2 weeks agoAutomatic date update in version.in
GDB Administrator [Thu, 17 Jul 2025 00:01:17 +0000 (00:01 +0000)] 
Automatic date update in version.in

2 weeks agogdb: remove unused includes in break-*.c
Simon Marchi [Wed, 16 Jul 2025 14:48:17 +0000 (10:48 -0400)] 
gdb: remove unused includes in break-*.c

These are reported as unused by clangd.

Change-Id: I80871e08b9d29c540f61d6ea91904197faf92065

2 weeks agogas: improve --gsframe documentation
Sam James [Wed, 16 Jul 2025 05:59:14 +0000 (06:59 +0100)] 
gas: improve --gsframe documentation

I omitted documentation in 8aad677a12832885acd5be1de8f41e740b8e713d in
error. Rectify that with:
1) changing ---help to mention bare `--gsframe` too, as we're not
   getting rid of that;

2) adding the new --gsframe=[no|yes] form to as.texi.

PR gas/33125
* gas/as.c (parse_args): Tweak --gsframe= help text.
* gas/doc/as.texi: Document --gsframe=[no|yes].

2 weeks agox86-64: Remove sframe relocs against discarded sections
H.J. Lu [Tue, 15 Jul 2025 02:41:25 +0000 (10:41 +0800)] 
x86-64: Remove sframe relocs against discarded sections

Since unlike eh_frame editing code, sframe editing code keeps
R_X86_64_NONE reloc as is, its r_offset is wrong, we must not
generate R_X86_64_NONE reloc in sframe section against discarded
sections for "ld -r".

bfd/

PR ld/33156
* elf64-x86-64.c (elf_x86_64_relocate_section): Also remove
sframe relocations against discarded sections for "ld -r".

ld/

PR ld/33156
* testsuite/ld-elf/eh-group.exp (as_gsframe): New.
Assemble eh-group.o with $as_gsframe.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2 weeks agox86: Decouple AMX-AVX512 from AVX10.2 and imply AVX512F
Haochen Jiang [Tue, 15 Jul 2025 06:11:37 +0000 (14:11 +0800)] 
x86: Decouple AMX-AVX512 from AVX10.2 and imply AVX512F

In ISE058, the AVX10.2 imply is removed from AMX-AVX512. This
leads to re-consideration on the imply for AMX-AVX512.

Since it is using zmm register and using zmm register only, we
need to at least imply AVX512F. AVX512VL is not needed since it
is not using xmm/ymms.

On the other hand, if we imply AVX10.1 for AMX-AVX512, disabling
avx10.1 will lead to disabling AMX-AVX512. This would be a surprise
for users.

Based on the two reasons above, the patch is decoupling AMX-AVX512
from AVX10.2 and imply AVX512F.

opcodes/ChangeLog:

* i386-gen.c: Imply AVX512F instead of AVX10.2.
* i386-init.h: Regenerated.

2 weeks agoAutomatic date update in version.in
GDB Administrator [Wed, 16 Jul 2025 00:00:42 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 weeks agoUpdated translations for various sub-directories
Nick Clifton [Tue, 15 Jul 2025 12:37:09 +0000 (13:37 +0100)] 
Updated translations for various sub-directories

3 weeks agoOnly parse attributes in ELF sections with the SHT_GNU_ATTRIBUTES type if the OS...
Rainer Orth [Tue, 15 Jul 2025 10:15:46 +0000 (11:15 +0100)] 
Only parse attributes in ELF sections with the SHT_GNU_ATTRIBUTES type if the OS is not Solaris.  Set the is_solaris flag for Sparc solaris

PR 33153

3 weeks agogas: Re-indent case OPTION_SFRAME:
H.J. Lu [Tue, 15 Jul 2025 02:16:40 +0000 (10:16 +0800)] 
gas: Re-indent case OPTION_SFRAME:

PR gas/33125
* gas/as.c (parse_args): Re-indent case OPTION_SFRAME:

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
3 weeks agogas: support --gsframe=no
Sam James [Thu, 3 Jul 2025 11:53:22 +0000 (12:53 +0100)] 
gas: support --gsframe=no

Being able to explicitly disable SFrames on the command line is useful,
especially when looking at a gas that enables SFrames by default. The
binutils testsuite will benefit from this as there's testcases that don't
expect their presence.

In summary:
* Nothing is passed       => no SFrames (no change from before)
* --gsframe is passed     => SFrames    (no change from before)
* --gsframe=yes is passed => SFrames    (previously rejected)
* --gsframe-no  is passed => no SFrames (previously rejected)

PR gas/33125
* gas/as.c (parse_args): Accept --gsframe=no, --gsframe=yes.

3 weeks agoRevert "gas: support --gsframe=no"
Sam James [Tue, 15 Jul 2025 00:29:22 +0000 (01:29 +0100)] 
Revert "gas: support --gsframe=no"

This reverts commit e6b2368b9556ea6298a1f0de97baeabf1b5b18fd.

I made a last minute style change and oopsed it.

3 weeks agogas: support --gsframe=no
Sam James [Thu, 3 Jul 2025 11:53:22 +0000 (12:53 +0100)] 
gas: support --gsframe=no

Being able to explicitly disable SFrames on the command line is useful,
especially when looking at a gas that enables SFrames by default. The
binutils testsuite will benefit from this as there's testcases that don't
expect their presence.

In summary:
* Nothing is passed       => no SFrames (no change from before)
* --gsframe is passed     => SFrames    (no change from before)
* --gsframe=yes is passed => SFrames    (previously rejected)
* --gsframe-no  is passed => no SFrames (previously rejected)

PR gas/33125
* gas/as.c (parse_args): Accept --gsframe=no, --gsframe=yes.

3 weeks agolibsframe: relax the assertion limit for fre_start_addr
Indu Bhagat [Tue, 15 Jul 2025 00:01:53 +0000 (17:01 -0700)] 
libsframe: relax the assertion limit for fre_start_addr

Fix PR ld/33131 Failed assertion when linking gccgo

Make amendments in both sframe_decoder_get_fre and
sframe_encoder_add_fre.

Since GNU as and the dw2gencfi code generally accepts such CFI, its best
to allow in SFrame FREs too.

libsframe/
PR ld/33131.
* sframe.c (sframe_decoder_get_fre): Relax the assertion a bit.
(sframe_encoder_add_fre): Likewise.

3 weeks agoAutomatic date update in version.in
GDB Administrator [Tue, 15 Jul 2025 00:00:40 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 weeks agosframe: Allow input R_*_NONE relocations
H.J. Lu [Sat, 12 Jul 2025 20:56:16 +0000 (04:56 +0800)] 
sframe: Allow input R_*_NONE relocations

"ld -r" generates R_*_NONE relocations in sframe section if input
relocations in sframe section are against discarded section.  Allow
input R_*_NONE relocations if there are more relocation entries than
SFrame entries, instead of assuming number of SFrame entries == number
of relocation entries.

bfd/

PR ld/33127
* elf-sframe.c (sframe_decoder_init_func_bfdinfo): Allow input
R_*_NONE relocations if there are more relocation entries than
SFrame entries.

ld/

PR ld/33127
* testsuite/ld-x86-64/sframe-reloc-2a.s: New file.
* testsuite/ld-x86-64/sframe-reloc-2b.s: Likewise.
* testsuite/ld-x86-64/x86-64.exp: Run PR ld/33127 tests.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
3 weeks agogdb/amd64-linux-tdep: add missing space
Simon Marchi [Mon, 14 Jul 2025 18:12:46 +0000 (14:12 -0400)] 
gdb/amd64-linux-tdep: add missing space

Change-Id: I4e15eae9791329f71321a9b00d682e22dd6e2f6d

3 weeks agoUpdated Ukranian translation for the opcodes sub-directory
Nick Clifton [Mon, 14 Jul 2025 15:54:15 +0000 (16:54 +0100)] 
Updated Ukranian translation for the opcodes sub-directory

3 weeks agoMore updates to the 'how to make a release' documentation
Nick Clifton [Mon, 14 Jul 2025 15:43:24 +0000 (16:43 +0100)] 
More updates to the 'how to make a release' documentation

3 weeks agoUpdated Ukranian translation for the binutils sub-directory
Nick Clifton [Mon, 14 Jul 2025 15:42:04 +0000 (16:42 +0100)] 
Updated Ukranian translation for the binutils sub-directory

3 weeks agoUpdated Spanish translation for the gas sub-directory
Nick Clifton [Mon, 14 Jul 2025 15:39:36 +0000 (16:39 +0100)] 
Updated Spanish translation for the gas sub-directory

3 weeks agos390x sframe regressions
Alan Modra [Mon, 14 Jul 2025 09:38:12 +0000 (19:08 +0930)] 
s390x sframe regressions

Commit 6ab3f09a682a resulted in regressions.
s390x-linux-gnu  FAIL: SFrame simple link
s390x-linux-gnu  FAIL: SFrame for plt0 and pltN

Commit 939eb467b21d exposed the problem further.
s390x-linux-gnu  FAIL: LTO 4a
s390x-linux-gnu  FAIL: LTO 4c
s390x-linux-gnu  FAIL: LTO 4d

* elf64-s390.c (elf_s390_create_dynamic_sections): Set plt_sframe
ELF section type.

Reviewed-by: Jens Remus <jremus@linux.ibm.com>
3 weeks agogas deferrred diags leak
Alan Modra [Mon, 14 Jul 2025 09:58:14 +0000 (19:28 +0930)] 
gas deferrred diags leak

asan complains when running the gas all/cond-diag test.

* read.c (deferred_diag_head, deferred_diag_tail): Renamed
from deferred_diags and last_deferred_diag, making the tail
pointer a deferred_diag**.
(s_errwarn_if): Simplify appending to list.  Free unused diag
on error.
(evaluate_deferred_diags): Free list.

3 weeks agoDelete AM_PO_SUBDIRS invocation
Alan Modra [Mon, 14 Jul 2025 06:55:29 +0000 (16:25 +0930)] 
Delete AM_PO_SUBDIRS invocation

These aren't needed since commit 862776f26a59.

3 weeks agogas/NEWS: Corrected the information about mapping symbol $x for risc-v
Nelson Chu [Mon, 14 Jul 2025 01:45:07 +0000 (09:45 +0800)] 
gas/NEWS: Corrected the information about mapping symbol $x for risc-v

3 weeks agogas: accept leading zeros on dollar local labels in z80 sdcc compat mode
Aaron Griffith [Mon, 14 Jul 2025 08:38:52 +0000 (10:38 +0200)] 
gas: accept leading zeros on dollar local labels in z80 sdcc compat mode

SDCC assembly output uses 5-digit numeric dollar sign labels, padded
with zeros. Commit 226749d made these invalid, and broke the Z80 SDCC
compatibility mode in GAS.

https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=226749d5a6ff0d5c607d6428d6c81e1e7e7a994b

This restores SDCC compatibility by replacing the leading zeros with
spaces when inside dollar local labels and when SDCC compatibility is
enabled. It also restores the SDCC test case to represent actual
syntax emitted by SDCC, and adds a note explaining the purpose of
the test.

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

3 weeks agold: Clear map_head_is_link_order for .gnu_object_only
H.J. Lu [Sun, 13 Jul 2025 21:21:32 +0000 (05:21 +0800)] 
ld: Clear map_head_is_link_order for .gnu_object_only

Clear map_head_is_link_order when generating .gnu_object_only section so
that lang_add_section can add new sections and .sframe sections will be
properly merged by _bfd_elf_merge_section_sframe.

PR ld/33146
* ldlang.c (cmdline_emit_object_only_section): Clear
map_head_is_link_order.
* testsuite/ld-plugin/lto.exp (as_gsframe): New.
(lto_link_tests): Add $as_gsframe to compile lto-4b.o and
lto-4c.o.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
3 weeks agoRe: gas: Move gas_sframe_check to binutils-common.exp
Alan Modra [Sun, 13 Jul 2025 23:23:07 +0000 (08:53 +0930)] 
Re: gas: Move gas_sframe_check to binutils-common.exp

PR ld/33146

Correct TCL errors trying to access error output file in commit
ef7a634dc01d.  In fact, get rid of the output file test entirely since
gas exit status is sufficient.

Also there is no need to firstly check for ELF support.

Set check_as_sframe_result, and remove ld-lib.exp check_as_sframe.

3 weeks agoAutomatic date update in version.in
GDB Administrator [Mon, 14 Jul 2025 00:01:10 +0000 (00:01 +0000)] 
Automatic date update in version.in

3 weeks agogas: Move gas_sframe_check to binutils-common.exp
H.J. Lu [Sun, 13 Jul 2025 20:45:43 +0000 (04:45 +0800)] 
gas: Move gas_sframe_check to binutils-common.exp

Move gas_sframe_check to binutils-common.exp so that it can be used in
linker tests to check if a target assembler supports --gsframe.

binutils/

PR ld/33146
* testsuite/lib/binutils-common.exp (gas_sframe_check): Moved
from cfi-sframe.exp.  Replace gas_host_run with remote_exec.

gas/

PR ld/33146
* testsuite/gas/cfi-sframe/cfi-sframe.exp (gas_sframe_check):
Moved to binutils-common.exp.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>