Compare commits

...

No commits in common. "c10s" and "c8s" have entirely different histories.
c10s ... c8s

7 changed files with 165 additions and 150 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
/binutils-with-gold-2.44.tar.xz
/binutils-2.19.50.0.1-output-format.sed

View File

@ -1,38 +0,0 @@
# Generate OUTPUT_FORMAT line for .so files from the system linker output.
# Imported from glibc/Makerules.
/ld.*[ ]-E[BL]/b f
/collect.*[ ]-E[BL]/b f
/OUTPUT_FORMAT[^)]*$/{N
s/\n[ ]*/ /
}
t o
: o
s/^.*OUTPUT_FORMAT(\([^,]*\), \1, \1).*$/OUTPUT_FORMAT(\1)/
t q
s/^.*OUTPUT_FORMAT(\([^,]*\), \([^,]*\), \([^,]*\)).*$/\1,\2,\3/
t s
s/^.*OUTPUT_FORMAT(\([^,)]*\).*$)/OUTPUT_FORMAT(\1)/
t q
d
: s
s/"//g
G
s/\n//
s/^\([^,]*\),\([^,]*\),\([^,]*\),B/OUTPUT_FORMAT(\2)/p
s/^\([^,]*\),\([^,]*\),\([^,]*\),L/OUTPUT_FORMAT(\3)/p
s/^\([^,]*\),\([^,]*\),\([^,]*\)/OUTPUT_FORMAT(\1)/p
/,/s|^|*** BUG in libc/scripts/output-format.sed *** |p
q
: q
s/"//g
p
q
: f
s/^.*[ ]-E\([BL]\)[ ].*$/,\1/
t h
s/^.*[ ]-E\([BL]\)$/,\1/
t h
d
: h
h

View File

@ -1,71 +0,0 @@
From 9ca499644a21ceb3f946d1c179c38a83be084490 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Thu, 18 Sep 2025 16:59:25 -0700
Subject: [PATCH] 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>
---
bfd/elfcode.h | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
--- binutils-with-gold-2.44.orig/bfd/elfcode.h 2025-11-25 13:08:19.115156918 +0000
+++ binutils-with-gold-2.44/bfd/elfcode.h 2025-11-25 13:10:34.050519670 +0000
@@ -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)

View File

@ -0,0 +1,146 @@
diff -rup binutils.orig/binutils/testsuite/binutils-all/compress.exp binutils-with-gold-2.44/binutils/testsuite/binutils-all/compress.exp
--- binutils.orig/binutils/testsuite/binutils-all/compress.exp 2025-04-15 14:24:46.257868845 +0100
+++ binutils-with-gold-2.44/binutils/testsuite/binutils-all/compress.exp 2025-04-15 14:25:27.994757009 +0100
@@ -143,6 +143,10 @@ if { [istarget "s390*-*-*"] } then {
return
}
+if { [istarget "s390x-*-*"] } {
+ return
+}
+
# Xfail this test if there are no compressed sections.
setup_xfail "$compression_used$target_triplet"
set testname "objcopy compress debug sections in archive with zlib-gnu"
Only in binutils-with-gold-2.44/binutils/testsuite/binutils-all: compress.exp.orig
diff -rup binutils.orig/binutils/testsuite/binutils-all/objcopy.exp binutils-with-gold-2.44/binutils/testsuite/binutils-all/objcopy.exp
--- binutils.orig/binutils/testsuite/binutils-all/objcopy.exp 2025-04-15 14:24:46.257868845 +0100
+++ binutils-with-gold-2.44/binutils/testsuite/binutils-all/objcopy.exp 2025-04-15 14:25:21.331457046 +0100
@@ -1105,7 +1105,7 @@ switch [copy_setup] {
"$OBJCOPY" "$OBJCOPYFLAGS" "$test5"
if [is_elf_format] {
keep_debug_symbols_and_check_links "$STRIP" "--only-keep-debug $STRIPFLAGS" "$test6"
- keep_debug_symbols_for_elf_relocatable "$STRIP" "--only-keep-debug $STRIPFLAGS" "$test7"
+ # keep_debug_symbols_for_elf_relocatable "$STRIP" "--only-keep-debug $STRIPFLAGS" "$test7"
}
}
"0" {
@@ -1116,7 +1116,7 @@ switch [copy_setup] {
"$OBJCOPY" "$OBJCOPYFLAGS" "$test5"
if [is_elf_format] {
keep_debug_symbols_and_check_links "$STRIP" "--only-keep-debug $STRIPFLAGS" "$test6"
- keep_debug_symbols_for_elf_relocatable "$STRIP" "--only-keep-debug $STRIPFLAGS" "$test7"
+ # keep_debug_symbols_for_elf_relocatable "$STRIP" "--only-keep-debug $STRIPFLAGS" "$test7"
}
}
}
@@ -1414,11 +1414,10 @@ proc objcopy_test_without_global_symbol
# The AArch64 and ARM targets preserve mapping symbols
# in object files, so they will fail this test.
-setup_xfail aarch64*-*-* arm*-*-*
+# setup_xfail aarch64*-*-* arm*-*-*
# The RISC-V target compiles with annotation enabled and these symbols remain after stripping.
# setup_xfail riscv*-*-*
-
-objcopy_test_without_global_symbol
+# objcopy_test_without_global_symbol
# objcopy remove relocation from executable test
Only in binutils-with-gold-2.44/binutils/testsuite/binutils-all: objcopy.exp.orig
diff -rup binutils.orig/ld/testsuite/ld-ctf/slice.d binutils-with-gold-2.44/ld/testsuite/ld-ctf/slice.d
--- binutils.orig/ld/testsuite/ld-ctf/slice.d 2025-04-15 14:24:47.726871383 +0100
+++ binutils-with-gold-2.44/ld/testsuite/ld-ctf/slice.d 2025-04-15 14:25:27.995352399 +0100
@@ -25,9 +25,9 @@ Contents of CTF section .ctf:
#...
0x[0-9a-f]*: \(kind 6\) struct slices \(size 0x[0-9a-f]*\) \(aligned at 0x[0-9a-f]*\)
*\[0x0\] one: ID 0x[0-9a-f]*: \(kind 1\) int:1 \[slice 0x0:0x1\] \(format 0x1\) \(size 0x1\) \(aligned at 0x1\)
- *\[0x1\] two: ID 0x[0-9a-f]*: \(kind 1\) int:2 \[slice 0x0:0x2\] \(format 0x1\) \(size 0x1\) \(aligned at 0x1\)
- *\[0x3\] six: ID 0x[0-9a-f]*: \(kind 1\) int:6 \[slice 0x0:0x6\] \(format 0x1\) \(size 0x1\) \(aligned at 0x1\)
- *\[0x9\] ten: ID 0x[0-9a-f]*: \(kind 1\) int:10 \[slice 0x0:0xa\] \(format 0x1\) \(size 0x2\) \(aligned at 0x2\)
- *\[0x13\] bar: ID 0x[0-9a-f]*: \(kind 8\) enum foo:1 \[slice 0x0:0x1\] \(format 0x1\) \(size 0x1\) \(aligned at 0x1\)
+ *\[0x.\] two: ID 0x[0-9a-f]*: \(kind 1\) int:2 \[slice 0x.:0x2\] \(format 0x1\) \(size 0x1\) \(aligned at 0x1\)
+ *\[0x.\] six: ID 0x[0-9a-f]*: \(kind 1\) int:6 \[slice 0x.:0x6\] \(format 0x1\) \(size 0x1\) \(aligned at 0x1\)
+ *\[0x.\] ten: ID 0x[0-9a-f]*: \(kind 1\) int:10 \[slice 0x.:0xa\] \(format 0x1\) \(size 0x2\) \(aligned at 0x2\)
+ *\[0x.*\] bar: ID 0x[0-9a-f]*: \(kind 8\) enum foo:1 \[slice 0x.*:0x1\] \(format 0x1\) \(size 0x1\) \(aligned at 0x1\)
#...
diff -rup binutils.orig/ld/testsuite/ld-elf/indirect.exp binutils-with-gold-2.44/ld/testsuite/ld-elf/indirect.exp
--- binutils.orig/ld/testsuite/ld-elf/indirect.exp 2025-04-15 14:24:47.740871408 +0100
+++ binutils-with-gold-2.44/ld/testsuite/ld-elf/indirect.exp 2025-04-15 14:25:27.994939548 +0100
@@ -135,6 +135,10 @@ set testname "Indirect symbol 2"
set cmd "$ld -shared -o tmpdir/indirect2.so tmpdir/indirect2.o"
check_link_message "$cmd" [list $string2] "$testname"
+if { [istarget "s390x-*-*"] } {
+ return
+}
+
set run_tests [list \
[list "Run with libindirect3c.so 1" \
"-Wl,--no-as-needed tmpdir/indirect3a.o tmpdir/indirect3b.o tmpdir/libindirect3c.so" "" \
diff -rup binutils.orig/ld/testsuite/ld-plugin/plugin.exp binutils-with-gold-2.44/ld/testsuite/ld-plugin/plugin.exp
--- binutils.orig/ld/testsuite/ld-plugin/plugin.exp 2025-04-15 14:24:47.870871632 +0100
+++ binutils-with-gold-2.44/ld/testsuite/ld-plugin/plugin.exp 2025-04-15 14:25:21.331843741 +0100
@@ -136,6 +136,8 @@ if { [istarget riscv*-*-*] } then {
return
}
+return
+
set plugin_tests [list \
[list "load plugin" "-plugin $plugin_path \
$testobjfiles $libs" "" "" "" {{ld plugin-1.d}} "main.x" ] \
diff -rup binutils.orig/ld/testsuite/ld-shared/shared.exp binutils-with-gold-2.44/ld/testsuite/ld-shared/shared.exp
--- binutils.orig/ld/testsuite/ld-shared/shared.exp 2025-04-15 14:24:47.915298066 +0100
+++ binutils-with-gold-2.44/ld/testsuite/ld-shared/shared.exp 2025-04-15 14:25:27.995415771 +0100
@@ -268,13 +268,14 @@ if ![ld_compile "$CC_FOR_TARGET $SHCFLAG
setup_xfail "x86_64-*-linux*"
}
setup_xfail "x86_64-*-linux-gnux32"
- setup_xfail "s390x-*-linux*"
+ # setup_xfail "s390x-*-linux*"
if [ string match $shared_needs_pic "yes" ] {
setup_xfail "arm*-*-linux*"
}
setup_xfail "aarch64*-*-linux*"
# Solaris defaults to -z text.
setup_xfail "*-*-solaris2*"
+ setup_xfail "s390x-*-*"
shared_test shnp "shared (non PIC, load offset)" \
mainnp.o sh1np.o sh2np.o shared \
"-Wl,-T,$srcdir/$subdir/elf-offset.ld,--hash-style=sysv"
Only in binutils-with-gold-2.44/ld/testsuite/ld-shared: shared.exp.orig
Only in binutils-with-gold-2.44/ld/testsuite/ld-vsb: vsb.exp.orig
Only in binutils-with-gold-2.44/ld/testsuite/ld-vsb: vsb.exp.rej
--- binutils.orig/ld/testsuite/ld-plugin/lto.exp 2025-04-15 14:24:47.870871632 +0100
+++ binutils-with-gold-2.44/ld/testsuite/ld-plugin/lto.exp 2025-04-15 15:03:46.747609390 +0100
@@ -1126,6 +1126,9 @@ if { [at_least_gcc_version 4 7] } {
# Run "ld -r" to generate inputs for complex LTO tests.
run_dump_test "lto-3r"
remote_exec host "mv" "tmpdir/dump tmpdir/lto-3.o"
+
+return
+
run_dump_test "lto-4r-a"
remote_exec host "mv" "tmpdir/dump tmpdir/lto-4r-a.o"
run_dump_test "lto-4r-b"
--- binutils.orig/ld/testsuite/ld-shared/shared.exp 2025-04-15 17:42:27.117817106 +0100
+++ binutils-with-gold-2.44/ld/testsuite/ld-shared/shared.exp 2025-04-15 17:43:19.204400918 +0100
@@ -247,6 +247,7 @@ if ![ld_compile "$CC_FOR_TARGET $SHCFLAG
setup_xfail "arm*-*-linux*"
}
setup_xfail "aarch64*-*-linux*"
+ setup_xfail "s390x-*-*"
shared_test shnp "shared (non PIC)" mainnp.o sh1np.o sh2np.o shared
# Test ELF shared library relocations with a non-zero load
@@ -275,7 +276,6 @@ if ![ld_compile "$CC_FOR_TARGET $SHCFLAG
setup_xfail "aarch64*-*-linux*"
# Solaris defaults to -z text.
setup_xfail "*-*-solaris2*"
- setup_xfail "s390x-*-*"
shared_test shnp "shared (non PIC, load offset)" \
mainnp.o sh1np.o sh2np.o shared \
"-Wl,-T,$srcdir/$subdir/elf-offset.ld,--hash-style=sysv"

View File

@ -5,11 +5,8 @@
%endif
%global gts_ver 15
%global gts_next %(v="%{gts_ver}"; echo $((++v)))
%{?scl_package:%global scl gcc-toolset-%{gts_ver}}
%global scl_prefix gcc-toolset-%{gts_ver}-
%if %have_scl_utils
BuildRequires: scl-utils-build
%else
@ -27,7 +24,7 @@ Name: %{?scl_prefix}binutils
# The variable %%{source} (see below) should be set to indicate which of these
# origins is being used.
Version: 2.44
Release: 8%{?dist}
Release: 3%{?dist}
License: GPL-3.0-or-later AND (GPL-3.0-or-later WITH Bison-exception-2.2) AND (LGPL-2.0-or-later WITH GCC-exception-2.0) AND BSD-3-Clause AND GFDL-1.3-or-later AND GPL-2.0-or-later AND LGPL-2.1-or-later AND LGPL-2.0-or-later
URL: https://sourceware.org/binutils
@ -151,7 +148,7 @@ URL: https://sourceware.org/binutils
# Bootstrapping: Set this to 1 to build the binutils with the system gcc.
# Then once GTS-gcc is built and in the buildroot, reset this variable
# to 0, bump the NVR and rebuild GTS-binutils.
%define bootstrapping 0
%define bootstrapping 1
#----End of Configure Options------------------------------------------------
@ -334,10 +331,8 @@ Patch18: binutils-fix-ar-test.patch
# Lifetime: Fixed in 2.45
Patch19: binutils-aarch64-small-plt0.patch
# Purpose: Stops a potential illegal memory access when linking a corrupt
# input file. PR 33457
# Lifetime: Fixed in 2.46
Patch20: binutils-CVE-2025-11083.patch
# Testsuite failure workarounds/fixes that are only needed for RHEL-8 ...
Patch20: binutils-extra-testsuite-fixes.patch
#----------------------------------------------------------------------------
@ -391,15 +386,13 @@ BuildRequires: clang compiler-rt
%define gcc_package %{?scl_prefix}gcc
%define gxx_package %{?scl_prefix}gcc-c++
%define gcc_for_binutils %{_scl_root}/usr/bin/gcc
%define gxx_for_binutils %{_scl_root}/usr/bin/g++
%if 0%{rhel} < 9
BuildRequires: %{?scl_prefix}annobin-plugin-gcc
%else
BuildRequires: %{?scl_prefix}gcc-plugin-annobin
%endif
%define gcc_for_binutils %{_scl_root}/usr/bin/gcc
%define gxx_for_binutils %{_scl_root}/usr/bin/g++
%endif
BuildRequires: %{gcc_package}
@ -482,10 +475,7 @@ BuildRequires: xxhash-devel
%if %have_scl_utils
%{?scl:Requires:%scl_runtime}
%else
Requires: (%{?scl_prefix}runtime >= %{gts_ver} with %{?scl_prefix}runtime < %{gts_next})
%endif
%define alternatives_cmd %{!?scl:%{_sbindir}}%{?scl:%{_root_sbindir}}/alternatives
%define alternatives_cmdline %{alternatives_cmd}%{?scl: --altdir %{_sysconfdir}/alternatives --admindir %{_scl_root}/var/lib/alternatives}
@ -690,11 +680,13 @@ use by developers. It is NOT INTENDED FOR PRODUCTION use.
%autopatch -p1
%else
%if "%{source}" == "snapshot"
%autosetup -p1 -n binutils-%{version}-%{commit_id}
%elif "%{source}" == "official-release"
%autosetup -Xv -p1 -n binutils-%{version}-%{commit_id}
%else
%if "%{source}" == "official-release"
%autosetup -p1 -n binutils-with-gold-%{version}
%else
%autosetup -p1 -n binutils-%{version}
%autosetup -Xb -p1 -n binutils-%{version}
%endif
%endif
%endif
@ -1581,27 +1573,11 @@ exit 0
#----------------------------------------------------------------------------
%changelog
* Tue Nov 25 2025 Nick Clifton <nickc@redhat.com> - 2.44-8
- Fix a potential illegal memory access when linking a corrupt input file. (RHEL-130615)
* Mon Aug 11 2025 Nick Clifton <nickc@redhat.com> - 2.44-7
- Remove uneeded glibc/powerpc patch. (RHEL-100160)
* Wed Aug 06 2025 Nick Clifton <nickc@redhat.com> - 2.44-6
- Rebuild with glibc fixed for CVE-2025-5702. (RHEL-100160)
* Tue Jul 22 2025 Nick Clifton <nickc@redhat.com> - 2.44-5
- Disable bootstrapping. (RHEL-94763)
* Tue Jun 24 2025 Nick Clifton <nickc@redhat.com> - 2.44-4
- Use the new gcc-toolset-15-runtime package. (RHEL-94763)
- Add in the temporary fix for ppc64 gcc/glibc generating bad code. (RHEL-49348)
* Mon May 12 2025 Siddhesh Poyarekar <siddhesh@redhat.com> - 2.44-3
- Avoid using SCL for c10s.
* Thu May 08 2025 Nick Clifton <nickc@redhat.com> - 2.44-2
- Switch back to using SCL macros.
* Wed May 07 2025 Siddhesh Poyarekar <siddhesh@redhat.com> - 2.44-2
- Use system alternatives even for bootstrap.
* Tue May 06 2025 Nick Clifton <nickc@redhat.com> - 2.44-1
- Initial commit: Import Fedora 42 binutils to GTS-15. (RHELPLAN-172023) (RHEL-81745)
* Tue Apr 15 2025 Nick Clifton <nickc@redhat.com> - 2.44-1
- Initial commit: Import Fedora 42 binutils to GTS-15. (RHEL-81744)

View File

@ -7,7 +7,7 @@ rules:
- !PassingTestCaseRule {test_case_name: baseos-qe.koji-build.scratch-build.validation}
--- !Policy
product_versions:
- rhel-10
- rhel-8
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.gate-build-fast-lane.functional}

View File

@ -1 +1,2 @@
SHA512 (binutils-with-gold-2.44.tar.xz) = 1d8688f1b6f1bc64cfd1f82e3af05b8ace1d709d4fa819acb4d12d74e1b69b4314d98fb4281dacc9b5fa51ff7370d0249f540ec016fd137aa701502d72426301
SHA512 (binutils-2.19.50.0.1-output-format.sed) = 2f8686b0c8af13c98cda056824c2820416f6e2d003f70b78ccf5314525b9ee3684d421dfa83e638a2d42d06ea4d4bdaf5226b64d6ec26f7ff59c44ffb2a23dd2