13 Commits

Author SHA256 Message Date
Michael Matz
f011f32384 Add fix for PR33584 2025-11-03 15:08:19 +01:00
Michael Matz
247b898044 Add a missing .changes entry (PR32560) 2025-11-03 14:43:37 +01:00
Michael Matz
7f5bdd7845 aarch64: old codestreams: disable -zgcs=implicit 2025-10-28 15:15:48 +01:00
Michael Matz
8af7f3089c Fix invalid code in SLE due to revert-rela.diff
recent upstream changes interact with our old-codestream
patch, applying relocs twice.  Adjust the patch for that.
2025-10-21 18:26:26 +02:00
Michael Matz
8b847e6213 Forgot changes for last commit 2025-10-20 14:21:40 +02:00
Michael Matz
7244503582 Move work arounds for overactive source validator 2025-10-20 14:20:03 +02:00
Michael Matz
7b6542686a Make fix-branch not a rpm patch
those are checked by the source validator and that
doesn't like empty patches (with only a comment).
2025-10-16 18:04:32 +02:00
Michael Matz
6cfd341cf4 Some more entries for .changes 2025-10-16 17:15:44 +02:00
Michael Matz
7e547f2ea3 Random change to maybe trigger the push into obs 2025-10-15 18:14:34 +02:00
Michael Matz
63924a4252 Backport some post-2.45 changes, update .changes 2025-10-15 16:17:44 +02:00
Michael Matz
bc42a9e0ec deal with gprofng not being built
in the .la file remove section
2025-10-14 18:54:34 +02:00
Michael Matz
8058c6c39d Deal with "lp160" in %release 2025-10-14 18:51:54 +02:00
Michael Matz
9c48666d53 update to 2.45 2025-10-14 18:33:53 +02:00
27 changed files with 943 additions and 345 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -1,16 +0,0 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEEOiS8Ho+0CfqfFDcYE/zvid2ePE8FAmaviv8ACgkQE/zvid2e
PE9C2hAAw9RCvIe7c6zdMBslwnHm5lJE4P8OLgfvQhW1LyNMM7q6UtJC0oG1mCAk
qpfDkp62XXXLu8QUVvuGhLOrAC7PkkwRs+RKaidOmQ1DDaFsh6h1EilbRbeXhwT6
+GgL9gmoflWQ+/VTi8ETc6F0kxfbOFLDgWQf8LZ66g9Z5RzoUaRfcktljjPpmgvh
kp2V/8QsY6rTtJDpTfSp5ysvvfkuh0DQBN/aOlnjcbupaj2p2aBrs0PiAmtiNfGZ
616FCFytqNYX8KxVV3OZcTOCKARcFxXc/4q1za+0musaqLHGlw8h27jTEU51lQJy
gemDWIJbVoth/jK4/pIl7rsiLte136qj6JybsAh3LLM7JTcwf9rha0DyU0nBmSyt
4PfzOsoSRjfIBTTPlmS7L2thY8+Y0sYPcIf8lj8ue9YZyYYSix/8KUm/0vvmwJr8
XUiw0sUpGcSUTFjqhNxcjqORSQBWb9kjRod+PdU9LEFE4cp3mexkzjIgEWDkRjqP
sTdstNT1A5LiX5XhcMKVze9D28y2XQRxkbvbBbm4nt4cIBvk1QtsZZH4bR5ABgyF
q8kp0FpBrbvOBTDQsuAuvL9lOg5unngZLAOeogxsOJblirzX6cPku5NDQgY7GYUP
SIEOJaMU5OoI6NU9iVt1LBZZaMO6+16PTNQ2MArgI0g2B1HNC3U=
=vvKA
-----END PGP SIGNATURE-----

BIN
binutils-2.45-branch.diff.gz LFS Normal file

Binary file not shown.

BIN
binutils-2.45.tar.bz2 LFS Normal file

Binary file not shown.

16
binutils-2.45.tar.bz2.sig Normal file
View File

@@ -0,0 +1,16 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEEOiS8Ho+0CfqfFDcYE/zvid2ePE8FAmiF7ngACgkQE/zvid2e
PE/Cag/+KRBcMQcx/SFDtI85IQ/bCV5DpMyxGJLdNSBF8kCUYPGVkIqHXMfhiGNX
3lQN2EsqPmuIlz1lQ54bUEKYF6BXOaHCwvbXAVZPesux4RXSBWz5UqNdHmRWo4Me
04kRUW+npeG8m/rXh+sGJq+PRH2xRJYfXB7ag175qrZWSrnb+2RHIs03x+jBcMeM
yBEgixHRSDVpxpZk0K5aEkEVYkKtRXKi7reAXdF83smL6G5luzyNq8zE6GTtkxwq
GVQlrbsSW50ZHMuHUDPMhv0m2su3VLyTrFb0HTR+nxptPD3b8MOmRRhLa6lFsLi5
kTtnC4bHgNTtl6XObF+jOs2jHE1lvXCnEB5Yalqry/9704ed8FhS6nTuTnk/GhUT
j5Rg/WLSG2FbSigRptm8e2+6VikdtojYY0yYXlBEiRGi1RTyVD34XBDehIJrZKrX
9IO9qcl+muuMLCeIlWg+mbpPXxDImOFgo/W3/GSBTa1pwPCT84lMDhH938f77Uji
Nw8oFqYcSxswhBP2yuEIdyXzBb7RqIAeTqv+Sg9dIk2WXqdIx+pbM6UQNDSL+dH7
gPhJXNVUHkrjPcwQadY928+09SxF4n7Kwtb+zKUjwZbvXBk79ohrZhTN+/0bCpQn
05ohimItPiL/D6GIoeUKMXXcD4DN4s2RKMLSvcbDnmx+5kWccK8=
=Z+Db
-----END PGP SIGNATURE-----

View File

@@ -3,11 +3,12 @@ This adjusts some testcases that expect new behaviour:
* that separate-code is default
- this also implies that default max-page-size is 0x1000, instead of the
old 0x200000, so some testcases need to encode that as well
diff --git a/ld/testsuite/ld-elf/linux-x86.exp b/ld/testsuite/ld-elf/linux-x86.exp
index 2e0cbd37f17..fcd3dd920e4 100644
--- a/ld/testsuite/ld-elf/linux-x86.exp
+++ b/ld/testsuite/ld-elf/linux-x86.exp
@@ -275,7 +275,7 @@ proc check_pr25749a {testname srcfilea srcfileb cflags ldflags lderror} {
* aarch64: don't enable '-z gcs=implicit' by default
Index: binutils-2.45/ld/testsuite/ld-elf/linux-x86.exp
===================================================================
--- binutils-2.45.orig/ld/testsuite/ld-elf/linux-x86.exp 2025-07-27 01:00:00.000000000 +0200
+++ binutils-2.45/ld/testsuite/ld-elf/linux-x86.exp 2025-10-28 15:10:38.085247199 +0100
@@ -324,7 +324,7 @@ proc check_pr25749a {testname srcfilea s
}
# Suppress warning for unsupported attribute from older GCC.
@@ -16,7 +17,7 @@ index 2e0cbd37f17..fcd3dd920e4 100644
exec cp $srcdir/$subdir/$srcfilea $srcfilea
exec chmod +w $srcfilea
@@ -396,7 +396,7 @@ proc check_pr25749b {testname srcfilea srcfileb cflags ldflags dsoldflags args}
@@ -445,7 +445,7 @@ proc check_pr25749b {testname srcfilea s
[list \
"Build lib${testname}.so ($dsoldflags)" \
"-shared $dsoldflags tmpdir/pr25749-bin.o -z noexecstack" \
@@ -25,10 +26,10 @@ index 2e0cbd37f17..fcd3dd920e4 100644
[list $srcfileb] \
{{readelf {-Wr} pr25749.rd}} \
"lib${testname}.so" \
diff --git a/ld/testsuite/ld-i386/report-reloc-1.d b/ld/testsuite/ld-i386/report-reloc-1.d
index 162161592a1..ee96047043d 100644
--- a/ld/testsuite/ld-i386/report-reloc-1.d
+++ b/ld/testsuite/ld-i386/report-reloc-1.d
Index: binutils-2.45/ld/testsuite/ld-i386/report-reloc-1.d
===================================================================
--- binutils-2.45.orig/ld/testsuite/ld-i386/report-reloc-1.d 2025-07-27 01:00:00.000000000 +0200
+++ binutils-2.45/ld/testsuite/ld-i386/report-reloc-1.d 2025-10-28 15:10:38.085247199 +0100
@@ -1,6 +1,6 @@
#source: report-reloc-1.s
#as: --32
@@ -37,10 +38,10 @@ index 162161592a1..ee96047043d 100644
#warning_output: report-reloc-1.l
#readelf: -r --wide
diff --git a/ld/testsuite/ld-x86-64/report-reloc-1-x32.d b/ld/testsuite/ld-x86-64/report-reloc-1-x32.d
index 63fe7b1bb8a..29a94ff8762 100644
--- a/ld/testsuite/ld-x86-64/report-reloc-1-x32.d
+++ b/ld/testsuite/ld-x86-64/report-reloc-1-x32.d
Index: binutils-2.45/ld/testsuite/ld-x86-64/report-reloc-1-x32.d
===================================================================
--- binutils-2.45.orig/ld/testsuite/ld-x86-64/report-reloc-1-x32.d 2025-07-27 01:00:00.000000000 +0200
+++ binutils-2.45/ld/testsuite/ld-x86-64/report-reloc-1-x32.d 2025-10-28 15:10:38.085247199 +0100
@@ -1,6 +1,6 @@
#source: report-reloc-1.s
#as: --x32
@@ -49,10 +50,10 @@ index 63fe7b1bb8a..29a94ff8762 100644
#warning_output: report-reloc-1.l
#readelf: -r --wide
diff --git a/ld/testsuite/ld-x86-64/report-reloc-1.d b/ld/testsuite/ld-x86-64/report-reloc-1.d
index 69f164c9434..63079acc98a 100644
--- a/ld/testsuite/ld-x86-64/report-reloc-1.d
+++ b/ld/testsuite/ld-x86-64/report-reloc-1.d
Index: binutils-2.45/ld/testsuite/ld-x86-64/report-reloc-1.d
===================================================================
--- binutils-2.45.orig/ld/testsuite/ld-x86-64/report-reloc-1.d 2025-07-27 01:00:00.000000000 +0200
+++ binutils-2.45/ld/testsuite/ld-x86-64/report-reloc-1.d 2025-10-28 15:10:38.085247199 +0100
@@ -1,6 +1,6 @@
#source: report-reloc-1.s
#as: --64
@@ -61,3 +62,29 @@ index 69f164c9434..63079acc98a 100644
#warning_output: report-reloc-1.l
#readelf: -r --wide
Index: binutils-2.45/ld/emultempl/aarch64elf.em
===================================================================
--- binutils-2.45.orig/ld/emultempl/aarch64elf.em 2025-07-27 01:00:00.000000000 +0200
+++ binutils-2.45/ld/emultempl/aarch64elf.em 2025-10-28 15:10:38.085247199 +0100
@@ -37,7 +37,7 @@ static int no_apply_dynamic_relocs = 0;
static aarch64_protection_opts sw_protections = {
.plt_type = PLT_NORMAL,
.bti_report = MARKING_WARN,
- .gcs_type = GCS_IMPLICIT,
+ .gcs_type = GCS_NEVER,
.gcs_report = MARKING_WARN,
.gcs_report_dynamic = MARKING_UNSET,
};
Index: binutils-2.45/ld/testsuite/ld-aarch64/protections/gcs-1-b.d
===================================================================
--- binutils-2.45.orig/ld/testsuite/ld-aarch64/protections/gcs-1-b.d 2025-07-27 01:00:00.000000000 +0200
+++ binutils-2.45/ld/testsuite/ld-aarch64/protections/gcs-1-b.d 2025-10-28 15:11:41.600313675 +0100
@@ -3,7 +3,7 @@
#source: gcs2.s
#alltargets: [check_shared_lib_support] *linux*
#as: -march=armv9.4-a+gcs -defsym __property_gcs__=1
-#ld: -shared
+#ld: -shared -z gcs=implicit
#readelf: -n
Displaying notes found in: .note.gnu.property

View File

@@ -1,8 +1,8 @@
Index: binutils-2.42/gas/config/tc-i386.c
Index: binutils-2.45/gas/config/tc-i386.c
===================================================================
--- binutils-2.42.orig/gas/config/tc-i386.c 2024-01-29 01:00:00.000000000 +0100
+++ binutils-2.42/gas/config/tc-i386.c 2024-02-05 17:54:33.515139672 +0100
@@ -2992,13 +2992,17 @@ set_cpu_arch (int dummy ATTRIBUTE_UNUSED
--- binutils-2.45.orig/gas/config/tc-i386.c 2025-07-27 01:00:00.000000000 +0200
+++ binutils-2.45/gas/config/tc-i386.c 2025-10-14 15:39:39.574328233 +0200
@@ -3413,11 +3413,15 @@ set_cpu_arch (int dummy ATTRIBUTE_UNUSED
{
check_cpu_arch_compatible (string, cpu_arch[j].enable);
@@ -15,11 +15,8 @@ Index: binutils-2.42/gas/config/tc-i386.c
- as_bad (_("64bit mode not supported on `%s'."),
+ as_warn (_("64bit mode not supported on `%s' (consider swapping .arch and .code directives)."),
cpu_arch[j].name);
- (void) restore_line_pointer (e);
+ /*(void) restore_line_pointer (e);
ignore_rest_of_line ();
- return;
+ return;*/
- goto restore_bad;
+ /*goto restore_bad;*/
}
if (flag_code == CODE_32BIT && !cpu_arch[j].enable.bitfield.cpui386)

View File

@@ -1,22 +0,0 @@
This is used to manually patch the bison generated files when
the binutils-X.YZ-branch.diff touches them. That diff is generated
directly from git and doesn't contain the generated .c/h files.
The base tarball does contain them, but generated from the unpatched state.
In SLE12 and older we can't regenerate them due to too old versions
of flex and bison.
So, when the branch diff _does_ touch them we need to do the regeneration
via such a manual patch.
Index: binutils-2.43/ld/ldgram.c
===================================================================
--- binutils-2.43.orig/ld/ldgram.c 2024-08-04 01:00:00.000000000 +0200
+++ binutils-2.43/ld/ldgram.c 2024-12-09 16:41:08.089715376 +0100
@@ -2839,7 +2839,7 @@ yyreduce:
case 73: /* ifile_p1: SEARCH_DIR '(' filename ')' */
#line 324 "ldgram.y"
- { ldfile_add_library_path ((yyvsp[-1].name), search_dir_linker_script); }
+ { ldfile_add_library_path ((yyvsp[-1].name), false); }
#line 2844 "ldgram.c"
break;

View File

@@ -0,0 +1,9 @@
This is used to manually patch the bison generated files when
the binutils-X.YZ-branch.diff touches them. That diff is generated
directly from git and doesn't contain the generated .c/h files.
The base tarball does contain them, but generated from the unpatched state.
In SLE12 and older we can't regenerate them due to too old versions
of flex and bison.
So, when the branch diff _does_ touch them we need to do the regeneration
via such a manual patch.
For now this is intentionally empty.

View File

@@ -4,23 +4,23 @@ file with symbol names. ld errors on the '@' characters. Until
those packages are fixed we use this patch. We have to carry it
for old code streams forever.
diff --git a/binutils/nm.c b/binutils/nm.c
index 2637756c647..253714ef179 100644
--- a/binutils/nm.c
+++ b/binutils/nm.c
@@ -666,7 +666,7 @@ print_symname (const char *form, struct extended_symbol_info *info,
name = convert_utf8 (name);
}
Index: binutils-2.45/binutils/nm.c
===================================================================
--- binutils-2.45.orig/binutils/nm.c 2025-10-14 15:49:38.923457582 +0200
+++ binutils-2.45/binutils/nm.c 2025-10-14 15:52:19.461171123 +0200
@@ -717,7 +717,7 @@ print_symname (const char *form, struct
if (unicode_display != unicode_default)
name = convert_utf8 (name);
- if (info != NULL && info->elfinfo && with_symbol_versions)
+ if (info != NULL && info->elfinfo && with_symbol_versions && 0)
{
const char *version_string;
bool hidden;
diff --git a/ld/testsuite/ld-elf/pr25708.d b/ld/testsuite/ld-elf/pr25708.d
index 60b8e31807a..1b62e25347e 100644
--- a/ld/testsuite/ld-elf/pr25708.d
+++ b/ld/testsuite/ld-elf/pr25708.d
Index: binutils-2.45/ld/testsuite/ld-elf/pr25708.d
===================================================================
--- binutils-2.45.orig/ld/testsuite/ld-elf/pr25708.d 2025-07-27 01:00:00.000000000 +0200
+++ binutils-2.45/ld/testsuite/ld-elf/pr25708.d 2025-10-14 15:52:19.461171123 +0200
@@ -2,8 +2,9 @@
#ld: -shared -version-script pr13195.t
#nm: -D --with-symbol-versions

View File

@@ -79,11 +79,11 @@ Date: Tue Feb 13 07:34:22 2018 -0800
* testsuite/ld-x86-64/pr22791-2c.s: Likewise.
* testsuite/ld-x86-64/x86-64.exp: Run PR ld/22791 tests.
Index: binutils-2.42/bfd/elf64-x86-64.c
Index: binutils-2.45/bfd/elf64-x86-64.c
===================================================================
--- binutils-2.42.orig/bfd/elf64-x86-64.c 2024-01-29 01:00:00.000000000 +0100
+++ binutils-2.42/bfd/elf64-x86-64.c 2024-01-30 16:57:58.483994137 +0100
@@ -1981,6 +1981,24 @@ elf_x86_64_convert_load_reloc (bfd *abfd
--- binutils-2.45.orig/bfd/elf64-x86-64.c 2025-10-14 15:54:33.605441586 +0200
+++ binutils-2.45/bfd/elf64-x86-64.c 2025-10-14 15:59:55.169884230 +0200
@@ -2480,6 +2480,24 @@ elf_x86_64_convert_load_reloc (bfd *abfd
return true;
}
@@ -108,7 +108,7 @@ Index: binutils-2.42/bfd/elf64-x86-64.c
/* Look through the relocs for a section during the first phase, and
calculate needed space in the global offset table, and procedure
linkage table. */
@@ -3337,9 +3355,6 @@ elf_x86_64_relocate_section (bfd *output
@@ -3897,9 +3915,6 @@ elf_x86_64_relocate_section (bfd *output
&& (eh == NULL
|| !UNDEFINED_WEAK_RESOLVED_TO_ZERO (info,
eh)))
@@ -118,7 +118,7 @@ Index: binutils-2.42/bfd/elf64-x86-64.c
|| (no_copyreloc_p
&& h->def_dynamic
&& !(h->root.u.def.section->flags & SEC_CODE))))
@@ -3348,20 +3363,25 @@ elf_x86_64_relocate_section (bfd *output
@@ -3908,20 +3923,25 @@ elf_x86_64_relocate_section (bfd *output
|| bfd_link_dll (info)))
{
bool fail = false;
@@ -148,7 +148,7 @@ Index: binutils-2.42/bfd/elf64-x86-64.c
}
else if (no_copyreloc_p || bfd_link_dll (info))
{
@@ -3370,9 +3390,10 @@ elf_x86_64_relocate_section (bfd *output
@@ -3930,9 +3950,10 @@ elf_x86_64_relocate_section (bfd *output
relocations against default and protected
symbols since address of protected function
and location of protected data may not be in
@@ -161,102 +161,25 @@ Index: binutils-2.42/bfd/elf64-x86-64.c
}
if (fail)
Index: binutils-2.42/gas/config/tc-i386.c
Index: binutils-2.45/gas/config/tc-i386.c
===================================================================
--- binutils-2.42.orig/gas/config/tc-i386.c 2024-01-29 01:00:00.000000000 +0100
+++ binutils-2.42/gas/config/tc-i386.c 2024-01-30 16:58:57.504959847 +0100
@@ -10699,55 +10699,12 @@ output_branch (void)
frag_var (rs_machine_dependent, 5, i.reloc[0], subtype, sym, off, p);
}
-#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)
-/* Return TRUE iff PLT32 relocation should be used for branching to
- symbol S. */
-
-static bool
-need_plt32_p (symbolS *s)
-{
- /* PLT32 relocation is ELF only. */
- if (!IS_ELF)
- return false;
-
-#ifdef TE_SOLARIS
- /* Don't emit PLT32 relocation on Solaris: neither native linker nor
- krtld support it. */
- return false;
-#endif
-
- /* Since there is no need to prepare for PLT branch on x86-64, we
- can generate R_X86_64_PLT32, instead of R_X86_64_PC32, which can
- be used as a marker for 32-bit PC-relative branches. */
- if (!object_64bit)
- return false;
-
- if (s == NULL)
- return false;
-
- /* Weak or undefined symbol need PLT32 relocation. */
- if (S_IS_WEAK (s) || !S_IS_DEFINED (s))
- return true;
-
- /* Non-global symbol doesn't need PLT32 relocation. */
- if (! S_IS_EXTERNAL (s))
- return false;
-
- /* Other global symbols need PLT32 relocation. NB: Symbol with
- non-default visibilities are treated as normal global symbol
- so that PLT32 relocation can be used as a marker for 32-bit
- PC-relative branches. It is useful for linker relaxation. */
- return true;
-}
-#endif
-
static void
output_jump (void)
--- binutils-2.45.orig/gas/config/tc-i386.c 2025-10-14 15:53:39.665528626 +0200
+++ binutils-2.45/gas/config/tc-i386.c 2025-10-14 16:01:49.677822350 +0200
@@ -11591,6 +11591,10 @@ output_branch (void)
static bool
need_plt32_p (symbolS *s)
{
char *p;
int size;
fixS *fixP;
- bfd_reloc_code_real_type jump_reloc = i.reloc[0];
if (i.tm.opcode_modifier.jump == JUMP_BYTE)
{
@@ -10821,17 +10778,8 @@ output_jump (void)
abort ();
}
-#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)
- if (flag_code == CODE_64BIT && size == 4
- && jump_reloc == NO_RELOC && i.op[0].disps->X_add_number == 0
- && need_plt32_p (i.op[0].disps->X_add_symbol))
- jump_reloc = BFD_RELOC_X86_64_PLT32;
-#endif
-
- jump_reloc = reloc (size, 1, 1, jump_reloc);
-
fixP = fix_new_exp (frag_now, p - frag_now->fr_literal, size,
- i.op[0].disps, 1, jump_reloc);
+ i.op[0].disps, 1, reloc (size, 1, 1, i.reloc[0]));
/* All jumps handled here are signed, but don't unconditionally use a
signed limit check for 32 and 16 bit jumps as we want to allow wrap
@@ -15083,12 +15031,6 @@ md_estimate_size_before_relax (fragS *fr
reloc_type = (enum bfd_reloc_code_real) fragP->fr_var;
else if (size == 2)
reloc_type = BFD_RELOC_16_PCREL;
-#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)
- else if (fragP->tc_frag_data.code == CODE_64BIT
- && fragP->fr_offset == 0
- && need_plt32_p (fragP->fr_symbol))
- reloc_type = BFD_RELOC_X86_64_PLT32;
-#endif
else
reloc_type = BFD_RELOC_32_PCREL;
Index: binutils-2.42/gas/testsuite/gas/i386/ilp32/reloc64.d
+ /* This is for old SUSE enterprise code-streams: dont emit
+ PLT32 for branches. */
+ return false;
+
#ifdef TE_SOLARIS
/* Don't emit PLT32 relocation on Solaris: neither native linker nor
krtld support it. */
Index: binutils-2.45/gas/testsuite/gas/i386/ilp32/reloc64.d
===================================================================
--- binutils-2.42.orig/gas/testsuite/gas/i386/ilp32/reloc64.d 2024-01-29 01:00:00.000000000 +0100
+++ binutils-2.42/gas/testsuite/gas/i386/ilp32/reloc64.d 2024-01-30 16:57:58.487327524 +0100
--- binutils-2.45.orig/gas/testsuite/gas/i386/ilp32/reloc64.d 2025-07-27 01:00:00.000000000 +0200
+++ binutils-2.45/gas/testsuite/gas/i386/ilp32/reloc64.d 2025-10-14 15:59:55.171884264 +0200
@@ -17,7 +17,7 @@ Disassembly of section \.text:
.*[ ]+R_X86_64_PC8[ ]+xtrn\+0x0*1
.*[ ]+R_X86_64_PC32[ ]+xtrn-0x0*4
@@ -266,10 +189,10 @@ Index: binutils-2.42/gas/testsuite/gas/i386/ilp32/reloc64.d
.*[ ]+R_X86_64_PC8[ ]+xtrn-0x0*1
.*[ ]+R_X86_64_GOT32[ ]+xtrn
.*[ ]+R_X86_64_GOT32[ ]+xtrn
Index: binutils-2.42/gas/testsuite/gas/i386/ilp32/x86-64-branch.d
Index: binutils-2.45/gas/testsuite/gas/i386/ilp32/x86-64-branch.d
===================================================================
--- binutils-2.42.orig/gas/testsuite/gas/i386/ilp32/x86-64-branch.d 2024-01-29 01:00:00.000000000 +0100
+++ binutils-2.42/gas/testsuite/gas/i386/ilp32/x86-64-branch.d 2024-01-30 16:57:58.487327524 +0100
--- binutils-2.45.orig/gas/testsuite/gas/i386/ilp32/x86-64-branch.d 2025-07-27 01:00:00.000000000 +0200
+++ binutils-2.45/gas/testsuite/gas/i386/ilp32/x86-64-branch.d 2025-10-14 15:59:55.171884264 +0200
@@ -20,9 +20,9 @@ Disassembly of section .text:
[ ]*[a-f0-9]+: 66 ff 20 data16 jmp \*\(%rax\)
[ ]*[a-f0-9]+: e8 00 00 00 00 call (0x)?1f <.*> 1b: R_X86_64_PC32 \*ABS\*\+0x10003c
@@ -283,10 +206,10 @@ Index: binutils-2.42/gas/testsuite/gas/i386/ilp32/x86-64-branch.d
[ ]*[a-f0-9]+: 66 c3 data16 ret
[ ]*[a-f0-9]+: 66 c2 08 00 data16 ret \$0x8
[ ]*[a-f0-9]+: 3e 74 03[ ]+je,pt +[0-9a-fx]+ <.*>
Index: binutils-2.42/gas/testsuite/gas/i386/reloc64.d
Index: binutils-2.45/gas/testsuite/gas/i386/reloc64.d
===================================================================
--- binutils-2.42.orig/gas/testsuite/gas/i386/reloc64.d 2024-01-29 01:00:00.000000000 +0100
+++ binutils-2.42/gas/testsuite/gas/i386/reloc64.d 2024-01-30 16:57:58.487327524 +0100
--- binutils-2.45.orig/gas/testsuite/gas/i386/reloc64.d 2025-07-27 01:00:00.000000000 +0200
+++ binutils-2.45/gas/testsuite/gas/i386/reloc64.d 2025-10-14 15:59:55.171884264 +0200
@@ -20,7 +20,7 @@ Disassembly of section \.text:
.*[ ]+R_X86_64_PC8[ ]+xtrn\+0x0*1
.*[ ]+R_X86_64_PC32[ ]+xtrn-0x0*4
@@ -296,10 +219,10 @@ Index: binutils-2.42/gas/testsuite/gas/i386/reloc64.d
.*[ ]+R_X86_64_PC8[ ]+xtrn-0x0*1
.*[ ]+R_X86_64_GOT64[ ]+xtrn
.*[ ]+R_X86_64_GOT32[ ]+xtrn
Index: binutils-2.42/gas/testsuite/gas/i386/x86-64-branch-2.d
Index: binutils-2.45/gas/testsuite/gas/i386/x86-64-branch-2.d
===================================================================
--- binutils-2.42.orig/gas/testsuite/gas/i386/x86-64-branch-2.d 2024-01-29 01:00:00.000000000 +0100
+++ binutils-2.42/gas/testsuite/gas/i386/x86-64-branch-2.d 2024-01-30 16:57:58.487327524 +0100
--- binutils-2.45.orig/gas/testsuite/gas/i386/x86-64-branch-2.d 2025-07-27 01:00:00.000000000 +0200
+++ binutils-2.45/gas/testsuite/gas/i386/x86-64-branch-2.d 2025-10-14 15:59:55.171884264 +0200
@@ -9,12 +9,12 @@ Disassembly of section .text:
0+ <bar-0xb>:
@@ -315,10 +238,10 @@ Index: binutils-2.42/gas/testsuite/gas/i386/x86-64-branch-2.d
[ ]*[a-f0-9]+: 66 c3 retw
[ ]*[a-f0-9]+: 66 c2 08 00 retw \$0x8
#pass
Index: binutils-2.42/gas/testsuite/gas/i386/x86-64-jump.d
Index: binutils-2.45/gas/testsuite/gas/i386/x86-64-jump.d
===================================================================
--- binutils-2.42.orig/gas/testsuite/gas/i386/x86-64-jump.d 2024-01-29 01:00:00.000000000 +0100
+++ binutils-2.42/gas/testsuite/gas/i386/x86-64-jump.d 2024-01-30 16:57:58.487327524 +0100
--- binutils-2.45.orig/gas/testsuite/gas/i386/x86-64-jump.d 2025-07-27 01:00:00.000000000 +0200
+++ binutils-2.45/gas/testsuite/gas/i386/x86-64-jump.d 2025-10-14 15:59:55.171884264 +0200
@@ -9,7 +9,7 @@ Disassembly of section .text:
0+ <.text>:
@@ -337,10 +260,10 @@ Index: binutils-2.42/gas/testsuite/gas/i386/x86-64-jump.d
[ ]*[a-f0-9]+: ff 14 25 00 00 00 00 call \*0x0 3d: R_X86_64_32S xxx
[ ]*[a-f0-9]+: ff d7 call \*%rdi
[ ]*[a-f0-9]+: ff 17 call \*\(%rdi\)
Index: binutils-2.42/gas/testsuite/gas/i386/x86-64-nop-3.d
Index: binutils-2.45/gas/testsuite/gas/i386/x86-64-nop-3.d
===================================================================
--- binutils-2.42.orig/gas/testsuite/gas/i386/x86-64-nop-3.d 2024-01-29 01:00:00.000000000 +0100
+++ binutils-2.42/gas/testsuite/gas/i386/x86-64-nop-3.d 2024-01-30 16:57:58.487327524 +0100
--- binutils-2.45.orig/gas/testsuite/gas/i386/x86-64-nop-3.d 2025-07-27 01:00:00.000000000 +0200
+++ binutils-2.45/gas/testsuite/gas/i386/x86-64-nop-3.d 2025-10-14 15:59:55.171884264 +0200
@@ -18,5 +18,5 @@ Disassembly of section .text:
Disassembly of section .altinstr_replacement:
@@ -348,10 +271,10 @@ Index: binutils-2.42/gas/testsuite/gas/i386/x86-64-nop-3.d
- +[a-f0-9]+: e9 00 00 00 00 jmp 5 <_start\+0x5> 1: R_X86_64_PLT32 foo-0x4
+ +[a-f0-9]+: e9 00 00 00 00 jmp 5 <_start\+0x5> 1: R_X86_64_PC32 foo-0x4
#pass
Index: binutils-2.42/gas/testsuite/gas/i386/x86-64-nop-4.d
Index: binutils-2.45/gas/testsuite/gas/i386/x86-64-nop-4.d
===================================================================
--- binutils-2.42.orig/gas/testsuite/gas/i386/x86-64-nop-4.d 2024-01-29 01:00:00.000000000 +0100
+++ binutils-2.42/gas/testsuite/gas/i386/x86-64-nop-4.d 2024-01-30 16:57:58.487327524 +0100
--- binutils-2.45.orig/gas/testsuite/gas/i386/x86-64-nop-4.d 2025-07-27 01:00:00.000000000 +0200
+++ binutils-2.45/gas/testsuite/gas/i386/x86-64-nop-4.d 2025-10-14 15:59:55.171884264 +0200
@@ -21,5 +21,5 @@ Disassembly of section .altinstr_replace
+[a-f0-9]+: 89 c0 mov %eax,%eax
+[a-f0-9]+: 89 c0 mov %eax,%eax
@@ -359,10 +282,10 @@ Index: binutils-2.42/gas/testsuite/gas/i386/x86-64-nop-4.d
- +[a-f0-9]+: e9 00 00 00 00 jmp b <_start\+0xb> 7: R_X86_64_PLT32 foo-0x4
+ +[a-f0-9]+: e9 00 00 00 00 jmp b <_start\+0xb> 7: R_X86_64_PC32 foo-0x4
#pass
Index: binutils-2.42/gas/testsuite/gas/i386/x86-64-nop-5.d
Index: binutils-2.45/gas/testsuite/gas/i386/x86-64-nop-5.d
===================================================================
--- binutils-2.42.orig/gas/testsuite/gas/i386/x86-64-nop-5.d 2024-01-29 01:00:00.000000000 +0100
+++ binutils-2.42/gas/testsuite/gas/i386/x86-64-nop-5.d 2024-01-30 16:57:58.487327524 +0100
--- binutils-2.45.orig/gas/testsuite/gas/i386/x86-64-nop-5.d 2025-07-27 01:00:00.000000000 +0200
+++ binutils-2.45/gas/testsuite/gas/i386/x86-64-nop-5.d 2025-10-14 15:59:55.171884264 +0200
@@ -24,5 +24,5 @@ Disassembly of section .altinstr_replace
+[a-f0-9]+: 89 c0 mov %eax,%eax
+[a-f0-9]+: 89 c0 mov %eax,%eax
@@ -370,10 +293,10 @@ Index: binutils-2.42/gas/testsuite/gas/i386/x86-64-nop-5.d
- +[a-f0-9]+: e9 00 00 00 00 jmp d <_start\+0xd> 9: R_X86_64_PLT32 foo-0x4
+ +[a-f0-9]+: e9 00 00 00 00 jmp d <_start\+0xd> 9: R_X86_64_PC32 foo-0x4
#pass
Index: binutils-2.42/gas/testsuite/gas/i386/x86-64-relax-2.d
Index: binutils-2.45/gas/testsuite/gas/i386/x86-64-relax-2.d
===================================================================
--- binutils-2.42.orig/gas/testsuite/gas/i386/x86-64-relax-2.d 2024-01-29 01:00:00.000000000 +0100
+++ binutils-2.42/gas/testsuite/gas/i386/x86-64-relax-2.d 2024-01-30 16:57:58.487327524 +0100
--- binutils-2.45.orig/gas/testsuite/gas/i386/x86-64-relax-2.d 2025-07-27 01:00:00.000000000 +0200
+++ binutils-2.45/gas/testsuite/gas/i386/x86-64-relax-2.d 2025-10-14 15:59:55.171884264 +0200
@@ -11,12 +11,12 @@ Disassembly of section .text:
0+ <foo>:
[ ]*[a-f0-9]+: eb 24 jmp 26 <local>
@@ -392,10 +315,10 @@ Index: binutils-2.42/gas/testsuite/gas/i386/x86-64-relax-2.d
0+22 <hidden_def>:
[ ]*[a-f0-9]+: c3 ret
Index: binutils-2.42/gas/testsuite/gas/i386/x86-64-relax-3.d
Index: binutils-2.45/gas/testsuite/gas/i386/x86-64-relax-3.d
===================================================================
--- binutils-2.42.orig/gas/testsuite/gas/i386/x86-64-relax-3.d 2024-01-29 01:00:00.000000000 +0100
+++ binutils-2.42/gas/testsuite/gas/i386/x86-64-relax-3.d 2024-01-30 16:57:58.487327524 +0100
--- binutils-2.45.orig/gas/testsuite/gas/i386/x86-64-relax-3.d 2025-07-27 01:00:00.000000000 +0200
+++ binutils-2.45/gas/testsuite/gas/i386/x86-64-relax-3.d 2025-10-14 15:59:55.171884264 +0200
@@ -12,10 +12,10 @@ Disassembly of section .text:
[ ]*[a-f0-9]+: eb 1b jmp 1f <hidden_def>
[ ]*[a-f0-9]+: eb 1b jmp 21 <global_def>
@@ -411,25 +334,25 @@ Index: binutils-2.42/gas/testsuite/gas/i386/x86-64-relax-3.d
0+1f <hidden_def>:
[ ]*[a-f0-9]+: c3 ret
Index: binutils-2.42/ld/testsuite/ld-x86-64/pr22791-1.err
Index: binutils-2.45/ld/testsuite/ld-x86-64/pr22791-1.err
===================================================================
--- binutils-2.42.orig/ld/testsuite/ld-x86-64/pr22791-1.err 2024-01-29 01:00:00.000000000 +0100
--- binutils-2.45.orig/ld/testsuite/ld-x86-64/pr22791-1.err 2025-07-27 01:00:00.000000000 +0200
+++ /dev/null 1970-01-01 00:00:00.000000000 +0000
@@ -1,2 +0,0 @@
-.*relocation R_X86_64_PC32 against symbol `foo' can not be used when making a PIE object; recompile with -fPIE
-#...
Index: binutils-2.42/ld/testsuite/ld-x86-64/pr22791-1a.c
Index: binutils-2.45/ld/testsuite/ld-x86-64/pr22791-1a.c
===================================================================
--- binutils-2.42.orig/ld/testsuite/ld-x86-64/pr22791-1a.c 2024-01-29 01:00:00.000000000 +0100
--- binutils-2.45.orig/ld/testsuite/ld-x86-64/pr22791-1a.c 2025-07-27 01:00:00.000000000 +0200
+++ /dev/null 1970-01-01 00:00:00.000000000 +0000
@@ -1,4 +0,0 @@
-void
-foo (void)
-{
-}
Index: binutils-2.42/ld/testsuite/ld-x86-64/pr22791-1b.s
Index: binutils-2.45/ld/testsuite/ld-x86-64/pr22791-1b.s
===================================================================
--- binutils-2.42.orig/ld/testsuite/ld-x86-64/pr22791-1b.s 2024-01-29 01:00:00.000000000 +0100
--- binutils-2.45.orig/ld/testsuite/ld-x86-64/pr22791-1b.s 2025-07-27 01:00:00.000000000 +0200
+++ /dev/null 1970-01-01 00:00:00.000000000 +0000
@@ -1,7 +0,0 @@
- .text
@@ -439,9 +362,9 @@ Index: binutils-2.42/ld/testsuite/ld-x86-64/pr22791-1b.s
- movl foo(%rip), %eax
- .size main, .-main
- .section .note.GNU-stack
Index: binutils-2.42/ld/testsuite/ld-x86-64/pr22791-2.rd
Index: binutils-2.45/ld/testsuite/ld-x86-64/pr22791-2.rd
===================================================================
--- binutils-2.42.orig/ld/testsuite/ld-x86-64/pr22791-2.rd 2024-01-29 01:00:00.000000000 +0100
--- binutils-2.45.orig/ld/testsuite/ld-x86-64/pr22791-2.rd 2025-07-27 01:00:00.000000000 +0200
+++ /dev/null 1970-01-01 00:00:00.000000000 +0000
@@ -1,6 +0,0 @@
-#failif
@@ -450,9 +373,9 @@ Index: binutils-2.42/ld/testsuite/ld-x86-64/pr22791-2.rd
-#...
-[0-9a-f ]+R_X86_64_NONE.*
-#...
Index: binutils-2.42/ld/testsuite/ld-x86-64/pr22791-2a.s
Index: binutils-2.45/ld/testsuite/ld-x86-64/pr22791-2a.s
===================================================================
--- binutils-2.42.orig/ld/testsuite/ld-x86-64/pr22791-2a.s 2024-01-29 01:00:00.000000000 +0100
--- binutils-2.45.orig/ld/testsuite/ld-x86-64/pr22791-2a.s 2025-07-27 01:00:00.000000000 +0200
+++ /dev/null 1970-01-01 00:00:00.000000000 +0000
@@ -1,8 +0,0 @@
- .text
@@ -463,9 +386,9 @@ Index: binutils-2.42/ld/testsuite/ld-x86-64/pr22791-2a.s
- jmp bar
- .size foo, .-foo
- .section .note.GNU-stack,"",@progbits
Index: binutils-2.42/ld/testsuite/ld-x86-64/pr22791-2b.c
Index: binutils-2.45/ld/testsuite/ld-x86-64/pr22791-2b.c
===================================================================
--- binutils-2.42.orig/ld/testsuite/ld-x86-64/pr22791-2b.c 2024-01-29 01:00:00.000000000 +0100
--- binutils-2.45.orig/ld/testsuite/ld-x86-64/pr22791-2b.c 2025-07-27 01:00:00.000000000 +0200
+++ /dev/null 1970-01-01 00:00:00.000000000 +0000
@@ -1,7 +0,0 @@
-#include <stdio.h>
@@ -475,9 +398,9 @@ Index: binutils-2.42/ld/testsuite/ld-x86-64/pr22791-2b.c
-{
- puts ("PASS");
-}
Index: binutils-2.42/ld/testsuite/ld-x86-64/pr22791-2c.s
Index: binutils-2.45/ld/testsuite/ld-x86-64/pr22791-2c.s
===================================================================
--- binutils-2.42.orig/ld/testsuite/ld-x86-64/pr22791-2c.s 2024-01-29 01:00:00.000000000 +0100
--- binutils-2.45.orig/ld/testsuite/ld-x86-64/pr22791-2c.s 2025-07-27 01:00:00.000000000 +0200
+++ /dev/null 1970-01-01 00:00:00.000000000 +0000
@@ -1,12 +0,0 @@
- .text
@@ -492,10 +415,10 @@ Index: binutils-2.42/ld/testsuite/ld-x86-64/pr22791-2c.s
- ret
- .size main, .-main
- .section .note.GNU-stack,"",@progbits
Index: binutils-2.42/ld/testsuite/ld-x86-64/pr22842b.S
Index: binutils-2.45/ld/testsuite/ld-x86-64/pr22842b.S
===================================================================
--- binutils-2.42.orig/ld/testsuite/ld-x86-64/pr22842b.S 2024-01-29 01:00:00.000000000 +0100
+++ binutils-2.42/ld/testsuite/ld-x86-64/pr22842b.S 2024-01-30 16:57:58.487327524 +0100
--- binutils-2.45.orig/ld/testsuite/ld-x86-64/pr22842b.S 2025-07-27 01:00:00.000000000 +0200
+++ binutils-2.45/ld/testsuite/ld-x86-64/pr22842b.S 2025-10-14 15:59:55.172884281 +0200
@@ -7,7 +7,7 @@ main:
leaq bar(%rip), %rdi
addq %rax, %rdi
@@ -505,11 +428,11 @@ Index: binutils-2.42/ld/testsuite/ld-x86-64/pr22842b.S
xorl %eax, %eax
popq %rcx
retq
Index: binutils-2.42/ld/testsuite/ld-x86-64/x86-64.exp
Index: binutils-2.45/ld/testsuite/ld-x86-64/x86-64.exp
===================================================================
--- binutils-2.42.orig/ld/testsuite/ld-x86-64/x86-64.exp 2024-01-29 01:00:00.000000000 +0100
+++ binutils-2.42/ld/testsuite/ld-x86-64/x86-64.exp 2024-01-30 16:57:58.487327524 +0100
@@ -1235,44 +1235,6 @@ if { [isnative] && [check_compiler_avail
--- binutils-2.45.orig/ld/testsuite/ld-x86-64/x86-64.exp 2025-10-14 15:54:33.616441772 +0200
+++ binutils-2.45/ld/testsuite/ld-x86-64/x86-64.exp 2025-10-14 15:59:55.172884281 +0200
@@ -1314,44 +1314,6 @@ if { [isnative] && [check_compiler_avail
"pr22393-3-static" \
] \
[list \
@@ -554,7 +477,7 @@ Index: binutils-2.42/ld/testsuite/ld-x86-64/x86-64.exp
"Build pr22842.so" \
"-shared" \
"-fPIC -Wa,-mx86-used-note=yes" \
@@ -1762,15 +1724,6 @@ if { [isnative] && [check_compiler_avail
@@ -1849,15 +1811,6 @@ if { [isnative] && [check_compiler_avail
"pass.out" \
] \
[list \

View File

@@ -25,11 +25,16 @@ of missing support in ld.so.
(This also disables the few explicit dt-relr tests that don't use the
proper predicate to guard themself)
(Eventually commit 73ab3b9825d2 introduced calls to _bfd_final_link_relocate
into scan_relocs to check for overflows. But that also installs relocations,
leading to the exact same behaviour of applying reloc values twice. To
that end this patch further adds calls to _bfd_clear_contents after those
ones.)
Index: binutils-2.43/bfd/elf64-x86-64.c
Index: binutils-2.45/bfd/elf64-x86-64.c
===================================================================
--- binutils-2.43.orig/bfd/elf64-x86-64.c 2024-08-06 16:48:34.104745566 +0200
+++ binutils-2.43/bfd/elf64-x86-64.c 2024-08-06 16:48:36.554787135 +0200
--- binutils-2.45.orig/bfd/elf64-x86-64.c 2025-10-21 18:04:37.580147518 +0200
+++ binutils-2.45/bfd/elf64-x86-64.c 2025-10-21 18:04:39.438178825 +0200
@@ -48,127 +48,127 @@ static reloc_howto_type x86_64_elf_howto
bfd_elf_generic_reloc, "R_X86_64_NONE", false, 0, 0x00000000,
false),
@@ -208,9 +213,45 @@ Index: binutils-2.43/bfd/elf64-x86-64.c
false)
};
Index: binutils-2.43/gas/testsuite/gas/i386/rela.d
@@ -2095,6 +2095,8 @@ elf_x86_64_convert_load_reloc (bfd *abfd
r = _bfd_final_link_relocate (howto, abfd, input_section,
contents, irel->r_offset,
relocation, raddend);
+ _bfd_clear_contents (howto, abfd, input_section,
+ contents, irel->r_offset);
if (r == bfd_reloc_overflow)
return true;
@@ -2204,6 +2206,8 @@ elf_x86_64_convert_load_reloc (bfd *abfd
r = _bfd_final_link_relocate (howto, abfd, input_section,
contents, irel->r_offset,
relocation, 0);
+ _bfd_clear_contents (howto, abfd, input_section,
+ contents, irel->r_offset);
if (r == bfd_reloc_overflow)
return true;
@@ -2317,6 +2321,8 @@ elf_x86_64_convert_load_reloc (bfd *abfd
contents, irel->r_offset,
relocation,
raddend);
+ _bfd_clear_contents (howto, abfd, input_section,
+ contents, irel->r_offset);
if (r == bfd_reloc_overflow)
return true;
@@ -2415,6 +2421,8 @@ elf_x86_64_convert_load_reloc (bfd *abfd
r = _bfd_final_link_relocate (howto, abfd, input_section,
contents, irel->r_offset,
relocation, 0);
+ _bfd_clear_contents (howto, abfd, input_section,
+ contents, irel->r_offset);
if (r == bfd_reloc_overflow)
return true;
Index: binutils-2.45/gas/testsuite/gas/i386/rela.d
===================================================================
--- binutils-2.43.orig/gas/testsuite/gas/i386/rela.d 2024-08-06 16:48:34.104745566 +0200
--- binutils-2.45.orig/gas/testsuite/gas/i386/rela.d 2025-10-21 18:02:42.645210812 +0200
+++ /dev/null 1970-01-01 00:00:00.000000000 +0000
@@ -1,13 +0,0 @@
-#name: x86-64 rela relocs w/ non-zero relocated fields
@@ -226,9 +267,9 @@ Index: binutils-2.43/gas/testsuite/gas/i386/rela.d
-
-Contents of section .data:
- 0+0 11 ?11 ?11 ?11 22 ?22 ?22 ?22 33 ?33 ?33 ?33 44 ?44 ?44 ?44 .*
Index: binutils-2.43/gas/testsuite/gas/i386/rela.s
Index: binutils-2.45/gas/testsuite/gas/i386/rela.s
===================================================================
--- binutils-2.43.orig/gas/testsuite/gas/i386/rela.s 2024-08-06 16:48:34.104745566 +0200
--- binutils-2.45.orig/gas/testsuite/gas/i386/rela.s 2025-10-21 18:02:42.645210812 +0200
+++ /dev/null 1970-01-01 00:00:00.000000000 +0000
@@ -1,14 +0,0 @@
-# Note: This file is also used by an ld test case.
@@ -245,14 +286,14 @@ Index: binutils-2.43/gas/testsuite/gas/i386/rela.s
-
- .reloc l, BFD_RELOC_64, q
- .reloc q, BFD_RELOC_32, l
Index: binutils-2.43/ld/testsuite/ld-x86-64/rela.d
Index: binutils-2.45/ld/testsuite/ld-x86-64/rela.d
===================================================================
--- binutils-2.43.orig/ld/testsuite/ld-x86-64/rela.d 2024-08-06 16:48:34.104745566 +0200
--- binutils-2.45.orig/ld/testsuite/ld-x86-64/rela.d 2025-10-21 18:02:42.645210812 +0200
+++ /dev/null 1970-01-01 00:00:00.000000000 +0000
@@ -1,10 +0,0 @@
-#name: x86-64 rela relocs w/ non-zero relocated fields
-#as: --64
-#source: ${srcdir}/../../../gas/testsuite/gas/i386/rela.s
-#source: ../../../gas/testsuite/gas/i386/rela.s
-#ld: -melf_x86_64
-#objdump: -sj .data
-
@@ -260,11 +301,11 @@ Index: binutils-2.43/ld/testsuite/ld-x86-64/rela.d
-
-Contents of section .data:
- *[0-9a-f]*0 .8 ?.. ?.. ?.. 00 ?00 ?00 ?00 .0 ?.. ?.. ?.. 44 ?44 ?44 ?44 .*
Index: binutils-2.43/ld/testsuite/ld-x86-64/x86-64.exp
Index: binutils-2.45/ld/testsuite/ld-x86-64/x86-64.exp
===================================================================
--- binutils-2.43.orig/ld/testsuite/ld-x86-64/x86-64.exp 2024-08-06 16:48:34.104745566 +0200
+++ binutils-2.43/ld/testsuite/ld-x86-64/x86-64.exp 2024-08-06 16:48:36.554787135 +0200
@@ -309,7 +309,6 @@ run_dump_test "apic"
--- binutils-2.45.orig/ld/testsuite/ld-x86-64/x86-64.exp 2025-10-21 18:02:59.867500986 +0200
+++ binutils-2.45/ld/testsuite/ld-x86-64/x86-64.exp 2025-10-21 18:13:03.092666336 +0200
@@ -314,7 +314,6 @@ run_dump_test "apic"
run_dump_test "pcrel8"
run_dump_test "pcrel16"
run_dump_test "pcrel16-2"
@@ -272,7 +313,7 @@ Index: binutils-2.43/ld/testsuite/ld-x86-64/x86-64.exp
run_dump_test "tlsgd2"
run_dump_test "tlsgd3"
run_dump_test "tlsgd12"
@@ -524,10 +523,10 @@ run_dump_test "pr27491-1c"
@@ -530,10 +529,10 @@ run_dump_test "pr27491-1c"
run_dump_test "pr27491-2"
run_dump_test "pr27491-3"
run_dump_test "pr27491-4"
@@ -287,11 +328,20 @@ Index: binutils-2.43/ld/testsuite/ld-x86-64/x86-64.exp
run_dump_test "pr30787"
run_dump_test "pr31047"
run_dump_test "pr31047-x32"
Index: binutils-2.43/binutils/testsuite/lib/binutils-common.exp
@@ -2335,7 +2334,7 @@ if { [check_compiler_available] } {
] \
[list \
"Build mark-plt-2.so" \
- "-shared -Wl,--no-as-needed,-z,mark-plt,-z,nopack-relative-relocs" \
+ "-shared -Wl,--no-as-needed,-z,mark-plt" \
"-fPIC" \
{ mark-plt-2.s } \
{{readelf {-W --version-info} mark-plt-2.rd}} \
Index: binutils-2.45/binutils/testsuite/lib/binutils-common.exp
===================================================================
--- binutils-2.43.orig/binutils/testsuite/lib/binutils-common.exp 2024-08-06 16:48:34.104745566 +0200
+++ binutils-2.43/binutils/testsuite/lib/binutils-common.exp 2024-08-06 16:48:36.554787135 +0200
@@ -470,6 +470,8 @@ proc supports_persistent_section {} {
--- binutils-2.45.orig/binutils/testsuite/lib/binutils-common.exp 2025-10-21 18:02:42.645210812 +0200
+++ binutils-2.45/binutils/testsuite/lib/binutils-common.exp 2025-10-21 18:04:39.439178842 +0200
@@ -468,6 +468,8 @@ proc supports_persistent_section {} {
# Whether a target support DT_RELR sections.
proc supports_dt_relr {} {
@@ -300,10 +350,10 @@ Index: binutils-2.43/binutils/testsuite/lib/binutils-common.exp
if { ([istarget x86_64-*-*]
|| [istarget i?86-*-*]
|| [istarget powerpc64*-*-*]
Index: binutils-2.43/ld/emulparams/dt-relr.sh
Index: binutils-2.45/ld/emulparams/dt-relr.sh
===================================================================
--- binutils-2.43.orig/ld/emulparams/dt-relr.sh 2024-08-06 16:48:34.104745566 +0200
+++ binutils-2.43/ld/emulparams/dt-relr.sh 2024-08-06 16:48:36.554787135 +0200
--- binutils-2.45.orig/ld/emulparams/dt-relr.sh 2025-10-21 18:02:42.645210812 +0200
+++ binutils-2.45/ld/emulparams/dt-relr.sh 2025-10-21 18:04:39.439178842 +0200
@@ -1,3 +1,8 @@
+if false; then
+ # on old codestreams we don't have the DT_RELR support in the dynamic
@@ -319,11 +369,11 @@ Index: binutils-2.43/ld/emulparams/dt-relr.sh
PARSE_AND_LIST_ARGS_CASE_Z="$PARSE_AND_LIST_ARGS_CASE_Z $PARSE_AND_LIST_ARGS_CASE_Z_PACK_RELATIVE_RELOCS"
+
+fi
Index: binutils-2.43/ld/testsuite/ld-i386/i386.exp
Index: binutils-2.45/ld/testsuite/ld-i386/i386.exp
===================================================================
--- binutils-2.43.orig/ld/testsuite/ld-i386/i386.exp 2024-08-06 16:48:34.104745566 +0200
+++ binutils-2.43/ld/testsuite/ld-i386/i386.exp 2024-08-06 16:48:36.554787135 +0200
@@ -507,8 +507,8 @@ run_dump_test "pr27491-1c"
--- binutils-2.45.orig/ld/testsuite/ld-i386/i386.exp 2025-10-21 18:02:42.645210812 +0200
+++ binutils-2.45/ld/testsuite/ld-i386/i386.exp 2025-10-21 18:04:39.439178842 +0200
@@ -513,8 +513,8 @@ run_dump_test "pr27491-1c"
run_dump_test "pr27491-2"
run_dump_test "pr27491-3"
run_dump_test "pr27491-4"
@@ -334,10 +384,10 @@ Index: binutils-2.43/ld/testsuite/ld-i386/i386.exp
run_dump_test "pr28870"
run_dump_test "pr28894"
run_dump_test "pr30787"
Index: binutils-2.43/ld/testsuite/ld-powerpc/powerpc.exp
Index: binutils-2.45/ld/testsuite/ld-powerpc/powerpc.exp
===================================================================
--- binutils-2.43.orig/ld/testsuite/ld-powerpc/powerpc.exp 2024-08-06 16:48:34.104745566 +0200
+++ binutils-2.43/ld/testsuite/ld-powerpc/powerpc.exp 2024-08-06 16:48:36.554787135 +0200
--- binutils-2.45.orig/ld/testsuite/ld-powerpc/powerpc.exp 2025-10-21 18:02:42.645210812 +0200
+++ binutils-2.45/ld/testsuite/ld-powerpc/powerpc.exp 2025-10-21 18:04:39.439178842 +0200
@@ -378,14 +378,14 @@ set ppc64elftests {
"-a64" {abs-reloc.s}
{{objdump {-sdr} abs-shared.d}
@@ -361,12 +411,12 @@ Index: binutils-2.43/ld/testsuite/ld-powerpc/powerpc.exp
}
set ppceabitests {
Index: binutils-2.43/gas/testsuite/gas/i386/x86-64.exp
Index: binutils-2.45/gas/testsuite/gas/i386/x86-64.exp
===================================================================
--- binutils-2.43.orig/gas/testsuite/gas/i386/x86-64.exp 2024-08-06 16:48:34.104745566 +0200
+++ binutils-2.43/gas/testsuite/gas/i386/x86-64.exp 2024-08-06 16:48:36.554787135 +0200
@@ -653,7 +653,6 @@ if [is_elf_format] then {
run_list_test "reloc64" "--defsym _bad_=1"
--- binutils-2.45.orig/gas/testsuite/gas/i386/x86-64.exp 2025-10-21 18:02:42.645210812 +0200
+++ binutils-2.45/gas/testsuite/gas/i386/x86-64.exp 2025-10-21 18:04:39.439178842 +0200
@@ -705,7 +705,6 @@ if [is_elf_format] then {
run_dump_test "x86-64-tls"
run_list_test "x86-64-inval-tls"
run_dump_test "mixed-mode-reloc64"
- run_dump_test "rela"

View File

@@ -1,8 +1,8 @@
diff --git a/ld/emultempl/elf.em b/ld/emultempl/elf.em
index 42c552b36e..dd0a6b1e60 100644
--- a/ld/emultempl/elf.em
+++ b/ld/emultempl/elf.em
@@ -135,6 +135,8 @@ if test x"$LDEMUL_BEFORE_ALLOCATION" != xgld"$EMULATION_NAME"_before_allocation;
Index: binutils-2.45/ld/emultempl/elf.em
===================================================================
--- binutils-2.45.orig/ld/emultempl/elf.em 2025-07-27 01:00:00.000000000 +0200
+++ binutils-2.45/ld/emultempl/elf.em 2025-10-14 15:49:40.360481868 +0200
@@ -162,6 +162,8 @@ if test x"$LDEMUL_BEFORE_ALLOCATION" !=
if test x"${ELF_INTERPRETER_NAME}" = x; then
ELF_INTERPRETER_NAME=NULL
fi
@@ -11,11 +11,11 @@ index 42c552b36e..dd0a6b1e60 100644
fragment <<EOF
/* This is called after the sections have been attached to output
diff --git a/ld/ldelf.c b/ld/ldelf.c
index 2e27cf48a8..7162d0cf91 100644
--- a/ld/ldelf.c
+++ b/ld/ldelf.c
@@ -1506,6 +1506,31 @@ ldelf_append_to_separated_string (char **to, char *op_arg)
Index: binutils-2.45/ld/ldelf.c
===================================================================
--- binutils-2.45.orig/ld/ldelf.c 2025-07-27 01:00:00.000000000 +0200
+++ binutils-2.45/ld/ldelf.c 2025-10-14 15:49:40.360481868 +0200
@@ -1746,6 +1746,31 @@ ldelf_append_to_separated_string (char *
}
}
@@ -47,8 +47,8 @@ index 2e27cf48a8..7162d0cf91 100644
/* This is called after the sections have been attached to output
sections, but before any sizes or addresses have been set. */
@@ -1513,7 +1538,7 @@ void
ldelf_before_allocation (char *audit, char *depaudit,
@@ -1753,7 +1778,7 @@ void
ldelf_before_allocation (char **audit, char **depaudit,
const char *default_interpreter_name)
{
- const char *rpath;
@@ -56,7 +56,7 @@ index 2e27cf48a8..7162d0cf91 100644
asection *sinterp;
bfd *abfd;
struct bfd_link_hash_entry *ehdr_start = NULL;
@@ -1608,7 +1633,67 @@ ldelf_before_allocation (char *audit, char *depaudit,
@@ -1807,7 +1832,67 @@ ldelf_before_allocation (char **audit, c
by dynamic linking. */
rpath = command_line.rpath;
if (rpath == NULL)

View File

@@ -1,3 +1,99 @@
-------------------------------------------------------------------
Mon Nov 3 14:06:37 UTC 2025 - Michael Matz <matz@suse.com>
- Update to current 2.45 branch at 94cb1c075 to include fix
for PR33584 (a problem related to LTO vs fortran COMMON
blocks).
-------------------------------------------------------------------
Tue Oct 28 14:14:01 UTC 2025 - Michael Matz <matz@suse.com>
- Amend binutils-compat-old-behaviour.diff to not enable
'-z gcs=implicit' on aarch64 for old codestreams.
-------------------------------------------------------------------
Tue Oct 14 16:29:53 UTC 2025 - Michael Matz <matz@suse.com>
- Update to version 2.45:
* New versioned release of libsframe.so.2
* s390: tools now support SFrame format 2; recognize "z17" as CPU
name [bsc#1247105, jsc#IBM-1485]
* sframe sections are now of ELF section type SHT_GNU_SFRAME.
* sframe secions generated by the assembler have
SFRAME_F_FDE_FUNC_START_PCREL set.
* riscv: Support more extensions: standard: Zicfiss v1.0, Zicfilp v1.0,
Zcmp v1.0, Zcmt v1.0, Smrnmi v1.0, S[sm]dbltrp v1.0, S[sm]ctr v1.0,
ssqosid v1.0, ssnpm v1.0, smnpm v1.0, smmpm v1.0, sspm v1.0, supm v1.0,
sha v1.0, zce v1.0, smcdeleg v1.0, ssccfg v1.0, svvptc v1.0, zilsd v1.0,
zclsd v1.0, smrnmi v1.0;
vendor: CORE-V, xcvbitmanip v1.0 and xcvsimd v1.0;
SiFive, xsfvqmaccdod v1.0, xsfvqmaccqoqv1.0 and xsfvfnrclipxfqf v1.0;
T-Head: xtheadvdot v1.0;
MIPS: xmipscbop v1.0, xmipscmov v1.0, xmipsexectl v1.0, xmipslsp v1.0.
* Support RISC-V privileged version 1.13, profiles 20/22/23, and
.bfloat16 directive.
* x86: Add support for these ISAs: Intel Diamond Rapids AMX, MOVRS,
AVX10.2 (including SM4), MSR_IMM; Zhaoxin PadLock PHE2, RNG2, GMI, XMODX.
Drop support for AVX10.2 256 bit rounding.
* arm: Add support for most of Armv9.6, enabled by -march=armv9.6-a and
extensions '+cmpbr', '+f8f16mm', '+f8f32mm', '+fprcvt', '+lsfe', '+lsui',
'+occmo', '+pops', '+sme2p2', '+ssve-aes', '+sve-aes', '+sve-aes2',
'+sve-bfscale', '+sve-f16f32mm' and '+sve2p2'.
* Predefined symbols "GAS(version)" and, on non-release builds, "GAS(date)"
are now being made available.
* Add .errif and .warnif directives.
* linker:
- Add --image-base=<ADDR> option to the ELF linker to behave the same
as -Ttext-segment for compatibility with LLD.
- Add support for mixed LTO and non-LTO codes in relocatable output.
- s390: linker generates .eh_frame and/or .sframe for linker
generated .plt sections by default (can be disabled
by --no-ld-generated-unwind-info).
- riscv: add new PLT formats, and GNU property merge rules for zicfiss
and zicfilp extensions.
- gold is no longer included
- Contains fixes for these non-CVEs (not security bugs per upstreams
SECURITY.md):
* bsc#1236632 aka CVE-2025-0840 aka PR32560
* bsc#1236977 aka CVE-2025-1149 aka PR32576
* bsc#1236978 aka CVE-2025-1148 aka PR32576
* bsc#1236999 aka CVE-2025-1176 aka PR32636
* bsc#1237000 aka CVE-2025-1153 aka PR32603
* bsc#1237001 aka CVE-2025-1152 aka PR32576
* bsc#1237003 aka CVE-2025-1151 aka PR32576
* bsc#1237005 aka CVE-2025-1150 aka PR32576
* bsc#1237018 aka CVE-2025-1178 aka PR32638
* bsc#1237019 aka CVE-2025-1181 aka PR32643
* bsc#1237020 aka CVE-2025-1180 aka PR32642
* bsc#1237021 aka CVE-2025-1179 aka PR32640
* bsc#1237042 aka CVE-2025-1182 aka PR32644
* bsc#1240870 aka CVE-2025-3198 aka PR32716
* bsc#1243756 aka CVE-2025-5244 aka PR32858
* bsc#1243760 aka CVE-2025-5245 aka PR32829
* bsc#1246481 aka CVE-2025-7545 aka PR33049
* bsc#1246486 aka CVE-2025-7546 aka PR33050
* bsc#1247114 aka CVE-2025-8224 aka PR32109
* bsc#1247117 aka CVE-2025-8225 no PR
- Add these backport patches:
* pr32556.diff for bsc#1236976 aka CVE-2025-1147 aka PR32556
* pr33457.diff for bsc#1250632 aka CVE-2025-11083 aka PR33457
* pr33452.diff for bsc#1251275 aka CVE-2025-11412 aka PR33452
* pr33456.diff and pr33456-2.diff for bsc#1251276 aka CVE-2025-11413
aka PR33456
* pr33450.diff for bsc#1251277 aka CVE-2025-11414 aka PR33450
* pr33499.diff for bsc#1251794 aka CVE-2025-11494 aka PR33499
* pr33502.diff for bsc#1251795 aka CVE-2025-11495 aka PR33502
- Adjust binutils-disable-code-arch-error.diff,
binutils-revert-nm-symversion.diff, binutils-revert-plt32-in-branches.diff,
binutils-revert-rela.diff, binutils-skip-rpaths.patch
- Remove pr33029.patch (upstreamed), enable-targets-gold.diff (obsolete),
binutils-2.43.tar.bz2.sig, binutils-2.43.tar.bz2,
binutils-2.43-branch.diff.gz
- Add binutils-2.45.tar.bz2.sig, binutils-2.45.tar.bz2,
binutils-2.45-branch.diff.gz
- Rename binutils-fix-branch.diff to binutils-fix-branch.diff.templ
as long as its empty.
-------------------------------------------------------------------
Thu Jul 10 05:26:01 UTC 2025 - Bernhard Wiedemann <bwiedemann@suse.com>

View File

@@ -64,7 +64,7 @@ BuildRequires: zlib-devel
%if %{suse_version} > 1500
BuildRequires: libzstd-devel
%endif
Version: 2.43
Version: 2.45
Release: 0
# disable libalternatives for now until it's changed to not
@@ -131,14 +131,18 @@ Source: binutils-%{version}.tar.bz2
Source2: binutils-%{version}.tar.bz2.sig
Source3: binutils.keyring
Source4: baselibs.conf
Patch1: binutils-2.43-branch.diff.gz
Patch2: binutils-fix-branch.diff
Source5: pr33230.obj.bz2
# if this patch isn't empty, it should be Patch2 and named *diff
# name it "*templ" as long as empty because the source-validator
# service checks all *.diff files, even if listed as Source, not
# Patch :-(
Source6: binutils-fix-branch.diff.templ
Patch1: binutils-2.45-branch.diff.gz
Patch3: binutils-skip-rpaths.patch
Patch4: s390-biarch.diff
Patch5: x86-64-biarch.patch
Patch6: unit-at-a-time.patch
Patch9: testsuite.diff
Patch10: enable-targets-gold.diff
Patch12: s390-pic-dso.diff
Patch14: binutils-build-as-needed.diff
Patch15: binutils-znow.patch
@@ -152,7 +156,14 @@ Patch42: binutils-compat-old-behaviour.diff
Patch43: binutils-revert-hlasm-insns.diff
Patch44: binutils-revert-rela.diff
Patch60: binutils-disable-code-arch-error.diff
Patch61: pr33029.patch
Patch70: pr32556.diff
Patch71: pr33450.diff
Patch72: pr33452.diff
Patch73: pr33456.diff
Patch74: pr33456-2.diff
Patch75: pr33457.diff
Patch76: pr33499.diff
Patch77: pr33502.diff
Patch90: cross-avr-nesc-as.patch
Patch92: cross-avr-omit_section_dynsym.patch
Patch93: cross-avr-size.patch
@@ -180,7 +191,8 @@ PreReq: update-alternatives
%endif
# We want gold for SLE15 and (newer) openSUSE, but not SLE16
%if 0%{!?cross:1} && 0%{?suse_version} >= 1310 && ( 0%{?suse_version} < 1600 || 0%{?is_opensuse} )
%define gold_archs %ix86 aarch64 %arm x86_64 %x86_64 ppc ppc64 ppc64le s390x %sparc
#define gold_archs %ix86 aarch64 %arm x86_64 %x86_64 ppc ppc64 ppc64le s390x %sparc
%define gold_archs %{nil}
%endif
%description gold
@@ -249,7 +261,12 @@ echo "make check will return with %{make_check_handling} in case of testsuite fa
# Patch is outside test_vanilla because it's supposed to be the
# patch bringing the tarball to the newest upstream version
%patch -P 1 -p1
%patch -P 2 -p1
# See comment in the patch file for patch 2. Currently commented
# out because its empty except for that comment.
#patch -P 2 -p1
# the 2.45 branch adds one single binary file (gah!) but git binary
# diffs aren't supported by rpm
cp -p %{SOURCE5} binutils/testsuite/binutils-all/x86-64/pr33230.obj.bz2
# Backup flex and biscon files for later verification. Do this
# after branch and fix-branch patches are applied (which are assumed
@@ -264,7 +281,6 @@ cp ld/ldgram.y ld/ldgram.y.orig
%patch -P 5
%patch -P 6
%patch -P 9
%patch -P 10
%patch -P 12
%patch -P 14
%patch -P 15
@@ -282,7 +298,14 @@ cp ld/ldgram.y ld/ldgram.y.orig
%patch -P 44 -p1
%endif
%patch -P 60 -p1
%patch -P 61 -p1
%patch -P 70 -p1
%patch -P 71 -p1
%patch -P 72 -p1
%patch -P 73 -p1
%patch -P 74 -p1
%patch -P 75 -p1
%patch -P 76 -p1
%patch -P 77 -p1
%if "%{TARGET}" == "avr"
cp gas/config/tc-avr.h gas/config/tc-avr-nesc.h
%patch -P 90
@@ -300,9 +323,10 @@ diff -u ld/ldgram.y ld/ldgram.y.orig
%build
%define _lto_cflags %{nil}
sed -i -e '/BFD_VERSION_DATE/s/$/-%(echo %release | sed 's/\.[0-9]*$//')/' bfd/version.h
sed -i -e '/BFD_VERSION_DATE/s/$/-%(echo %release | sed -e 's/\.[0-9]*$//' -e 's/[^0-9]*//g' )/' bfd/version.h
RPM_OPT_FLAGS="$RPM_OPT_FLAGS -Wno-error"
echo "==== any FAIL: lines from here until the %check section are irrelevant ==="
# gcc15 and up default to c23, these older binutils would need patches
# for that. As an impeding version update fixes that as well, simply
# override the compiler instead of bothering with backports
@@ -503,6 +527,7 @@ make -C gas-nesc %{?make_output_sync} %{?_smp_mflags}
%endif
%check
echo "==== any FAIL: lines before this line are irrelevant ===="
unset SUSE_ASNEEDED SUSE_ZNOW
# newer distros set this envvar (e.g. to get deterministic archives by default)
# but of course that breaks tests that precisely are
@@ -567,9 +592,12 @@ chmod a+x %{buildroot}%{_libdir}/libopcodes-*
rm %{buildroot}%{_libdir}/lib{bfd,opcodes}.so
rm %{buildroot}%{_libdir}/lib{bfd,opcodes,ctf,ctf-nobfd}.la
rm -f %{buildroot}%{_libdir}/gprofng/lib*.{l,}a
rm -f %{buildroot}%{_libdir}/libgprofng.la
# Remove unwanted files to shut up rpm
rm -f %{buildroot}%{_infodir}/configure* $RPM_BUILD_ROOT%{_infodir}/standards.info*
rm -f %{buildroot}%{_mandir}/man1/dlltool.1 $RPM_BUILD_ROOT%{_mandir}/man1/windres.1 $RPM_BUILD_ROOT%{_mandir}/man1/windmc.1
# gprofng/doc installs into prefix/share/doc, not into _docdir :-/
rm -f %{buildroot}/usr/share/doc/gprofng/examples.*
cd ..
%find_lang binutils
%find_lang bfd binutils.lang

View File

@@ -1,14 +0,0 @@
Index: gold/configure
===================================================================
--- gold/configure.orig 2018-07-16 09:55:04.675278145 +0200
+++ gold/configure 2018-07-16 09:55:36.007836031 +0200
@@ -5180,7 +5180,8 @@ for targ in $target $canon_targets; do
. ${srcdir}/configure.tgt
if test "$targ_obj" = "UNKNOWN"; then
- as_fn_error $? "\"unsupported target $targ\"" "$LINENO" 5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"unsupported target $targ\"" >&5
+ $as_echo "$as_me: WARNING: \"unsupported target $targ\"" >&2;}
else
targetobjs="$targetobjs ${targ_obj}.\$(OBJEXT)"
if test "$targ_extra_obj" != ""; then

101
pr32556.diff Normal file
View File

@@ -0,0 +1,101 @@
commit 7be4186c22f89a87fff048c28910f5d26a0f61ce
Author: Dmitry Klochkov <dmitry.klochkov@bell-sw.com>
Date: Tue Sep 9 12:06:25 2025 +0200
nm: fix treating an ifunc symbol as a stab if '--ifunc-chars=--' is given
If an ifunc symbol is processed in print_symbol(), a 'type' field of a
'syminfo' structure is set to any character specified by a user with an
'--ifunc-chars' option. But afterwards the 'type' field is used to
check whether a symbol is a stab in print_symbol_info_{bsd,sysv}()
functions in order to print additional stab related data. If the 'type'
field equals '-', a symbol is treated as a stab. If '--ifunc-chars=--'
is given, all ifunc symbols will be treated as stab symbols and
uninitialized stab related fields of the 'syminfo' structure will be
printed which can lead to segmentation fault.
To fix this, check if a symbol is a stab before override the 'type'
field. Also, add a test case for this fix.
PR binutils/32556
* nm.c (extended_symbol_info): Add is_stab.
(print_symbol): Check if a symbol is a stab.
(print_symbol_info_bsd): Use info->is_stab.
(print_symbol_info_sysv): Use info->is_stab.
* testsuite/binutils-all/nm.exp: Test nm --ifunc-chars=--.
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32556
Fixes: e6f6aa8d184 ("Add option to nm to change the characters displayed for ifunc symbols")
Signed-off-by: Dmitry Klochkov <dmitry.klochkov@bell-sw.com>
diff --git a/binutils/nm.c b/binutils/nm.c
index dce9207f44f..c3d118a93c3 100644
--- a/binutils/nm.c
+++ b/binutils/nm.c
@@ -70,6 +70,7 @@ struct extended_symbol_info
bfd_vma ssize;
elf_symbol_type *elfinfo;
coff_symbol_type *coffinfo;
+ bool is_stab;
/* FIXME: We should add more fields for Type, Line, Section. */
};
#define SYM_VALUE(sym) (sym->sinfo->value)
@@ -1208,8 +1209,11 @@ print_symbol (bfd * abfd,
bfd_get_symbol_info (abfd, sym, &syminfo);
+ info.is_stab = false;
+ if (syminfo.type == '-')
+ info.is_stab = true;
/* PR 22967 - Distinguish between local and global ifunc symbols. */
- if (syminfo.type == 'i'
+ else if (syminfo.type == 'i'
&& sym->flags & BSF_GNU_INDIRECT_FUNCTION)
{
if (ifunc_type_chars == NULL || ifunc_type_chars[0] == 0)
@@ -1873,7 +1877,7 @@ print_symbol_info_bsd (struct extended_symbol_info *info, bfd *abfd)
printf (" %c", SYM_TYPE (info));
- if (SYM_TYPE (info) == '-')
+ if (info->is_stab)
{
/* A stab. */
printf (" ");
@@ -1902,7 +1906,7 @@ print_symbol_info_sysv (struct extended_symbol_info *info, bfd *abfd)
printf ("| %c |", SYM_TYPE (info));
- if (SYM_TYPE (info) == '-')
+ if (info->is_stab)
{
/* A stab. */
printf ("%18s| ", SYM_STAB_NAME (info)); /* (C) Type. */
diff --git a/binutils/testsuite/binutils-all/nm.exp b/binutils/testsuite/binutils-all/nm.exp
index fea68bf76bc..1feb8578fba 100644
--- a/binutils/testsuite/binutils-all/nm.exp
+++ b/binutils/testsuite/binutils-all/nm.exp
@@ -329,6 +329,23 @@ if [is_elf_format] {
fail "$testname (local ifunc)"
}
+ # PR 32556
+ # Test nm --ifunc-chars=--
+
+ set got [binutils_run $NM "$NMFLAGS --ifunc-chars=-- $tmpfile"]
+
+ if [regexp -line "^\\S+ - global_foo$" $got] then {
+ pass "$testname=-- (global ifunc)"
+ } else {
+ fail "$testname=-- (global ifunc)"
+ }
+
+ if [regexp -line "^\\S+ - local_foo$" $got] then {
+ pass "$testname=-- (local ifunc)"
+ } else {
+ fail "$testname=-- (local ifunc)"
+ }
+
if { $verbose < 1 } {
remote_file host delete "tmpdir/ifunc.o"
}

View File

@@ -1,43 +0,0 @@
From f601ffb52199a883f16df385b73a14e756b3e19a Mon Sep 17 00:00:00 2001
From: Alan Modra <amodra@gmail.com>
Date: Wed, 28 May 2025 18:20:17 +0930
Subject: [PATCH] PR 33029 segv in dwarf2_finish with --gdwarf-5
Specifying --gdwarf-5 with a source lacking a ".file 0" directive
results in this segfault.
* dwarf2dbg.c (out_debug_str): Use files[1] if files[0] is
empty regardless of dwarf level.
---
gas/dwarf2dbg.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/gas/dwarf2dbg.c b/gas/dwarf2dbg.c
index fd1f96d80c5..a40fe6967d5 100644
--- a/gas/dwarf2dbg.c
+++ b/gas/dwarf2dbg.c
@@ -3019,6 +3019,11 @@ out_debug_str (segT str_seg, symbolS **name_sym, symbolS **comp_dir_sym,
int len;
int first_file = DWARF2_LINE_VERSION > 4 ? 0 : 1;
+ if (files_in_use == 0)
+ abort ();
+ if (first_file == 0 && files[first_file].filename == NULL)
+ first_file = 1;
+
subseg_set (str_seg, 0);
/* DW_AT_name. We don't have the actual file name that was present
@@ -3026,8 +3031,7 @@ out_debug_str (segT str_seg, symbolS **name_sym, symbolS **comp_dir_sym,
We're not supposed to get called unless at least one line number
entry was emitted, so this should always be defined. */
*name_sym = symbol_temp_new_now_octets ();
- if (files_in_use == 0)
- abort ();
+
if (files[first_file].dir)
{
char *dirname = remap_debug_filename (dirs[files[first_file].dir]);
--
2.50.0

BIN
pr33230.obj.bz2 LFS Normal file

Binary file not shown.

78
pr33450.diff Normal file
View File

@@ -0,0 +1,78 @@
commit aeaaa9af6359c8e394ce9cf24911fec4f4d23703
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Tue Sep 23 08:52:26 2025 +0800
elf: Return error on unsorted symbol table if not allowed
Normally ELF symbol table should be sorted, i.e., local symbols precede
global symbols. Irix 6 is an exception and its elf_bad_symtab is set
to true. Issue an error if elf_bad_symtab is false and symbol table is
unsorted.
PR ld/33450
* elflink.c (set_symbol_value): Change return type to bool and
return false on error. Issue an error on unsorted symbol table
if not allowed.
(elf_link_input_bfd): Return false if set_symbol_value reurns
false.
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 66982f82b94..54f0d6e957e 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -9155,7 +9155,7 @@ struct elf_outext_info
<binary-operator> := as in C
<unary-operator> := as in C, plus "0-" for unambiguous negation. */
-static void
+static bool
set_symbol_value (bfd *bfd_with_globals,
Elf_Internal_Sym *isymbuf,
size_t locsymcount,
@@ -9176,9 +9176,15 @@ set_symbol_value (bfd *bfd_with_globals,
"absolute" section and give it a value. */
sym->st_shndx = SHN_ABS;
sym->st_value = val;
- return;
+ return true;
+ }
+ if (!elf_bad_symtab (bfd_with_globals))
+ {
+ _bfd_error_handler (_("%pB: corrupt symbol table"),
+ bfd_with_globals);
+ bfd_set_error (bfd_error_bad_value);
+ return false;
}
- BFD_ASSERT (elf_bad_symtab (bfd_with_globals));
extsymoff = 0;
}
@@ -9188,11 +9194,12 @@ set_symbol_value (bfd *bfd_with_globals,
if (h == NULL)
{
/* FIXMEL What should we do ? */
- return;
+ return false;
}
h->root.type = bfd_link_hash_defined;
h->root.u.def.value = val;
h->root.u.def.section = bfd_abs_section_ptr;
+ return true;
}
static bool
@@ -11890,8 +11897,10 @@ elf_link_input_bfd (struct elf_final_link_info *flinfo, bfd *input_bfd)
return false;
/* Symbol evaluated OK. Update to absolute value. */
- set_symbol_value (input_bfd, isymbuf, locsymcount,
- r_symndx, val);
+ if (!set_symbol_value (input_bfd, isymbuf, locsymcount, r_symndx,
+ val))
+ return false;
+
continue;
}

29
pr33452.diff Normal file
View File

@@ -0,0 +1,29 @@
commit 047435dd988a3975d40c6626a8f739a0b2e154bc
Author: Alan Modra <amodra@gmail.com>
Date: Thu Sep 25 08:22:24 2025 +0930
PR 33452 SEGV in bfd_elf_gc_record_vtentry
Limit addends on vtentry relocs, otherwise ld might attempt to
allocate a stupidly large array. This also fixes the expression
overflow leading to pr33452. A vtable of 33M entries on a 64-bit
host is surely large enough, especially considering that VTINHERIT
and VTENTRY relocations are to support -fvtable-gc that disappeared
from gcc over 20 years ago.
PR ld/33452
* elflink.c (bfd_elf_gc_record_vtentry): Sanity check addend.
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 54f0d6e957e..0a0456177c2 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -14865,7 +14865,7 @@ bfd_elf_gc_record_vtentry (bfd *abfd, asection *sec,
const struct elf_backend_data *bed = get_elf_backend_data (abfd);
unsigned int log_file_align = bed->s->log_file_align;
- if (!h)
+ if (!h || addend > 1u << 28)
{
/* xgettext:c-format */
_bfd_error_handler (_("%pB: section '%pA': corrupt VTENTRY entry"),

46
pr33456-2.diff Normal file
View File

@@ -0,0 +1,46 @@
commit 72efdf166aa0ed72ecc69fc2349af6591a7a19c0
Author: Alan Modra <amodra@gmail.com>
Date: Thu Sep 25 10:41:32 2025 +0930
Re: elf: Disallow the empty global symbol name
sparc64-linux-gnu +FAIL: selective2
sparc64-linux-gnu +FAIL: selective3
PR ld/33456
* elflink.c (elf_link_add_object_symbols): Move new check later
to give the backend add_symbol_hook a chance to remove symbols
with empty names.
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 0a0456177c2..5c8b822e36a 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -5096,13 +5096,6 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
if (name == NULL)
goto error_free_vers;
- if (name[0] == '\0')
- {
- _bfd_error_handler (_("%pB: corrupt symbol table"), abfd);
- bfd_set_error (bfd_error_bad_value);
- goto error_free_vers;
- }
-
if (isym->st_shndx == SHN_COMMON
&& (abfd->flags & BFD_PLUGIN) != 0)
{
@@ -5146,6 +5139,13 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
continue;
}
+ if (name[0] == '\0')
+ {
+ _bfd_error_handler (_("%pB: corrupt symbol table"), abfd);
+ bfd_set_error (bfd_error_bad_value);
+ goto error_free_vers;
+ }
+
/* Sanity check that all possibilities were handled. */
if (sec == NULL)
abort ();

32
pr33456.diff Normal file
View File

@@ -0,0 +1,32 @@
commit 1108620d7a521f1c85d2f629031ce0fbae14e331
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Tue Sep 23 10:05:14 2025 +0800
elf: Disallow the empty global symbol name
Reject the empty global symbol name, "".
PR ld/33456
* elflink.c (elf_link_add_object_symbols): Disallow the empty
global symbol name.
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
diff --git a/bfd/elflink.c b/bfd/elflink.c
index b04b017747f..66982f82b94 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -5096,6 +5096,13 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
if (name == NULL)
goto error_free_vers;
+ if (name[0] == '\0')
+ {
+ _bfd_error_handler (_("%pB: corrupt symbol table"), abfd);
+ bfd_set_error (bfd_error_bad_value);
+ goto error_free_vers;
+ }
+
if (isym->st_shndx == SHN_COMMON
&& (abfd->flags & BFD_PLUGIN) != 0)
{

71
pr33457.diff Normal file
View File

@@ -0,0 +1,71 @@
commit 9ca499644a21ceb3f946d1c179c38a83be084490
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Thu Sep 18 16:59:25 2025 -0700
elf: Don't match corrupt section header in linker input
Don't swap in nor match corrupt section header in linker input to avoid
linker crash later.
PR ld/33457
* elfcode.h (elf_swap_shdr_in): Changed to return bool. Return
false for corrupt section header in linker input.
(elf_object_p): Reject if elf_swap_shdr_in returns false.
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
diff --git a/bfd/elfcode.h b/bfd/elfcode.h
index 9c65852e103..5224a1abee6 100644
--- a/bfd/elfcode.h
+++ b/bfd/elfcode.h
@@ -311,7 +311,7 @@ elf_swap_ehdr_out (bfd *abfd,
/* Translate an ELF section header table entry in external format into an
ELF section header table entry in internal format. */
-static void
+static bool
elf_swap_shdr_in (bfd *abfd,
const Elf_External_Shdr *src,
Elf_Internal_Shdr *dst)
@@ -341,6 +341,9 @@ elf_swap_shdr_in (bfd *abfd,
{
_bfd_error_handler (_("warning: %pB has a section "
"extending past end of file"), abfd);
+ /* PR ld/33457: Don't match corrupt section header. */
+ if (abfd->is_linker_input)
+ return false;
abfd->read_only = 1;
}
}
@@ -350,6 +353,7 @@ elf_swap_shdr_in (bfd *abfd,
dst->sh_entsize = H_GET_WORD (abfd, src->sh_entsize);
dst->bfd_section = NULL;
dst->contents = NULL;
+ return true;
}
/* Translate an ELF section header table entry in internal format into an
@@ -642,9 +646,9 @@ elf_object_p (bfd *abfd)
/* Read the first section header at index 0, and convert to internal
form. */
- if (bfd_read (&x_shdr, sizeof x_shdr, abfd) != sizeof (x_shdr))
+ if (bfd_read (&x_shdr, sizeof x_shdr, abfd) != sizeof (x_shdr)
+ || !elf_swap_shdr_in (abfd, &x_shdr, &i_shdr))
goto got_no_match;
- elf_swap_shdr_in (abfd, &x_shdr, &i_shdr);
/* If the section count is zero, the actual count is in the first
section header. */
@@ -730,9 +734,9 @@ elf_object_p (bfd *abfd)
to internal form. */
for (shindex = 1; shindex < i_ehdrp->e_shnum; shindex++)
{
- if (bfd_read (&x_shdr, sizeof x_shdr, abfd) != sizeof (x_shdr))
+ if (bfd_read (&x_shdr, sizeof x_shdr, abfd) != sizeof (x_shdr)
+ || !elf_swap_shdr_in (abfd, &x_shdr, i_shdrp + shindex))
goto got_no_match;
- elf_swap_shdr_in (abfd, &x_shdr, i_shdrp + shindex);
/* Sanity check sh_link and sh_info. */
if (i_shdrp[shindex].sh_link >= num_sec)

43
pr33499.diff Normal file
View File

@@ -0,0 +1,43 @@
commit b6ac5a8a5b82f0ae6a4642c8d7149b325f4cc60a
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Tue Sep 30 08:13:56 2025 +0800
x86: Keep _GLOBAL_OFFSET_TABLE_ for .eh_frame
Since x86 .eh_frame section may reference _GLOBAL_OFFSET_TABLE_, keep
_GLOBAL_OFFSET_TABLE_ if there is dynamic section and the output
.eh_frame section is non-empty.
PR ld/33499
* elfxx-x86.c (_bfd_x86_elf_late_size_sections): Keep
_GLOBAL_OFFSET_TABLE_ if there is dynamic section and the
output .eh_frame section is non-empty.
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
diff --git a/bfd/elfxx-x86.c b/bfd/elfxx-x86.c
index d8c653a9ad2..140e86888a6 100644
--- a/bfd/elfxx-x86.c
+++ b/bfd/elfxx-x86.c
@@ -2456,6 +2456,8 @@ _bfd_x86_elf_late_size_sections (bfd *output_bfd,
if (htab->elf.sgotplt)
{
+ asection *eh_frame;
+
/* Don't allocate .got.plt section if there are no GOT nor PLT
entries and there is no reference to _GLOBAL_OFFSET_TABLE_. */
if ((htab->elf.hgot == NULL
@@ -2468,7 +2470,11 @@ _bfd_x86_elf_late_size_sections (bfd *output_bfd,
&& (htab->elf.iplt == NULL
|| htab->elf.iplt->size == 0)
&& (htab->elf.igotplt == NULL
- || htab->elf.igotplt->size == 0))
+ || htab->elf.igotplt->size == 0)
+ && (!htab->elf.dynamic_sections_created
+ || (eh_frame = bfd_get_section_by_name (output_bfd,
+ ".eh_frame")) == NULL
+ || eh_frame->rawsize == 0))
{
htab->elf.sgotplt->size = 0;
/* Solaris requires to keep _GLOBAL_OFFSET_TABLE_ even if it

144
pr33502.diff Normal file
View File

@@ -0,0 +1,144 @@
commit 6b21c8b2ecfef5c95142cbc2c32f185cb1c26ab0
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Tue Sep 30 08:18:29 2025 +0800
x86: Disallow TLS relocation in non executable section
Since TLS relocations are applied to executable machine instructions,
disallow TLS relocation in non-SHT_PROGBITS, non-SHF_EXECINSTR section.
PR ld/33451
PR ld/33502
* elf32-i386.c (elf_i386_tls_transition): Disallow TLS relocation
in non-SHT_PROGBITS, non-SHF_EXECINSTR section.
(elf_i386_scan_relocs): Likewise.
* elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
(elf_x86_64_scan_relocs): Likewise.
* elfxx-x86.c (_bfd_x86_elf_link_report_tls_invalid_section_error):
New.
* elfxx-x86.h (_bfd_x86_elf_link_report_tls_invalid_section_error):
Likewise.
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index 507a0762aff..0d60eded701 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -1166,6 +1166,15 @@ elf_i386_tls_transition (struct bfd_link_info *info, bfd *abfd,
return true;
}
+ if ((elf_section_type (sec) != SHT_PROGBITS
+ || (sec->flags & SEC_CODE) == 0))
+ {
+ reloc_howto_type *howto = elf_i386_rtype_to_howto (from_type);
+ _bfd_x86_elf_link_report_tls_invalid_section_error
+ (abfd, sec, symtab_hdr, h, sym, howto);
+ return false;
+ }
+
/* Return TRUE if there is no transition. */
if (from_type == to_type)
return true;
@@ -1733,6 +1742,16 @@ elf_i386_scan_relocs (bfd *abfd,
tls_type = GOT_TLS_IE_POS; break;
}
+ if (tls_type >= GOT_TLS_GD
+ && tls_type <= GOT_TLS_GDESC
+ && (elf_section_type (sec) != SHT_PROGBITS
+ || (sec->flags & SEC_CODE) == 0))
+ {
+ _bfd_x86_elf_link_report_tls_invalid_section_error
+ (abfd, sec, symtab_hdr, h, isym, howto);
+ goto error_return;
+ }
+
if (h != NULL)
{
h->got.refcount = 1;
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index 620b6a380cd..59b43149897 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -1626,6 +1626,16 @@ elf_x86_64_tls_transition (struct bfd_link_info *info, bfd *abfd,
return true;
}
+ if ((elf_section_type (sec) != SHT_PROGBITS
+ || (sec->flags & SEC_CODE) == 0))
+ {
+ reloc_howto_type *howto = elf_x86_64_rtype_to_howto (abfd,
+ from_type);
+ _bfd_x86_elf_link_report_tls_invalid_section_error
+ (abfd, sec, symtab_hdr, h, sym, howto);
+ return false;
+ }
+
/* Return TRUE if there is no transition. */
if (from_type == to_type
|| (from_type == R_X86_64_CODE_4_GOTTPOFF
@@ -2757,6 +2767,16 @@ need_got:
break;
}
+ if (tls_type >= GOT_TLS_GD
+ && tls_type <= GOT_TLS_GDESC
+ && (elf_section_type (sec) != SHT_PROGBITS
+ || (sec->flags & SEC_CODE) == 0))
+ {
+ _bfd_x86_elf_link_report_tls_invalid_section_error
+ (abfd, sec, symtab_hdr, h, isym, howto);
+ goto error_return;
+ }
+
if (h != NULL)
{
h->got.refcount = 1;
diff --git a/bfd/elfxx-x86.c b/bfd/elfxx-x86.c
index 0d389968c91..d8c653a9ad2 100644
--- a/bfd/elfxx-x86.c
+++ b/bfd/elfxx-x86.c
@@ -3365,6 +3365,26 @@ _bfd_x86_elf_link_report_tls_transition_error
bfd_set_error (bfd_error_bad_value);
}
+/* Report TLS invalid section error. */
+
+void
+_bfd_x86_elf_link_report_tls_invalid_section_error
+ (bfd *abfd, asection *sec, Elf_Internal_Shdr *symtab_hdr,
+ struct elf_link_hash_entry *h, Elf_Internal_Sym *sym,
+ reloc_howto_type *howto)
+{
+ const char *name;
+ if (h)
+ name = h->root.root.string;
+ else
+ name = bfd_elf_sym_name (abfd, symtab_hdr, sym, NULL);
+ _bfd_error_handler
+ /* xgettext:c-format */
+ (_("%pB: relocation %s against thread local symbol `%s' in "
+ "invalid section `%pA'"), abfd, howto->name, name, sec);
+ bfd_set_error (bfd_error_bad_value);
+}
+
/* Return TRUE if symbol should be hashed in the `.gnu.hash' section. */
bool
diff --git a/bfd/elfxx-x86.h b/bfd/elfxx-x86.h
index 1ebc9d2f2e5..f8a24a77577 100644
--- a/bfd/elfxx-x86.h
+++ b/bfd/elfxx-x86.h
@@ -951,6 +951,10 @@ extern void _bfd_x86_elf_link_report_tls_transition_error
const Elf_Internal_Rela *, const char *, const char *,
enum elf_x86_tls_error_type);
+extern void _bfd_x86_elf_link_report_tls_invalid_section_error
+ (bfd *, asection *, Elf_Internal_Shdr *, struct elf_link_hash_entry *,
+ Elf_Internal_Sym *, reloc_howto_type *);
+
#define bfd_elf64_mkobject \
_bfd_x86_elf_mkobject
#define bfd_elf32_mkobject \