Commit Graph

122950 Commits

Author SHA1 Message Date
GDB Administrator
d5edf1c21e Automatic date update in version.in 2025-09-09 00:04:16 +00:00
GDB Administrator
2f028c6bb1 Automatic date update in version.in 2025-09-08 00:03:57 +00:00
GDB Administrator
6fd1b8869d Automatic date update in version.in 2025-09-07 00:03:03 +00:00
GDB Administrator
2cbbcf6903 Automatic date update in version.in 2025-09-06 00:01:31 +00:00
GDB Administrator
978a82d472 Automatic date update in version.in 2025-09-05 00:04:11 +00:00
GDB Administrator
a775c454fd Automatic date update in version.in 2025-09-04 00:02:40 +00:00
Alan Modra
316da476e6 visium MAX_MEM_FOR_RS_ALIGN_CODE
Commit 7ca6020a4e "tidy target HANDLE_ALIGN" didn't account for
the "fix" amount emitted by visium_handle_align.  This didn't show up
as a problem due to frag alignment hiding the error, until I started
messing with struct frag.

	* config/tc-visium.h (MAX_MEM_FOR_RS_ALIGN_CODE): Correct.

(cherry picked from commit 74fe8e29dc)
2025-09-03 18:22:42 +09:30
GDB Administrator
9318e6a711 Automatic date update in version.in 2025-09-03 00:04:16 +00:00
GDB Administrator
3af34f64c6 Automatic date update in version.in 2025-09-02 00:03:29 +00:00
H.J. Lu
b58f54a9bd strip: Don't treat fat IR objects as plugin object
Fat IR objects contains both regular sections and IR sections.  After

commit 717a38e9a0
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sun May 4 05:12:46 2025 +0800

    strip: Add GCC LTO IR support

"strip --strip-debug" no longer strips debug sections in fat IR objects
since fat IR objects are recognized as plugin object and copied as unknown
objects.  Add a is_strip_input field to bfd to indicate called from strip.
Update bfd_check_format_matches not to treat archive member nor standalone
fat IR object as IR object so that strip can remove debug and IR sections
in fat IR object.  For archive member, it is copied as an unknown object
if the plugin target is in use or it is a slim IR object.  For standalone
fat IR object, it is copied as non-IR object.

bfd/

	PR binutils/33246
	* archive.c: Include "plugin-api.h" and "plugin.h" if plugin is
	enabled.
	(_bfd_compute_and_write_armap): Don't complain plugin is needed
	when the plugin target is in use.
	* bfd-in2.h: Regenerated.
	* bfd.c (bfd): Add is_strip_input.
	* format.c (bfd_set_lto_type): If there is .llvm.lto section,
	set LTO type to lto_fat_ir_object.
	(bfd_check_format_matches): Don't set LTO type when setting
	format.  When called from strip, don't treat archive member nor
	standalone fat IR object as an IR object.
	* plugin.c (bfd_plugin_get_symbols_in_object_only): Copy LTO
	type derived from input sections.

nm/

	PR binutils/33246
	* nm.c (filter_symbols): Don't complain plugin is needed when
	the plugin target is in use.
	(display_rel_file): Likewise.
	* objcopy.c (copy_archive): Set the BFD is_strip_input field of
	archive member to 1 to indicate called from strip.  Also copy
	slim IR archive member as unknown object.
	(copy_file): Set the BFD is_strip_input field of input bfd to
	1 to indicate called from strip.
	(strip_main): Keep .gnu.debuglto_* sections unless all GCC LTO
	sections will be removed.

ld/

	PR binutils/33246
	* testsuite/ld-plugin/lto-binutils.exp (run_pr33246_test): New.
	Run binutils/33246 tests with GCC and Clang.
	* testsuite/ld-plugin/pr33246.c: New file.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
(cherry picked from commit c2729c37f1)
2025-09-01 10:08:08 +01:00
H.J. Lu
a71a4df76e strip: Treat "default" output_target as unspecified
Treat output target as unspecified if it is set to "default".

binutils/

	PR binutils/33230
	* objcopy.c (copy_file): Treat "default" output_target as
	unspecified.

binutils/testsuite/

	PR binutils/33230
	* binutils-all/x86-64/x86-64.exp (run_pr33230_test): New.
	Run binutils/33230 tests with readelf if supported.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
(cherry picked from commit 3ac83564eb)
2025-09-01 10:08:07 +01:00
H.J. Lu
96114b5c14 strip: Don't check target_defaulted in input BFD
The target_defaulted field in BFD is set to true if the target isn't
specified.  After

commit 717a38e9a0
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sun May 4 05:12:46 2025 +0800

    strip: Add GCC LTO IR support

the target is set to "plugin" if BFD supports plugin when the target
isn't specified nor default.  Update strip to check the input target,
instead of the target_defaulted field in input BFD.

	PR binutils/33230
	* objcopy.c (copy_object): Add a bool argument, target_defaulted,
	to indicate if the input target isn't specified nor default.
	Check it instead of ibfd->target_defaulted.
	(copy_archive): Add a bool argument, target_defaulted, and pass
	it to copy_object.
	(copy_file): Set target_defaulted to true if the input target
	isn't specified and pass it to copy_archive and copy_object.
	* testsuite/binutils-all/x86-64/pr33230.obj.bz2: New file.
	* testsuite/binutils-all/x86-64/x86-64.exp: Run PR binutils/33230
	tests.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
(cherry picked from commit 8e885fece1)
2025-09-01 10:08:07 +01:00
GDB Administrator
df1308e0b7 Automatic date update in version.in 2025-09-01 00:03:00 +00:00
GDB Administrator
ef8c763b8b Automatic date update in version.in 2025-08-31 00:04:45 +00:00
GDB Administrator
1bedae230a Automatic date update in version.in 2025-08-30 00:03:57 +00:00
GDB Administrator
af16f505af Automatic date update in version.in 2025-08-29 00:04:27 +00:00
GDB Administrator
9cba46df92 Automatic date update in version.in 2025-08-28 00:03:11 +00:00
GDB Administrator
fc95eb7d27 Automatic date update in version.in 2025-08-27 00:05:33 +00:00
GDB Administrator
6814c32617 Automatic date update in version.in 2025-08-26 00:02:51 +00:00
GDB Administrator
987d48b9a6 Automatic date update in version.in 2025-08-25 00:02:34 +00:00
GDB Administrator
2d85ad14e1 Automatic date update in version.in 2025-08-24 00:05:24 +00:00
GDB Administrator
6ba189448e Automatic date update in version.in 2025-08-23 00:03:31 +00:00
GDB Administrator
a493256cb9 Automatic date update in version.in 2025-08-22 00:03:02 +00:00
GDB Administrator
28d7a4cb74 Automatic date update in version.in 2025-08-21 00:03:21 +00:00
GDB Administrator
5b9787e553 Automatic date update in version.in 2025-08-20 00:03:54 +00:00
GDB Administrator
bc86c2516f Automatic date update in version.in 2025-08-19 00:02:06 +00:00
GDB Administrator
10f0fcba67 Automatic date update in version.in 2025-08-18 00:03:57 +00:00
GDB Administrator
d83820a69b Automatic date update in version.in 2025-08-17 00:03:14 +00:00
GDB Administrator
f3723832ff Automatic date update in version.in 2025-08-16 00:00:59 +00:00
GDB Administrator
6c446c9250 Automatic date update in version.in 2025-08-15 00:02:19 +00:00
GDB Administrator
a9f71f0ab6 Automatic date update in version.in 2025-08-14 00:03:20 +00:00
GDB Administrator
ea1d8c6f1b Automatic date update in version.in 2025-08-13 00:04:33 +00:00
GDB Administrator
7fbf3ab518 Automatic date update in version.in 2025-08-12 00:02:59 +00:00
GDB Administrator
1110d77764 Automatic date update in version.in 2025-08-11 00:04:09 +00:00
Nick Alcock
2b2e51a31e libctf: link: rejig lazy opening to not need weak symbols
The ctf_link_add_ctf API function has a 'lazy opening' feature whereby,
if you pass in the file but not a CTF archive, the archive is opened
as late as possible during links.  This is valuable mostly in
cu-mapped links (a feature not accessible via GNU ld), where it
ensures that, rather than eventually needing memory for the original
link inputs, the smushed-together cu-mapped intermediate outputs,
*and* the final output, we only need enough memory for the smushed-
together outputs, the final output, and one input, since the inputs
can be closed immediately after they are smushed together.

(In GNU ld, the feature is useless because it loads all sections into
memory anyway.)

The lazy-opening feature uses libctf's ctf_open function, which uses
BFD: so it is not available in libctf-nobfd -- except that I thought I
had a cunning trick, and used a weak symbol so that if you linked
libctf-nobfd into your program and then also linked in bfd, the feature
stayed enabled.

This is silly -- if your program is licensed such that you can link in
BFD, you can just link in libctf.so and not bother with libctf-nobfd.so
in the first place.  Worse, the weak symbol usage broke MacOS builds,
since MacOS's system compiler uses a different means of introducing weak
symbols.  We could test for and use it, but this is the only place in
libctf to use weak symbols at all, and the feature of lazy-opening with
libctf-nobfd is so marginal we might as well drop it: it's almost
certain there are zero users, certainly fewer users than users of MacOS
with the system compiler.

While we're at it, simplify things by deleting the never-implemented
feature (not exposed in the API) to allow linking together raw buffers
of CTF data.  If we need it we can bring it back, but all it's doing
right now is complicating the code to no end at all.

libctf/
	PR libctf/33194
	* ctf-link.c (ctf_open): Delete weak pragma.
	(ctf_link_add): Fuse with...
	(ctf_link_add_ctf): ... this function.  Drop BUF, N args
	and corresponding unimplemented feature warnings.  Only check
	NOBFD to see whether lazy loading is available, not PIC as
	well.
	(ctf_link_lazy_open): Likewise.

(cherry picked from commit d3e582895b)
2025-08-10 22:19:50 +01:00
Nick Alcock
ae8c1b4241 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.

(cherry picked from commit 4983bb052d)
2025-08-10 22:19:46 +01:00
Rainer Orth
e54a1de951 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.

(cherry picked from commit 4214ca9036)
2025-08-10 22:19:42 +01:00
Nick Alcock
32830073ea 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.

(cherry picked from commit 3ff8956e4b)
2025-08-10 22:19:37 +01:00
Rainer Orth
404cb58a92 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.

(cherry picked from commit 00d853d1fe)
2025-08-10 22:19:30 +01:00
GDB Administrator
f57c0f1971 Automatic date update in version.in 2025-08-10 00:01:04 +00:00
GDB Administrator
49475a630d Automatic date update in version.in 2025-08-09 00:02:25 +00:00
Xi Ruoyao
99f48156dd LoongArch: Fix symbol size after relaxation
There's a logic error in loongarch_relax_perform_deletes: when there's
not any delete operation of which the start address is strictly smaller
than the symbol address, splay_tree_predecessor() will return nullptr
and the symbol size will be unchanged even if some bytes of it are
removed.

Make the logic more complete to fix this issue.  Also factor out the
symbol size adjustment logic into a function to avoid code bloating.

Tested-by: WANG Xuerui <git@xen0n.name>
Signed-off-by: Xi Ruoyao <xry111@xry111.site>
2025-08-08 16:52:19 +08:00
GDB Administrator
da5f23c8d1 Automatic date update in version.in 2025-08-08 00:00:57 +00:00
Matthieu Longo
d45e8bff0b libiberty: sync with gcc
Import the following commits from GCC as of r16-3056-gca2169c65bd169:
	0d0837df697 libiberty: disable logging of list content for doubly-linked list tests
2025-08-07 10:37:17 +01:00
GDB Administrator
a41e36fbe2 Automatic date update in version.in 2025-08-07 00:03:05 +00:00
GDB Administrator
67bd36f276 Automatic date update in version.in 2025-08-06 00:02:38 +00:00
GDB Administrator
2627fd0dcc Automatic date update in version.in 2025-08-05 00:03:20 +00:00
GDB Administrator
7fa8679826 Automatic date update in version.in 2025-08-04 00:01:56 +00:00
GDB Administrator
0effed6eae Automatic date update in version.in 2025-08-03 00:01:55 +00:00
Alan Modra
b09f71c1c4 Re: resbin: don't pass NULL as printf %s arg
Commit c6c8d0b821 went completely the wrong way.  "key" needs to be
NULL as that reads a different type of data.

	PR 33244
	* resbin.c (get_version_header): Don't pass a NULL key on to
	toosmall.
	(bin_to_res_version): Restore NULL key cases.

(cherry picked from commit 891d1654d7)
2025-08-02 10:21:27 +09:30