diff --git a/.gitignore b/.gitignore index 803a56d..96c4ac7 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,4 @@ binutils-2.20.1.tar.bz2 /binutils-2.41.tar.xz /binutils-2.42.tar.xz /binutils-2.43.1.tar.xz +/binutils-with-gold-2.44.tar.xz diff --git a/CVE-2022-38533.patch b/CVE-2022-38533.patch deleted file mode 100644 index 8262b4e..0000000 --- a/CVE-2022-38533.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff -rupN --no-dereference binutils-2.39/bfd/coffcode.h binutils-2.39-new/bfd/coffcode.h ---- binutils-2.39/bfd/coffcode.h 2022-07-08 11:46:47.000000000 +0200 -+++ binutils-2.39-new/bfd/coffcode.h 2022-10-30 12:41:41.408023817 +0100 -@@ -4284,10 +4284,13 @@ coff_set_section_contents (bfd * abfd, - - rec = (bfd_byte *) location; - recend = rec + count; -- while (rec < recend) -+ while (recend - rec >= 4) - { -+ size_t len = bfd_get_32 (abfd, rec); -+ if (len == 0 || len > (size_t) (recend - rec) / 4) -+ break; -+ rec += len * 4; - ++section->lma; -- rec += bfd_get_32 (abfd, rec) * 4; - } - - BFD_ASSERT (rec == recend); diff --git a/binutils-aarch64-small-plt0.patch b/binutils-aarch64-small-plt0.patch new file mode 100644 index 0000000..ef0ddcd --- /dev/null +++ b/binutils-aarch64-small-plt0.patch @@ -0,0 +1,12 @@ +--- binutils.orig/bfd/elfnn-aarch64.c 2025-02-07 13:42:20.961333141 +0000 ++++ binutils-with-gold-2.44/bfd/elfnn-aarch64.c 2025-02-07 13:42:29.781353740 +0000 +@@ -10162,7 +10162,8 @@ elfNN_aarch64_init_small_plt0_entry (bfd + /* PR 26312: Explicitly set the sh_entsize to 0 so that + consumers do not think that the section contains fixed + sized objects. */ +- elf_section_data (htab->root.splt->output_section)->this_hdr.sh_entsize = 0; ++ if (elf_section_data (htab->root.splt->output_section) != NULL) ++ elf_section_data (htab->root.splt->output_section)->this_hdr.sh_entsize = 0; + + plt_got_2nd_ent = (htab->root.sgotplt->output_section->vma + + htab->root.sgotplt->output_offset diff --git a/binutils-disable-gcs-report-dynamic-tests.patch b/binutils-disable-gcs-report-dynamic-tests.patch new file mode 100644 index 0000000..c7edc50 --- /dev/null +++ b/binutils-disable-gcs-report-dynamic-tests.patch @@ -0,0 +1,413 @@ +From 9e7085f2700d698dfbb37aef24c0489c2d09a978 Mon Sep 17 00:00:00 2001 +From: Siddhesh Poyarekar +Date: Thu, 6 Feb 2025 12:06:27 -0500 +Subject: [PATCH] Revert "aarch64: GCS tests for linking issues with dynamic + objects" + +This reverts commit 1c136b8ee9b9fb402b66957bd51e89e47b94a0f6. +--- + .../protections/aarch64-protections.exp | 15 ---------- + .../ld-aarch64/protections/gcs-dynamic-1-a.d | 12 -------- + .../ld-aarch64/protections/gcs-dynamic-1-b.d | 12 -------- + .../protections/gcs-dynamic-2-a-i.d | 15 ---------- + .../protections/gcs-dynamic-2-a-ii.d | 8 ------ + .../protections/gcs-dynamic-2-a-iii.d | 15 ---------- + .../protections/gcs-dynamic-2-a-iv.d | 12 -------- + .../ld-aarch64/protections/gcs-dynamic-2-b.d | 14 ---------- + .../ld-aarch64/protections/gcs-dynamic-2-c.d | 12 -------- + .../ld-aarch64/protections/gcs-dynamic-2-d.d | 14 ---------- + .../ld-aarch64/protections/gcs-dynamic-3-a.d | 15 ---------- + .../ld-aarch64/protections/gcs-dynamic-3-b.d | 14 ---------- + .../ld-aarch64/protections/gcs-dynamic-3-c.d | 12 -------- + .../ld-aarch64/protections/gcs-dynamic-4-a.d | 7 ----- + .../ld-aarch64/protections/gcs-dynamic-4-b.d | 7 ----- + .../ld-aarch64/protections/gcs-dynamic-4-c.d | 7 ----- + ld/testsuite/ld-aarch64/protections/gcs-so.s | 28 ------------------- + ld/testsuite/ld-aarch64/protections/gcs-so2.s | 28 ------------------- + 18 files changed, 247 deletions(-) + delete mode 100644 ld/testsuite/ld-aarch64/protections/gcs-dynamic-1-a.d + delete mode 100644 ld/testsuite/ld-aarch64/protections/gcs-dynamic-1-b.d + delete mode 100644 ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-a-i.d + delete mode 100644 ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-a-ii.d + delete mode 100644 ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-a-iii.d + delete mode 100644 ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-a-iv.d + delete mode 100644 ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-b.d + delete mode 100644 ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-c.d + delete mode 100644 ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-d.d + delete mode 100644 ld/testsuite/ld-aarch64/protections/gcs-dynamic-3-a.d + delete mode 100644 ld/testsuite/ld-aarch64/protections/gcs-dynamic-3-b.d + delete mode 100644 ld/testsuite/ld-aarch64/protections/gcs-dynamic-3-c.d + delete mode 100644 ld/testsuite/ld-aarch64/protections/gcs-dynamic-4-a.d + delete mode 100644 ld/testsuite/ld-aarch64/protections/gcs-dynamic-4-b.d + delete mode 100644 ld/testsuite/ld-aarch64/protections/gcs-dynamic-4-c.d + delete mode 100644 ld/testsuite/ld-aarch64/protections/gcs-so.s + delete mode 100644 ld/testsuite/ld-aarch64/protections/gcs-so2.s + +diff --git a/ld/testsuite/ld-aarch64/protections/aarch64-protections.exp b/ld/testsuite/ld-aarch64/protections/aarch64-protections.exp +index cf0f03daee6..b49428d1039 100644 +--- a/ld/testsuite/ld-aarch64/protections/aarch64-protections.exp ++++ b/ld/testsuite/ld-aarch64/protections/aarch64-protections.exp +@@ -42,21 +42,6 @@ set aarch64elflinktests { + "-shared" "" + "-I$srcdir/$subdir -defsym __property_bti__=1" + {bti-plt-so.s} {} "libbti-plt-so.so"} +- +- {"Build gcs-so for GCS tests" +- "-shared" "" +- "-I$srcdir/$subdir -defsym __property_gcs__=1" +- {gcs-so.s} {} "libgcs-so.so"} +- +- {"Build nogcs-so for GCS tests" +- "-shared" "" +- "-I$srcdir/$subdir" +- {gcs-so.s} {} "libnogcs-so.so"} +- +- {"Build gcs-so2 for GCS tests" +- "-shared" "" +- "-I$srcdir/$subdir -defsym __property_gcs__=1" +- {gcs-so2.s} {} "libgcs-so2.so"} + } + + if [check_shared_lib_support] { +diff --git a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-1-a.d b/ld/testsuite/ld-aarch64/protections/gcs-dynamic-1-a.d +deleted file mode 100644 +index be8a301f6c0..00000000000 +--- a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-1-a.d ++++ /dev/null +@@ -1,12 +0,0 @@ +-#name: '-z gcs=always -z gcs-report=error' and shared library with GCS feature reports no error. +-#source: gcs.s +-#source: gcs2.s +-#alltargets: [check_shared_lib_support] *linux* +-#as: -march=armv9.4-a+gcs -defsym __property_gcs__=1 +-#ld: -z gcs=always -z gcs-report=error -L./tmpdir -lgcs-so +-#readelf: -n +- +-Displaying notes found in: .note.gnu.property +-[ ]+Owner[ ]+Data size[ ]+Description +- GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0 +- Properties: AArch64 feature: GCS +diff --git a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-1-b.d b/ld/testsuite/ld-aarch64/protections/gcs-dynamic-1-b.d +deleted file mode 100644 +index d53d45ae598..00000000000 +--- a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-1-b.d ++++ /dev/null +@@ -1,12 +0,0 @@ +-#name: '-z gcs=always -z gcs-report=error -z gcs-report-dynamic=error' and shared library with GCS feature reports no error. +-#source: gcs.s +-#source: gcs2.s +-#alltargets: [check_shared_lib_support] *linux* +-#as: -march=armv9.4-a+gcs -defsym __property_gcs__=1 +-#ld: -z gcs=always -z gcs-report=error -z gcs-report-dynamic=error -L./tmpdir -lgcs-so +-#readelf: -n +- +-Displaying notes found in: .note.gnu.property +-[ ]+Owner[ ]+Data size[ ]+Description +- GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0 +- Properties: AArch64 feature: GCS +diff --git a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-a-i.d b/ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-a-i.d +deleted file mode 100644 +index 903d14099be..00000000000 +--- a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-a-i.d ++++ /dev/null +@@ -1,15 +0,0 @@ +-#name: '-z gcs=always -z gcs-report=error' and shared libraries without GCS feature reports warnings. +-#source: gcs.s +-#source: gcs2.s +-#alltargets: [check_shared_lib_support] *linux* +-#as: -march=armv9.4-a+gcs -defsym __property_gcs__=1 +-#ld: -z gcs=always -z gcs-report=error -L./tmpdir -lnogcs-so -lbti-plt-so -lgcs-so2 +-#warning: \A[^\n]*libnogcs-so\.so: warning: GCS is required by -z gcs[^\n]*\n +-#warning: [^\n]*libbti-plt-so\.so: warning: GCS is required by -z gcs[^\n]* +- +-#readelf: -n +- +-Displaying notes found in: .note.gnu.property +-[ ]+Owner[ ]+Data size[ ]+Description +- GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0 +- Properties: AArch64 feature: GCS +diff --git a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-a-ii.d b/ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-a-ii.d +deleted file mode 100644 +index 7adb481bc30..00000000000 +--- a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-a-ii.d ++++ /dev/null +@@ -1,8 +0,0 @@ +-#name: '-z gcs=always -z gcs-report=error -z gcs-report-dynamic=error' and shared libraries without GCS feature reports errors. +-#source: gcs.s +-#source: gcs2.s +-#alltargets: [check_shared_lib_support] *linux* +-#as: -march=armv9.4-a+gcs -defsym __property_gcs__=1 +-#ld: -z gcs=always -z gcs-report=error -z gcs-report-dynamic=error -L./tmpdir -lnogcs-so -lbti-plt-so -lgcs-so2 +-#error: \A[^\n]*libnogcs-so\.so: error: GCS is required by -z gcs[^\n]*\n +-#error: [^\n]*libbti-plt-so\.so: error: GCS is required by -z gcs[^\n]* +\ No newline at end of file +diff --git a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-a-iii.d b/ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-a-iii.d +deleted file mode 100644 +index 76a7c461347..00000000000 +--- a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-a-iii.d ++++ /dev/null +@@ -1,15 +0,0 @@ +-#name: '-z gcs=always -z gcs-report=error -z gcs-report-dynamic=warning' and shared libraries without GCS feature reports warnings. +-#source: gcs.s +-#source: gcs2.s +-#alltargets: [check_shared_lib_support] *linux* +-#as: -march=armv9.4-a+gcs -defsym __property_gcs__=1 +-#ld: -z gcs=always -z gcs-report=error -z gcs-report-dynamic=warning -L./tmpdir -lnogcs-so -lbti-plt-so -lgcs-so2 +-#warning: \A[^\n]*libnogcs-so\.so: warning: GCS is required by -z gcs[^\n]*\n +-#warning: [^\n]*libbti-plt-so\.so: warning: GCS is required by -z gcs[^\n]* +- +-#readelf: -n +- +-Displaying notes found in: .note.gnu.property +-[ ]+Owner[ ]+Data size[ ]+Description +- GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0 +- Properties: AArch64 feature: GCS +\ No newline at end of file +diff --git a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-a-iv.d b/ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-a-iv.d +deleted file mode 100644 +index 554ca1186ef..00000000000 +--- a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-a-iv.d ++++ /dev/null +@@ -1,12 +0,0 @@ +-#name: '-z gcs=always -z gcs-report=error -z gcs-report-dynamic=none' and shared libraries without GCS feature reports nothing. +-#source: gcs.s +-#source: gcs2.s +-#alltargets: [check_shared_lib_support] *linux* +-#as: -march=armv9.4-a+gcs -defsym __property_gcs__=1 +-#ld: -z gcs=always -z gcs-report=error -z gcs-report-dynamic=none -L./tmpdir -lnogcs-so -lbti-plt-so -lgcs-so2 +-#readelf: -n +- +-Displaying notes found in: .note.gnu.property +-[ ]+Owner[ ]+Data size[ ]+Description +- GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0 +- Properties: AArch64 feature: GCS +\ No newline at end of file +diff --git a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-b.d b/ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-b.d +deleted file mode 100644 +index 36262bbc087..00000000000 +--- a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-b.d ++++ /dev/null +@@ -1,14 +0,0 @@ +-#name: '-z gcs=always -z gcs-report=warning' and shared libraries without GCS feature reports warnings. +-#source: gcs.s +-#source: gcs2.s +-#alltargets: [check_shared_lib_support] *linux* +-#as: -march=armv9.4-a+gcs -defsym __property_gcs__=1 +-#ld: -z gcs=always -z gcs-report=warning -L./tmpdir -lnogcs-so -lbti-plt-so -lgcs-so2 +-#warning: \A[^\n]*libnogcs-so\.so: warning: GCS is required by -z gcs[^\n]*\n +-#warning: [^\n]*libbti-plt-so\.so: warning: GCS is required by -z gcs[^\n]* +-#readelf: -n +- +-Displaying notes found in: .note.gnu.property +-[ ]+Owner[ ]+Data size[ ]+Description +- GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0 +- Properties: AArch64 feature: GCS +diff --git a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-c.d b/ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-c.d +deleted file mode 100644 +index 6c7f5da8be7..00000000000 +--- a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-c.d ++++ /dev/null +@@ -1,12 +0,0 @@ +-#name: '-z gcs=always -z gcs-report=none' and shared libraries without GCS feature reports nothing. +-#source: gcs.s +-#source: gcs2.s +-#alltargets: [check_shared_lib_support] *linux* +-#as: -march=armv9.4-a+gcs -defsym __property_gcs__=1 +-#ld: -z gcs=always -z gcs-report=none -L./tmpdir -lnogcs-so -lbti-plt-so -lgcs-so2 +-#readelf: -n +- +-Displaying notes found in: .note.gnu.property +-[ ]+Owner[ ]+Data size[ ]+Description +- GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0 +- Properties: AArch64 feature: GCS +diff --git a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-d.d b/ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-d.d +deleted file mode 100644 +index 58498e6c00b..00000000000 +--- a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-d.d ++++ /dev/null +@@ -1,14 +0,0 @@ +-#name: '-z gcs=always -z gcs-report' and shared libraries without GCS feature reports warnings. +-#source: gcs.s +-#source: gcs2.s +-#alltargets: [check_shared_lib_support] *linux* +-#as: -march=armv9.4-a+gcs -defsym __property_gcs__=1 +-#ld: -z gcs=always -z gcs-report -L./tmpdir -lnogcs-so -lbti-plt-so -lgcs-so2 +-#warning: \A[^\n]*libnogcs-so\.so: warning: GCS is required by -z gcs[^\n]*\n +-#warning: [^\n]*libbti-plt-so\.so: warning: GCS is required by -z gcs[^\n]* +-#readelf: -n +- +-Displaying notes found in: .note.gnu.property +-[ ]+Owner[ ]+Data size[ ]+Description +- GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0 +- Properties: AArch64 feature: GCS +diff --git a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-3-a.d b/ld/testsuite/ld-aarch64/protections/gcs-dynamic-3-a.d +deleted file mode 100644 +index ecdaf526779..00000000000 +--- a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-3-a.d ++++ /dev/null +@@ -1,15 +0,0 @@ +-#name: '-z gcs=implicit -z gcs-report=error' and shared libraries without GCS feature reports warnings. +-#source: gcs.s +-#source: gcs2.s +-#alltargets: [check_shared_lib_support] *linux* +-#as: -march=armv9.4-a+gcs -defsym __property_gcs__=1 +-#ld: -z gcs=implicit -z gcs-report=error -L./tmpdir -lnogcs-so -lbti-plt-so -lgcs-so2 +-#warning: \A[^\n]*libnogcs-so\.so: warning: GCS is required by -z gcs[^\n]*\n +-#warning: [^\n]*libbti-plt-so\.so: warning: GCS is required by -z gcs[^\n]* +- +-#readelf: -n +- +-Displaying notes found in: .note.gnu.property +-[ ]+Owner[ ]+Data size[ ]+Description +- GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0 +- Properties: AArch64 feature: GCS +diff --git a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-3-b.d b/ld/testsuite/ld-aarch64/protections/gcs-dynamic-3-b.d +deleted file mode 100644 +index 4d32fb6aa54..00000000000 +--- a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-3-b.d ++++ /dev/null +@@ -1,14 +0,0 @@ +-#name: '-z gcs=implicit -z gcs-report=warning' and shared libraries without GCS feature reports warnings. +-#source: gcs.s +-#source: gcs2.s +-#alltargets: [check_shared_lib_support] *linux* +-#as: -march=armv9.4-a+gcs -defsym __property_gcs__=1 +-#ld: -z gcs=implicit -z gcs-report=warning -L./tmpdir -lnogcs-so -lbti-plt-so -lgcs-so2 +-#warning: \A[^\n]*libnogcs-so\.so: warning: GCS is required by -z gcs[^\n]*\n +-#warning: [^\n]*libbti-plt-so\.so: warning: GCS is required by -z gcs[^\n]* +-#readelf: -n +- +-Displaying notes found in: .note.gnu.property +-[ ]+Owner[ ]+Data size[ ]+Description +- GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0 +- Properties: AArch64 feature: GCS +\ No newline at end of file +diff --git a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-3-c.d b/ld/testsuite/ld-aarch64/protections/gcs-dynamic-3-c.d +deleted file mode 100644 +index c0da6c1d9c6..00000000000 +--- a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-3-c.d ++++ /dev/null +@@ -1,12 +0,0 @@ +-#name: '-z gcs=implicit -z gcs-report=none' and shared libraries without GCS feature reports no warning. +-#source: gcs.s +-#source: gcs2.s +-#alltargets: [check_shared_lib_support] *linux* +-#as: -march=armv9.4-a+gcs -defsym __property_gcs__=1 +-#ld: -z gcs=implicit -z gcs-report=none -L./tmpdir -lnogcs-so -lbti-plt-so -lgcs-so2 +-#readelf: -n +- +-Displaying notes found in: .note.gnu.property +-[ ]+Owner[ ]+Data size[ ]+Description +- GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0 +- Properties: AArch64 feature: GCS +\ No newline at end of file +diff --git a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-4-a.d b/ld/testsuite/ld-aarch64/protections/gcs-dynamic-4-a.d +deleted file mode 100644 +index ae324bbba1e..00000000000 +--- a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-4-a.d ++++ /dev/null +@@ -1,7 +0,0 @@ +-#name: '-z gcs=never -z gcs-report=error' and shared libraries without GCS feature reports no warning/error. +-#source: gcs.s +-#source: gcs2.s +-#alltargets: [check_shared_lib_support] *linux* +-#as: -march=armv9.4-a+gcs -defsym __property_gcs__=1 +-#ld: -z gcs=never -z gcs-report=error -L./tmpdir -lnogcs-so -lbti-plt-so -lgcs-so2 +-#readelf: -n +diff --git a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-4-b.d b/ld/testsuite/ld-aarch64/protections/gcs-dynamic-4-b.d +deleted file mode 100644 +index 6b65898b924..00000000000 +--- a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-4-b.d ++++ /dev/null +@@ -1,7 +0,0 @@ +-#name: '-z gcs=never -z gcs-report=warning' and shared libraries without GCS feature reports no warning/error. +-#source: gcs.s +-#source: gcs2.s +-#alltargets: [check_shared_lib_support] *linux* +-#as: -march=armv9.4-a+gcs -defsym __property_gcs__=1 +-#ld: -z gcs=never -z gcs-report=warning -L./tmpdir -lnogcs-so -lbti-plt-so -lgcs-so2 +-#readelf: -n +diff --git a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-4-c.d b/ld/testsuite/ld-aarch64/protections/gcs-dynamic-4-c.d +deleted file mode 100644 +index 35b011f6a8e..00000000000 +--- a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-4-c.d ++++ /dev/null +@@ -1,7 +0,0 @@ +-#name: '-z gcs=never -z gcs-report=none' and shared libraries without GCS feature reports no warning/error. +-#source: gcs.s +-#source: gcs2.s +-#alltargets: [check_shared_lib_support] *linux* +-#as: -march=armv9.4-a+gcs -defsym __property_gcs__=1 +-#ld: -z gcs=never -z gcs-report=none -L./tmpdir -lnogcs-so -lbti-plt-so -lgcs-so2 +-#readelf: -n +diff --git a/ld/testsuite/ld-aarch64/protections/gcs-so.s b/ld/testsuite/ld-aarch64/protections/gcs-so.s +deleted file mode 100644 +index aa6485b9dde..00000000000 +--- a/ld/testsuite/ld-aarch64/protections/gcs-so.s ++++ /dev/null +@@ -1,28 +0,0 @@ +- .global foo2 +- .type foo2, %function +-foo2: +- sub sp, sp, #16 +- mov w0, 9 +- str w0, [sp, 12] +- ldr w0, [sp, 12] +- add w0, w0, 4 +- str w0, [sp, 12] +- nop +- add sp, sp, 16 +- ret +- .size foo2, .-foo2 +- .global bar2 +- .type bar2, %function +-bar2: +- sub sp, sp, #16 +- mov w0, 9 +- str w0, [sp, 12] +- ldr w0, [sp, 12] +- add w0, w0, 4 +- str w0, [sp, 12] +- nop +- add sp, sp, 16 +- ret +- .size bar2, .-bar2 +- +-.include "gnu-note-properties-selectable-merged.inc" +diff --git a/ld/testsuite/ld-aarch64/protections/gcs-so2.s b/ld/testsuite/ld-aarch64/protections/gcs-so2.s +deleted file mode 100644 +index 938ba43c69c..00000000000 +--- a/ld/testsuite/ld-aarch64/protections/gcs-so2.s ++++ /dev/null +@@ -1,28 +0,0 @@ +- .global foo3 +- .type foo3, %function +-foo3: +- sub sp, sp, #16 +- mov w0, 9 +- str w0, [sp, 12] +- ldr w0, [sp, 12] +- add w0, w0, 4 +- str w0, [sp, 12] +- nop +- add sp, sp, 16 +- ret +- .size foo3, .-foo3 +- .global bar3 +- .type bar3, %function +-bar3: +- sub sp, sp, #16 +- mov w0, 9 +- str w0, [sp, 12] +- ldr w0, [sp, 12] +- add w0, w0, 4 +- str w0, [sp, 12] +- nop +- add sp, sp, 16 +- ret +- .size bar3, .-bar3 +- +-.include "gnu-note-properties-selectable-merged.inc" +-- +2.48.1 + diff --git a/binutils-disable-gcs-report-dynamic.patch b/binutils-disable-gcs-report-dynamic.patch new file mode 100644 index 0000000..fa91846 --- /dev/null +++ b/binutils-disable-gcs-report-dynamic.patch @@ -0,0 +1,17 @@ +diff -pruN a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c +--- a/bfd/elfnn-aarch64.c 2025-02-06 10:39:49.722259921 -0500 ++++ b/bfd/elfnn-aarch64.c 2025-02-06 10:47:28.604658973 -0500 +@@ -5051,11 +5051,10 @@ bfd_elfNN_aarch64_set_options (struct bf + libraries. If a user also wants to error GCS issues in the shared + libraries, '-z gcs-report-dynamic=error' will have to be specified + explicitly. */ ++ /* XXX Fedora override: default to NONE. */ + if (sw_protections->gcs_report_dynamic == MARKING_UNSET) + elf_aarch64_tdata (output_bfd)->sw_protections.gcs_report_dynamic +- = (sw_protections->gcs_report == MARKING_ERROR) +- ? MARKING_WARN +- : sw_protections->gcs_report; ++ = MARKING_NONE; + + elf_aarch64_tdata (output_bfd)->n_bti_issues = 0; + elf_aarch64_tdata (output_bfd)->n_gcs_issues = 0; diff --git a/binutils-do-not-link-with-static-libstdc++.patch b/binutils-do-not-link-with-static-libstdc++.patch index af73925..67b7c4a 100644 --- a/binutils-do-not-link-with-static-libstdc++.patch +++ b/binutils-do-not-link-with-static-libstdc++.patch @@ -51,10 +51,9 @@ diff -rup binutils.orig/configure binutils-2.40/configure if test -n "$ac_tool_prefix"; then -diff -rup binutils.orig/configure.ac binutils-2.40/configure.ac ---- binutils.orig/configure.ac 2023-02-13 14:43:00.728877170 +0000 -+++ binutils-2.40/configure.ac 2023-02-13 14:43:13.671864892 +0000 -@@ -1435,26 +1435,6 @@ if test -z "$LD"; then +--- binutils.orig/configure.ac 2024-11-26 15:08:50.162328683 +0000 ++++ binutils-2.43.50-1686dc7079f/configure.ac 2024-11-26 15:08:56.929374527 +0000 +@@ -1410,26 +1410,6 @@ if test -z "$LD"; then fi fi @@ -80,6 +79,4 @@ diff -rup binutils.orig/configure.ac binutils-2.40/configure.ac - ACX_PROG_GNAT ACX_PROG_GDC - ACX_PROG_CMP_IGNORE_INITIAL -Only in binutils-2.40: configure.ac.orig -Only in binutils-2.40: configure.orig + ACX_PROG_CARGO diff --git a/binutils-filename-in-error-messages.patch b/binutils-filename-in-error-messages.patch deleted file mode 100644 index c9b406e..0000000 --- a/binutils-filename-in-error-messages.patch +++ /dev/null @@ -1,126 +0,0 @@ -diff -rupN --no-dereference binutils-2.39/binutils/readelf.c binutils-2.39-new/binutils/readelf.c ---- binutils-2.39/binutils/readelf.c 2022-07-08 11:46:47.000000000 +0200 -+++ binutils-2.39-new/binutils/readelf.c 2022-10-30 12:41:25.339023741 +0100 -@@ -22710,46 +22710,53 @@ process_file (char * file_name) - Filedata * filedata = NULL; - struct stat statbuf; - char armag[SARMAG]; -- bool ret = true; -+ bool ret = false; -+ char * name; -+ char * saved_program_name; -+ -+ /* Overload program_name to include file_name. Doing this means -+ that warning/error messages will positively identify the file -+ concerned even when multiple instances of readelf are running. */ -+ name = xmalloc (strlen (program_name) + strlen (file_name) + 3); -+ sprintf (name, "%s: %s", program_name, file_name); -+ saved_program_name = program_name; -+ program_name = name; - - if (stat (file_name, &statbuf) < 0) - { - if (errno == ENOENT) -- error (_("'%s': No such file\n"), file_name); -+ error (_("No such file\n")); - else -- error (_("Could not locate '%s'. System error message: %s\n"), -- file_name, strerror (errno)); -- return false; -+ error (_("Could not locate file. System error message: %s\n"), -+ strerror (errno)); -+ goto done; - } - - if (! S_ISREG (statbuf.st_mode)) - { -- error (_("'%s' is not an ordinary file\n"), file_name); -- return false; -+ error (_("Not an ordinary file\n")); -+ goto done; - } - - filedata = calloc (1, sizeof * filedata); - if (filedata == NULL) - { - error (_("Out of memory allocating file data structure\n")); -- return false; -+ goto done; - } - - filedata->file_name = file_name; - filedata->handle = fopen (file_name, "rb"); - if (filedata->handle == NULL) - { -- error (_("Input file '%s' is not readable.\n"), file_name); -- free (filedata); -- return false; -+ error (_("Not readable\n")); -+ goto done; - } - - if (fread (armag, SARMAG, 1, filedata->handle) != 1) - { -- error (_("%s: Failed to read file's magic number\n"), file_name); -- fclose (filedata->handle); -- free (filedata); -- return false; -+ error (_("Failed to read file's magic number\n")); -+ goto done; - } - - filedata->file_size = (bfd_size_type) statbuf.st_size; -@@ -22757,33 +22764,39 @@ process_file (char * file_name) - - if (memcmp (armag, ARMAG, SARMAG) == 0) - { -- if (! process_archive (filedata, false)) -- ret = false; -+ if (process_archive (filedata, false)) -+ ret = true; - } - else if (memcmp (armag, ARMAGT, SARMAG) == 0) - { -- if ( ! process_archive (filedata, true)) -- ret = false; -+ if (process_archive (filedata, true)) -+ ret = true; - } - else - { - if (do_archive_index && !check_all) -- error (_("File %s is not an archive so its index cannot be displayed.\n"), -- file_name); -+ error (_("Not an archive so its index cannot be displayed.\n")); - - rewind (filedata->handle); - filedata->archive_file_size = filedata->archive_file_offset = 0; - -- if (! process_object (filedata)) -- ret = false; -+ if (process_object (filedata)) -+ ret = true; - } - -- fclose (filedata->handle); -- free (filedata->section_headers); -- free (filedata->program_headers); -- free (filedata->string_table); -- free (filedata->dump.dump_sects); -- free (filedata); -+ done: -+ if (filedata) -+ { -+ if (filedata->handle != NULL) -+ fclose (filedata->handle); -+ free (filedata->section_headers); -+ free (filedata->program_headers); -+ free (filedata->string_table); -+ free (filedata->dump.dump_sects); -+ free (filedata); -+ } -+ free (program_name); -+ program_name = saved_program_name; - - free (ba_cache.strtab); - ba_cache.strtab = NULL; diff --git a/binutils-gas-dwarf-skip-empty-functions.patch b/binutils-gas-dwarf-skip-empty-functions.patch deleted file mode 100644 index 5f0371c..0000000 --- a/binutils-gas-dwarf-skip-empty-functions.patch +++ /dev/null @@ -1,67 +0,0 @@ -diff -rupN --no-dereference binutils-2.39/gas/dwarf2dbg.c binutils-2.39-new/gas/dwarf2dbg.c ---- binutils-2.39/gas/dwarf2dbg.c 2022-07-08 11:46:47.000000000 +0200 -+++ binutils-2.39-new/gas/dwarf2dbg.c 2022-10-30 12:41:40.297023812 +0100 -@@ -2882,6 +2882,7 @@ out_debug_info (segT info_seg, segT abbr - { - const char *name; - size_t len; -+ expressionS size = { .X_op = O_constant }; - - /* Skip warning constructs (see above). */ - if (symbol_get_bfdsym (symp)->flags & BSF_WARNING) -@@ -2895,6 +2896,18 @@ out_debug_info (segT info_seg, segT abbr - if (!S_IS_DEFINED (symp) || !S_IS_FUNCTION (symp)) - continue; - -+#if defined (OBJ_ELF) /* || defined (OBJ_MAYBE_ELF) */ -+ size.X_add_number = S_GET_SIZE (symp); -+ if (size.X_add_number == 0 && IS_ELF -+ && symbol_get_obj (symp)->size != NULL) -+ { -+ size.X_op = O_add; -+ size.X_op_symbol = make_expr_symbol (symbol_get_obj (symp)->size); -+ } -+#endif -+ if (size.X_op == O_constant && size.X_add_number == 0) -+ continue; -+ - subseg_set (str_seg, 0); - name_sym = symbol_temp_new_now_octets (); - name = S_GET_NAME (symp); -@@ -2920,29 +2933,17 @@ out_debug_info (segT info_seg, segT abbr - emit_expr (&exp, sizeof_address); - - /* DW_AT_high_pc */ -- exp.X_op = O_constant; --#if defined (OBJ_ELF) /* || defined (OBJ_MAYBE_ELF) */ -- exp.X_add_number = S_GET_SIZE (symp); -- if (exp.X_add_number == 0 && IS_ELF -- && symbol_get_obj (symp)->size != NULL) -- { -- exp.X_op = O_add; -- exp.X_op_symbol = make_expr_symbol (symbol_get_obj (symp)->size); -- } --#else -- exp.X_add_number = 0; --#endif - if (DWARF2_VERSION < 4) - { -- if (exp.X_op == O_constant) -- exp.X_op = O_symbol; -- exp.X_add_symbol = symp; -- emit_expr (&exp, sizeof_address); -+ if (size.X_op == O_constant) -+ size.X_op = O_symbol; -+ size.X_add_symbol = symp; -+ emit_expr (&size, sizeof_address); - } -- else if (exp.X_op == O_constant) -- out_uleb128 (exp.X_add_number); -+ else if (size.X_op == O_constant) -+ out_uleb128 (size.X_add_number); - else -- emit_leb128_expr (symbol_get_value_expression (exp.X_op_symbol), 0); -+ emit_leb128_expr (symbol_get_value_expression (size.X_op_symbol), 0); - } - - /* End of children. */ diff --git a/binutils-package-metadata.patch b/binutils-package-metadata.patch deleted file mode 100644 index a224888..0000000 --- a/binutils-package-metadata.patch +++ /dev/null @@ -1,197 +0,0 @@ -diff -rupN --no-dereference binutils-2.39/elfcpp/elfcpp.h binutils-2.39-new/elfcpp/elfcpp.h ---- binutils-2.39/elfcpp/elfcpp.h 2022-07-08 11:46:47.000000000 +0200 -+++ binutils-2.39-new/elfcpp/elfcpp.h 2022-10-30 12:41:39.175023806 +0100 -@@ -999,7 +999,9 @@ enum - // string. - NT_GNU_GOLD_VERSION = 4, - // Program property note, as described in "Linux Extensions to the gABI". -- NT_GNU_PROPERTY_TYPE_0 = 5 -+ NT_GNU_PROPERTY_TYPE_0 = 5, -+ // FDO .note.package notes as defined on https://systemd.io/ELF_PACKAGE_METADATA/ -+ FDO_PACKAGING_METADATA = 0xcafe1a7e - }; - - // The OS values which may appear in word 0 of a NT_GNU_ABI_TAG note. -diff -rupN --no-dereference binutils-2.39/gold/configure.ac binutils-2.39-new/gold/configure.ac ---- binutils-2.39/gold/configure.ac 2022-10-30 12:41:34.538023785 +0100 -+++ binutils-2.39-new/gold/configure.ac 2022-10-30 12:41:39.173023806 +0100 -@@ -591,6 +591,32 @@ if test "$threads" = "yes"; then - fi - AM_CONDITIONAL(THREADS, test "$threads" = "yes") - -+# Used to validate --package-metadata= input. Disabled by default. -+AC_ARG_ENABLE([jansson], -+ [AS_HELP_STRING([--enable-jansson], -+ [enable jansson [default=no]])], -+ [enable_jansson=$enableval], -+ [enable_jansson="no"]) -+ -+if test "x$enable_jansson" != "xno"; then -+ PKG_PROG_PKG_CONFIG -+ AS_IF([test -n "$PKG_CONFIG"], -+ [ -+ PKG_CHECK_MODULES(JANSSON, [jansson], -+ [ -+ AC_DEFINE(HAVE_JANSSON, 1, [The jansson library is to be used]) -+ AC_SUBST([JANSSON_CFLAGS]) -+ AC_SUBST([JANSSON_LIBS]) -+ ], -+ [ -+ AC_MSG_ERROR([Cannot find jansson library]) -+ ]) -+ ], -+ [ -+ AC_MSG_ERROR([Cannot find pkg-config]) -+ ]) -+fi -+ - dnl We have to check these in C, not C++, because autoconf generates - dnl tests which have no type information, and current glibc provides - dnl multiple declarations of functions like basename when compiling -diff -rupN --no-dereference binutils-2.39/gold/layout.cc binutils-2.39-new/gold/layout.cc ---- binutils-2.39/gold/layout.cc 2022-10-30 12:41:33.405023779 +0100 -+++ binutils-2.39-new/gold/layout.cc 2022-10-30 12:41:39.174023806 +0100 -@@ -38,6 +38,9 @@ - #include - #include - #endif -+#ifdef HAVE_JANSSON -+#include -+#endif - - #include "parameters.h" - #include "options.h" -@@ -2439,6 +2442,7 @@ Layout::create_notes() - this->create_gold_note(); - this->create_stack_segment(); - this->create_build_id(); -+ this->create_package_metadata(); - } - - // Create the dynamic sections which are needed before we read the -@@ -3536,6 +3540,52 @@ Layout::create_build_id() - } - } - -+// If --package-metadata was used, set up the package metadata note. -+// https://systemd.io/ELF_PACKAGE_METADATA/ -+ -+void -+Layout::create_package_metadata() -+{ -+ if (!parameters->options().user_set_package_metadata()) -+ return; -+ -+ const char* desc = parameters->options().package_metadata(); -+ if (strcmp(desc, "") == 0) -+ return; -+ -+#ifdef HAVE_JANSSON -+ json_error_t json_error; -+ json_t *json = json_loads(desc, 0, &json_error); -+ if (json) -+ json_decref(json); -+ else -+ { -+ gold_fatal(_("error: --package-metadata=%s does not contain valid " -+ "JSON: %s\n"), -+ desc, json_error.text); -+ } -+#endif -+ -+ // Create the note. -+ size_t trailing_padding; -+ // Ensure the trailing NULL byte is always included, as per specification. -+ size_t descsz = strlen(desc) + 1; -+ Output_section* os = this->create_note("FDO", elfcpp::FDO_PACKAGING_METADATA, -+ ".note.package", descsz, true, -+ &trailing_padding); -+ if (os == NULL) -+ return; -+ -+ Output_section_data* posd = new Output_data_const(desc, descsz, 4); -+ os->add_output_section_data(posd); -+ -+ if (trailing_padding != 0) -+ { -+ posd = new Output_data_zero_fill(trailing_padding, 0); -+ os->add_output_section_data(posd); -+ } -+} -+ - // If we have both .stabXX and .stabXXstr sections, then the sh_link - // field of the former should point to the latter. I'm not sure who - // started this, but the GNU linker does it, and some tools depend -diff -rupN --no-dereference binutils-2.39/gold/layout.h binutils-2.39-new/gold/layout.h ---- binutils-2.39/gold/layout.h 2022-07-08 11:46:48.000000000 +0200 -+++ binutils-2.39-new/gold/layout.h 2022-10-30 12:41:39.174023806 +0100 -@@ -1107,6 +1107,10 @@ class Layout - void - create_build_id(); - -+ // Create a package metadata note if needed. -+ void -+ create_package_metadata(); -+ - // Link .stab and .stabstr sections. - void - link_stabs_sections(); -@@ -1453,6 +1457,8 @@ class Layout - Gdb_index* gdb_index_data_; - // The space for the build ID checksum if there is one. - Output_section_data* build_id_note_; -+ // The space for the package metadata JSON if there is one. -+ Output_section_data* package_metadata_note_; - // The output section containing dwarf abbreviations - Output_reduced_debug_abbrev_section* debug_abbrev_; - // The output section containing the dwarf debug info tree -diff -rupN --no-dereference binutils-2.39/gold/Makefile.am binutils-2.39-new/gold/Makefile.am ---- binutils-2.39/gold/Makefile.am 2022-07-08 11:46:48.000000000 +0200 -+++ binutils-2.39-new/gold/Makefile.am 2022-10-30 12:41:39.173023806 +0100 -@@ -35,7 +35,7 @@ THREADFLAGS = @PTHREAD_CFLAGS@ - THREADLIBS = @PTHREAD_LIBS@ - - AM_CFLAGS = $(WARN_CFLAGS) $(LFS_CFLAGS) $(RANDOM_SEED_CFLAGS) $(ZLIBINC) $(THREADFLAGS) --AM_CXXFLAGS = $(WARN_CXXFLAGS) $(LFS_CFLAGS) $(RANDOM_SEED_CFLAGS) $(ZLIBINC) $(THREADFLAGS) -+AM_CXXFLAGS = $(WARN_CXXFLAGS) $(LFS_CFLAGS) $(RANDOM_SEED_CFLAGS) $(ZLIBINC) $(THREADFLAGS) $(JANSSON_CFLAGS) - AM_LDFLAGS = $(THREADFLAGS) - - AM_CPPFLAGS = \ -@@ -187,7 +187,7 @@ libgold_a_LIBADD = $(LIBOBJS) - sources_var = main.cc - deps_var = $(TARGETOBJS) libgold.a $(LIBIBERTY) $(LIBINTL_DEP) - ldadd_var = $(TARGETOBJS) libgold.a $(LIBIBERTY) $(GOLD_LDADD) $(LIBINTL) \ -- $(THREADLIBS) $(LIBDL) $(ZLIB) -+ $(THREADLIBS) $(LIBDL) $(ZLIB) $(JANSSON_LIBS) - ldflags_var = $(GOLD_LDFLAGS) - - ld_new_SOURCES = $(sources_var) -@@ -201,12 +201,12 @@ incremental_dump_SOURCES = incremental-d - incremental_dump_DEPENDENCIES = $(TARGETOBJS) libgold.a $(LIBIBERTY) \ - $(LIBINTL_DEP) - incremental_dump_LDADD = $(TARGETOBJS) libgold.a $(LIBIBERTY) $(LIBINTL) \ -- $(THREADLIBS) $(LIBDL) $(ZLIB) -+ $(THREADLIBS) $(LIBDL) $(ZLIB) $(JANSSON_LIBS) - - dwp_SOURCES = dwp.cc - dwp_DEPENDENCIES = libgold.a $(LIBIBERTY) $(LIBINTL_DEP) - dwp_LDADD = libgold.a $(LIBIBERTY) $(GOLD_LDADD) $(LIBINTL) $(THREADLIBS) \ -- $(LIBDL) $(ZLIB) -+ $(LIBDL) $(ZLIB) $(JANSSON_LIBS) - dwp_LDFLAGS = $(GOLD_LDFLAGS) - - CONFIG_STATUS_DEPENDENCIES = $(srcdir)/../bfd/development.sh -diff -rupN --no-dereference binutils-2.39/gold/options.h binutils-2.39-new/gold/options.h ---- binutils-2.39/gold/options.h 2022-07-08 11:46:48.000000000 +0200 -+++ binutils-2.39-new/gold/options.h 2022-10-30 12:41:39.175023806 +0100 -@@ -1102,6 +1102,10 @@ class General_options - DEFINE_bool(p, options::ONE_DASH, 'p', false, - N_("Ignored for ARM compatibility"), NULL); - -+ DEFINE_optional_string(package_metadata, options::TWO_DASHES, '\0', NULL, -+ N_("Generate package metadata note"), -+ N_("[=JSON]")); -+ - DEFINE_bool(pie, options::ONE_DASH, '\0', false, - N_("Create a position independent executable"), - N_("Do not create a position independent executable")); diff --git a/binutils-revert-note-id-move.patch b/binutils-revert-note-id-move.patch new file mode 100644 index 0000000..2763327 --- /dev/null +++ b/binutils-revert-note-id-move.patch @@ -0,0 +1,124 @@ +--- binutils.orig/ld/scripttempl/elf.sc 2024-11-01 10:17:24.308959289 +0000 ++++ binutils-2.43.50-22c62092858/ld/scripttempl/elf.sc 2024-11-01 10:17:39.730019895 +0000 +@@ -397,19 +397,6 @@ fi + # =========================================================================== + # Functions for generating parts of the linker script + +-# Helper function for putting comments into scripts. +-# Useful when trying to track down script composition problems. +-# Use by adding: +-# emit_comment "a message" +-# wherever necessary. +- +-emit_comment() +-{ +-cat <: +-.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a0,a0,\-[0-9]+ ++.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a0,a0,.* + .*:[ ]+[0-9a-f]+[ ]+jal[ ]+ra,[0-9a-f]+ <_start> + .*:[ ]+[0-9a-f]+[ ]+auipc[ ]+a1,0x[0-9a-f]+ +-.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a1,a1,\-[0-9]+ # [0-9a-f]+ ++.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a1,a1,.* + .*:[ ]+[0-9a-f]+[ ]+lui[ ]+a2,0x[0-9a-f]+ + .*:[ ]+[0-9a-f]+[ ]+addi[ ]+a2,a2,[0-9]+ # [0-9a-f]+ + .*:[ ]+[0-9a-f]+[ ]+addi[ ]+a3,tp,0 # 0 +diff -rup binutils.orig/ld/testsuite/ld-riscv-elf/pcgp-relax-01.d binutils-2.43.50-1f4aee70ed1/ld/testsuite/ld-riscv-elf/pcgp-relax-01.d +--- binutils.orig/ld/testsuite/ld-riscv-elf/pcgp-relax-01.d 2024-10-03 15:21:47.926570551 +0100 ++++ binutils-2.43.50-1f4aee70ed1/ld/testsuite/ld-riscv-elf/pcgp-relax-01.d 2024-10-03 15:23:54.512530979 +0100 +@@ -8,7 +8,7 @@ + Disassembly of section \.text: + + 0+[0-9a-f]+ <_start>: +-.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a0,a0,\-[0-9]+ ++.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a0,a0,.* + .*:[ ]+[0-9a-f]+[ ]+jal[ ]+ra,[0-9a-f]+ <_start> + .*:[ ]+[0-9a-f]+[ ]+addi[ ]+a1,gp,\-[0-9]+ # [0-9a-f]+ + .*:[ ]+[0-9a-f]+[ ]+addi[ ]+a2,gp,\-[0-9]+ # [0-9a-f]+ +diff -rup binutils.orig/ld/testsuite/ld-riscv-elf/pcgp-relax-02.d binutils-2.43.50-1f4aee70ed1/ld/testsuite/ld-riscv-elf/pcgp-relax-02.d +--- binutils.orig/ld/testsuite/ld-riscv-elf/pcgp-relax-02.d 2024-10-03 15:21:47.926570551 +0100 ++++ binutils-2.43.50-1f4aee70ed1/ld/testsuite/ld-riscv-elf/pcgp-relax-02.d 2024-10-03 15:25:01.687468496 +0100 +@@ -11,5 +11,5 @@ Disassembly of section .text: + [0-9a-f]+ <_start>: + .*:[ ]+[0-9a-f]+[ ]+auipc[ ]+a1.* + .*:[ ]+[0-9a-f]+[ ]+addi[ ]+a0,gp.* +-.*:[ ]+[0-9a-f]+[ ]+mv[ ]+a1,a1 ++.*:[ ]+[0-9a-f]+[ ]+.* + #pass diff --git a/binutils-testsuite-fixes.patch b/binutils-testsuite-fixes.patch index ba2fdc9..d518cdc 100644 --- a/binutils-testsuite-fixes.patch +++ b/binutils-testsuite-fixes.patch @@ -189,31 +189,6 @@ {pr29086.c} \ {} \ "pr29086" \ -diff -rup binutils.orig/ld/testsuite/ld-aarch64/bti-plt-5.d binutils-2.41/ld/testsuite/ld-aarch64/bti-plt-5.d ---- binutils.orig/ld/testsuite/ld-aarch64/bti-plt-5.d 2023-08-15 09:03:21.676463687 +0100 -+++ binutils-2.41/ld/testsuite/ld-aarch64/bti-plt-5.d 2023-08-15 09:17:56.751533569 +0100 -@@ -12,8 +12,8 @@ Disassembly of section \.plt: - [0-9a-f]+ <.*>: - .*: d503245f bti c - .*: a9bf7bf0 stp x16, x30, \[sp, #-16\]! --.*: 90000090 adrp x16, 410000 <.*> --.*: f9...... ldr x17, \[x16, #....\] -+.*: 90000090 adrp x16, 4.0000 <.*> -+.*: f9...... ldr x17, \[x16, #.*\] - .*: 91...... add x16, x16, #0x... - .*: d61f0220 br x17 - .*: d503201f nop -@@ -21,8 +21,8 @@ Disassembly of section \.plt: - - [0-9a-f]+ <.*>: - .*: d503245f bti c --.*: 90000090 adrp x16, 410000 <.*> --.*: f9...... ldr x17, \[x16, #....\] -+.*: 90000090 adrp x16, 4.0000 <.*> -+.*: f9...... ldr x17, \[x16, #.*\] - .*: 91...... add x16, x16, #0x... - .*: d61f0220 br x17 - .*: d503201f nop diff -rup binutils.orig/ld/testsuite/ld-aarch64/erratum843419-far-full.d binutils-2.41/ld/testsuite/ld-aarch64/erratum843419-far-full.d --- binutils.orig/ld/testsuite/ld-aarch64/erratum843419-far-full.d 2023-08-15 09:03:21.683463694 +0100 +++ binutils-2.41/ld/testsuite/ld-aarch64/erratum843419-far-full.d 2023-08-15 09:05:41.549608111 +0100 @@ -1036,3 +1011,69 @@ diff -rup binutils.orig/ld/testsuite/ld-powerpc/tls32no.d binutils-2.42.50-6b19a .*: (3b de 80 a0|.. 80 de 3b) addi r30,r30,-[0-9]+ .*: (38 7f ff e4|e4 ff 7f 38) addi r3,r31,-28 .*: (48 00 00 6d|6d 00 00 48) bl .* +720,725d719 +< [list "Run pr20267a" \ +< "-O2 -flto -fcommon tmpdir/pr20267a.o tmpdir/libpr20267a.a" "" \ +< {dummy.c} "pr20267a" "pass.out" "-flto -O2 -fcommon" "c"] \ +< [list "Run pr20267b" \ +< "-O2 -flto -fcommon tmpdir/pr20267a.o tmpdir/libpr20267b.a" "" \ +< {dummy.c} "pr20267b" "pass.out" "-flto -O2 -fcommon" "c"] \ +diff -rup bin.orig/ld/testsuite/ld-x86-64/sframe-pltgot-1.d binutils-2.43.50-55e32b3c682/ld/testsuite/ld-x86-64/sframe-pltgot-1.d +--- bin.orig/ld/testsuite/ld-x86-64/sframe-pltgot-1.d 2024-11-04 13:34:33.522976068 +0000 ++++ binutils-2.43.50-55e32b3c682/ld/testsuite/ld-x86-64/sframe-pltgot-1.d 2024-11-04 13:37:17.985526186 +0000 +@@ -23,6 +23,6 @@ Contents of the SFrame section .sframe: + + func idx \[1\]: pc = 0x1010, size = 64 bytes + STARTPC\[m\] +CFA +FP +RA + +- 0+0000 +sp\+16 +u +f + ++ 0+0000 +sp\+[0-9]+ +u +f + + + #... +diff -rup bin.orig/ld/testsuite/ld-x86-64/sframe-pltgot-2.d binutils-2.43.50-55e32b3c682/ld/testsuite/ld-x86-64/sframe-pltgot-2.d +--- bin.orig/ld/testsuite/ld-x86-64/sframe-pltgot-2.d 2024-11-04 13:34:33.522976068 +0000 ++++ binutils-2.43.50-55e32b3c682/ld/testsuite/ld-x86-64/sframe-pltgot-2.d 2024-11-04 13:37:43.874611190 +0000 +@@ -23,6 +23,6 @@ Contents of the SFrame section .sframe: + + func idx \[1\]: pc = 0x1010, size = 32 bytes + STARTPC\[m\] +CFA +FP +RA + +- 0+0000 +sp\+16 +u +f + ++ 0+0000 +sp\+[0-9]+ +u +f + + + #... +diff -rup bin.orig/ld/testsuite/ld-x86-64/sframe-pltgot-2.d binutils-2.43.50-55e32b3c682/ld/testsuite/ld-x86-64/sframe-pltgot-2.d +--- bin.orig/ld/testsuite/ld-x86-64/sframe-pltgot-2.d 2024-11-04 14:26:07.983307843 +0000 ++++ binutils-2.43.50-55e32b3c682/ld/testsuite/ld-x86-64/sframe-pltgot-2.d 2024-11-04 14:26:18.781353913 +0000 +@@ -21,7 +21,7 @@ Contents of the SFrame section .sframe: + 0+1000 +sp\+16 +u +f + + 0+1006 +sp\+24 +u +f + + +- func idx \[1\]: pc = 0x1010, size = 32 bytes ++ func idx \[1\]: pc = 0x1010, size = [0-9]+ bytes + STARTPC\[m\] +CFA +FP +RA + + 0+0000 +sp\+[0-9]+ +u +f + + +--- binutils.orig/ld/testsuite/ld-bootstrap/bootstrap.exp 2025-02-03 11:13:50.829608207 +0000 ++++ binutils-with-gold-2.44/ld/testsuite/ld-bootstrap/bootstrap.exp 2025-02-03 11:17:34.589136290 +0000 +@@ -29,6 +29,12 @@ if ![isnative] { + return + } + ++# FIXME: The AArch64 rawhide libz and libjanson libraries are built ++# without GCS support and so cannot be linked. ++if {[istarget "aarch64*-*-*"] } { ++ return ++} ++ + # Skip if OFILES aren't provided, it can happen when lauching + # the testsuites outside the build directory. + if {![info exists OFILES]} { +--- binutils.orig/ld/testsuite/ld-vsb/vsb.exp 2025-02-07 11:24:06.084525843 +0000 ++++ binutils-with-gold-2.44/ld/testsuite/ld-vsb/vsb.exp 2025-02-07 11:26:34.984041584 +0000 +@@ -366,7 +366,6 @@ proc visibility_run {visibility} { + || [ string match $visibility "protected_weak" ] + || [ string match $visibility "normal" ] } { + setup_xfail "powerpc-*-linux*" +- setup_xfail "s390x-*-linux*" + if { [istarget sparc*-*-linux*] && [is_elf64 $tmpdir/mainnp.o] } { + setup_xfail "sparc*-*-linux*" + } diff --git a/mingw-binutils.spec b/mingw-binutils.spec index afecb86..ea29702 100644 --- a/mingw-binutils.spec +++ b/mingw-binutils.spec @@ -3,14 +3,14 @@ %define enable_new_dtags 0 Name: mingw-binutils -Version: 2.43.1 -Release: 2%{?dist} +Version: 2.44 +Release: 1%{?dist} Summary: Cross-compiled version of binutils for Win32 and Win64 environments -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 LGPL-2.1-or-later AND LGPL-2.0-or-later +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: http://www.gnu.org/software/binutils/ -Source0: http://ftp.gnu.org/gnu/binutils/binutils-%{version}.tar.xz +Source0: https://ftp.gnu.org/gnu/binutils/binutils-with-gold-%{version}.tar.xz ### Patches from native package # Purpose: Use /lib64 and /usr/lib64 instead of /lib and /usr/lib in the @@ -115,9 +115,9 @@ Patch19: binutils-gold-ignore-execstack-error.patch # Lifetime: Fixed in 2.44 Patch20: binutils-fix-ar-test.patch -# Purpose: Suppress the x86 linker's p_align-1 tests due to kernel bug on CentOS-10 -# Lifetime: TEMPORARY -Patch99: binutils-suppress-ld-align-tests.patch +# Purpose: Fix a seg fault in the AArch64 linker when building u-boot. +# Lifetime: Fixed in 2.45 +Patch21: binutils-aarch64-small-plt0.patch BuildRequires: make @@ -182,7 +182,7 @@ understand Windows executables and DLLs. %prep -%autosetup -p1 -n binutils-%{version} +%autosetup -p1 -n binutils-with-gold-%{version} # See Patch02 sed -i -e 's/%''{release}/%{release}/g' bfd/Makefile{.am,.in} @@ -451,6 +451,10 @@ rm -rf %{buildroot}%{_mandir}/man1/* %changelog +* Thu Jul 10 2025 Miroslav Rezanina - 2.44-1 +- Synchronize with Fedora Rawhide + Resolves: RHEL-102712 + * Tue Jan 14 2025 Miroslav Rezanina - 2.43.1-2 - Synchronize with Fedora Rawhide Resolves: RHEL-73815 diff --git a/sources b/sources index 3d519b3..0a9a57a 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (binutils-2.43.1.tar.xz) = 20977ad17729141a2c26d358628f44a0944b84dcfefdec2ba029c2d02f40dfc41cc91c0631044560d2bd6f9a51e1f15846b4b311befbe14f1239f14ff7d57824 +SHA512 (binutils-with-gold-2.44.tar.xz) = 1d8688f1b6f1bc64cfd1f82e3af05b8ace1d709d4fa819acb4d12d74e1b69b4314d98fb4281dacc9b5fa51ff7370d0249f540ec016fd137aa701502d72426301