Compare commits

...

4 Commits

15 changed files with 280 additions and 257 deletions

View File

@@ -16,6 +16,7 @@
<flavor>spu</flavor>
<flavor>avr</flavor>
<flavor>pru</flavor>
<flavor>loongarch64</flavor>
<flavor>mips</flavor>
<flavor>m68k</flavor>
<flavor>epiphany</flavor>

View File

@@ -1,56 +0,0 @@
Change default common-page-size to 64K on aarch64. This enables the use
of RELRO since we are using 64K pages.
Index: binutils-2.41/bfd/elfnn-aarch64.c
===================================================================
--- binutils-2.41.orig/bfd/elfnn-aarch64.c 2023-07-03 01:00:00.000000000 +0200
+++ binutils-2.41/bfd/elfnn-aarch64.c 2023-08-16 16:31:51.238779641 +0200
@@ -10251,7 +10251,7 @@ const struct elf_size_info elfNN_aarch64
#define ELF_ARCH bfd_arch_aarch64
#define ELF_MACHINE_CODE EM_AARCH64
#define ELF_MAXPAGESIZE 0x10000
-#define ELF_COMMONPAGESIZE 0x1000
+#define ELF_COMMONPAGESIZE 0x10000
#define bfd_elfNN_bfd_free_cached_info \
elfNN_aarch64_bfd_free_cached_info
Index: binutils-2.41/gold/aarch64.cc
===================================================================
--- binutils-2.41.orig/gold/aarch64.cc 2023-07-03 01:00:00.000000000 +0200
+++ binutils-2.41/gold/aarch64.cc 2023-08-16 16:28:35.959450565 +0200
@@ -3555,7 +3555,7 @@ const Target::Target_info Target_aarch64
"/lib/ld.so.1", // program interpreter
0x400000, // default_text_segment_address
0x10000, // abi_pagesize (overridable by -z max-page-size)
- 0x1000, // common_pagesize (overridable by -z common-page-size)
+ 0x10000, // common_pagesize (overridable by -z common-page-size)
false, // isolate_execinstr
0, // rosegment_gap
elfcpp::SHN_UNDEF, // small_common_shndx
@@ -3584,7 +3584,7 @@ const Target::Target_info Target_aarch64
"/lib/ld.so.1", // program interpreter
0x400000, // default_text_segment_address
0x10000, // abi_pagesize (overridable by -z max-page-size)
- 0x1000, // common_pagesize (overridable by -z common-page-size)
+ 0x10000, // common_pagesize (overridable by -z common-page-size)
false, // isolate_execinstr
0, // rosegment_gap
elfcpp::SHN_UNDEF, // small_common_shndx
@@ -3613,7 +3613,7 @@ const Target::Target_info Target_aarch64
"/lib/ld.so.1", // program interpreter
0x400000, // default_text_segment_address
0x10000, // abi_pagesize (overridable by -z max-page-size)
- 0x1000, // common_pagesize (overridable by -z common-page-size)
+ 0x10000, // common_pagesize (overridable by -z common-page-size)
false, // isolate_execinstr
0, // rosegment_gap
elfcpp::SHN_UNDEF, // small_common_shndx
@@ -3642,7 +3642,7 @@ const Target::Target_info Target_aarch64
"/lib/ld.so.1", // program interpreter
0x400000, // default_text_segment_address
0x10000, // abi_pagesize (overridable by -z max-page-size)
- 0x1000, // common_pagesize (overridable by -z common-page-size)
+ 0x10000, // common_pagesize (overridable by -z common-page-size)
false, // isolate_execinstr
0, // rosegment_gap
elfcpp::SHN_UNDEF, // small_common_shndx

BIN
binutils-2.42-branch.diff.gz (Stored with Git LFS)

Binary file not shown.

BIN
binutils-2.42.tar.bz2 (Stored with Git LFS)

Binary file not shown.

View File

@@ -1,16 +0,0 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEEOiS8Ho+0CfqfFDcYE/zvid2ePE8FAmW3wiYACgkQE/zvid2e
PE+HQBAAgC3yZJvJBx/0EtNESazNRpUG8G4pnd0505QYiibf+5243xXusDySXVu3
iBt2UltDPauPu6eIUC7qY0xaZHhPuxqPHp6oSrB73iHZ7ovTdbZUX2060Ro8KXha
xN6+SPBHQGxP8XZw+ezexYNpwHBGM8CUos7UeeLpskuSBRGQC4bEhCOR8wuvU1w9
gHTFuOY5zKgzzNMr1fPp/tRqUqZr8A7R1HN6tAs+4N2QWLk9Z/oF7h7Rkrzqe8gY
vmaakulfBTiqNIZJyTQhbhPiWrtLdElKyohBa/enqtTrktXoX/gwX21+LMqU+Oh3
qE7CicjEZKGK/e8gl0BjcwgMeuUYYpZRUI1+A++YAu+YPSzLQL9iPy1FUovrYhHO
Fr/qV156MtnhkoaI7RVDLKl2s3CP451yjHSDcAsB51wq+QophC3z6yoTXKuKW8h6
v2yW5ZaG5GfiPmRw+E46qsZWeb2pOUaGVU8ovaYWfLjrZ20WFZwZKLn55ZwZ35eW
g3RSff4f0lqr8x7jWDkf+KQMC2K0O6Sl0sgFoFE6PMPFcGe4r6oSIekNygaFgxBv
DrL0IA8y1prpmpnJrGbIg1+ciguAJKEBfcV9pNyq1IAHWu3aOMbWKb5pF0ukb0PY
OueuuH06uaBa7vgZxvbTiw0j5+PuTlGHa3Bsf4rlkChK2N/6deQ=
=5bYR
-----END PGP SIGNATURE-----

BIN
binutils-2.43-branch.diff.gz (Stored with Git LFS) Normal file

Binary file not shown.

BIN
binutils-2.43.tar.bz2 (Stored with Git LFS) Normal file

Binary file not shown.

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

@@ -0,0 +1,16 @@
-----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-----

22
binutils-fix-branch.diff Normal file
View File

@@ -0,0 +1,22 @@
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

@@ -26,10 +26,10 @@ of missing support in ld.so.
proper predicate to guard themself)
Index: binutils-2.42/bfd/elf64-x86-64.c
Index: binutils-2.43/bfd/elf64-x86-64.c
===================================================================
--- binutils-2.42.orig/bfd/elf64-x86-64.c 2024-01-30 16:59:42.442361796 +0100
+++ binutils-2.42/bfd/elf64-x86-64.c 2024-01-30 17:54:25.162977883 +0100
--- 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
@@ -48,127 +48,127 @@ static reloc_howto_type x86_64_elf_howto
bfd_elf_generic_reloc, "R_X86_64_NONE", false, 0, 0x00000000,
false),
@@ -199,7 +199,7 @@ Index: binutils-2.42/bfd/elf64-x86-64.c
true),
HOWTO(R_X86_64_CODE_4_GOTPCRELX, 0, 4, 32, true, 0, complain_overflow_signed,
bfd_elf_generic_reloc, "R_X86_64_CODE_4_GOTPCRELX", false, 0, 0xffffffff,
@@ -198,7 +198,7 @@ static reloc_howto_type x86_64_elf_howto
@@ -216,7 +216,7 @@ static reloc_howto_type x86_64_elf_howto
/* Use complain_overflow_bitfield on R_X86_64_32 for x32. */
HOWTO(R_X86_64_32, 0, 4, 32, false, 0, complain_overflow_bitfield,
@@ -208,9 +208,9 @@ Index: binutils-2.42/bfd/elf64-x86-64.c
false)
};
Index: binutils-2.42/gas/testsuite/gas/i386/rela.d
Index: binutils-2.43/gas/testsuite/gas/i386/rela.d
===================================================================
--- binutils-2.42.orig/gas/testsuite/gas/i386/rela.d 2024-01-29 01:00:00.000000000 +0100
--- binutils-2.43.orig/gas/testsuite/gas/i386/rela.d 2024-08-06 16:48:34.104745566 +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 +226,9 @@ Index: binutils-2.42/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.42/gas/testsuite/gas/i386/rela.s
Index: binutils-2.43/gas/testsuite/gas/i386/rela.s
===================================================================
--- binutils-2.42.orig/gas/testsuite/gas/i386/rela.s 2024-01-29 01:00:00.000000000 +0100
--- binutils-2.43.orig/gas/testsuite/gas/i386/rela.s 2024-08-06 16:48:34.104745566 +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,9 +245,9 @@ Index: binutils-2.42/gas/testsuite/gas/i386/rela.s
-
- .reloc l, BFD_RELOC_64, q
- .reloc q, BFD_RELOC_32, l
Index: binutils-2.42/ld/testsuite/ld-x86-64/rela.d
Index: binutils-2.43/ld/testsuite/ld-x86-64/rela.d
===================================================================
--- binutils-2.42.orig/ld/testsuite/ld-x86-64/rela.d 2024-01-29 01:00:00.000000000 +0100
--- binutils-2.43.orig/ld/testsuite/ld-x86-64/rela.d 2024-08-06 16:48:34.104745566 +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
@@ -260,11 +260,11 @@ Index: binutils-2.42/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.42/ld/testsuite/ld-x86-64/x86-64.exp
Index: binutils-2.43/ld/testsuite/ld-x86-64/x86-64.exp
===================================================================
--- binutils-2.42.orig/ld/testsuite/ld-x86-64/x86-64.exp 2024-01-30 16:57:58.487327524 +0100
+++ binutils-2.42/ld/testsuite/ld-x86-64/x86-64.exp 2024-01-30 17:55:13.480432003 +0100
@@ -291,7 +291,6 @@ run_dump_test "apic"
--- 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"
run_dump_test "pcrel8"
run_dump_test "pcrel16"
run_dump_test "pcrel16-2"
@@ -272,7 +272,7 @@ Index: binutils-2.42/ld/testsuite/ld-x86-64/x86-64.exp
run_dump_test "tlsgd2"
run_dump_test "tlsgd3"
run_dump_test "tlsgd12"
@@ -506,10 +505,10 @@ run_dump_test "pr27491-1c"
@@ -524,10 +523,10 @@ run_dump_test "pr27491-1c"
run_dump_test "pr27491-2"
run_dump_test "pr27491-3"
run_dump_test "pr27491-4"
@@ -287,11 +287,11 @@ Index: binutils-2.42/ld/testsuite/ld-x86-64/x86-64.exp
run_dump_test "pr30787"
run_dump_test "pr31047"
run_dump_test "pr31047-x32"
Index: binutils-2.42/binutils/testsuite/lib/binutils-common.exp
Index: binutils-2.43/binutils/testsuite/lib/binutils-common.exp
===================================================================
--- binutils-2.42.orig/binutils/testsuite/lib/binutils-common.exp 2024-01-29 01:00:00.000000000 +0100
+++ binutils-2.42/binutils/testsuite/lib/binutils-common.exp 2024-01-30 17:54:25.166311271 +0100
@@ -449,6 +449,8 @@ proc supports_persistent_section {} {
--- 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 {} {
# Whether a target support DT_RELR sections.
proc supports_dt_relr {} {
@@ -299,11 +299,11 @@ Index: binutils-2.42/binutils/testsuite/lib/binutils-common.exp
+ return 0
if { ([istarget x86_64-*-*]
|| [istarget i?86-*-*]
|| [istarget powerpc64*-*-*])
Index: binutils-2.42/ld/emulparams/dt-relr.sh
|| [istarget powerpc64*-*-*]
Index: binutils-2.43/ld/emulparams/dt-relr.sh
===================================================================
--- binutils-2.42.orig/ld/emulparams/dt-relr.sh 2024-01-29 01:00:00.000000000 +0100
+++ binutils-2.42/ld/emulparams/dt-relr.sh 2024-01-30 17:54:25.166311271 +0100
--- 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
@@ -1,3 +1,8 @@
+if false; then
+ # on old codestreams we don't have the DT_RELR support in the dynamic
@@ -319,10 +319,10 @@ Index: binutils-2.42/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.42/ld/testsuite/ld-i386/i386.exp
Index: binutils-2.43/ld/testsuite/ld-i386/i386.exp
===================================================================
--- binutils-2.42.orig/ld/testsuite/ld-i386/i386.exp 2024-01-29 01:00:00.000000000 +0100
+++ binutils-2.42/ld/testsuite/ld-i386/i386.exp 2024-01-30 17:54:25.166311271 +0100
--- 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"
run_dump_test "pr27491-2"
run_dump_test "pr27491-3"
@@ -334,10 +334,10 @@ Index: binutils-2.42/ld/testsuite/ld-i386/i386.exp
run_dump_test "pr28870"
run_dump_test "pr28894"
run_dump_test "pr30787"
Index: binutils-2.42/ld/testsuite/ld-powerpc/powerpc.exp
Index: binutils-2.43/ld/testsuite/ld-powerpc/powerpc.exp
===================================================================
--- binutils-2.42.orig/ld/testsuite/ld-powerpc/powerpc.exp 2024-01-29 01:00:00.000000000 +0100
+++ binutils-2.42/ld/testsuite/ld-powerpc/powerpc.exp 2024-01-30 17:54:25.166311271 +0100
--- 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
@@ -378,14 +378,14 @@ set ppc64elftests {
"-a64" {abs-reloc.s}
{{objdump {-sdr} abs-shared.d}
@@ -361,11 +361,11 @@ Index: binutils-2.42/ld/testsuite/ld-powerpc/powerpc.exp
}
set ppceabitests {
Index: binutils-2.42/gas/testsuite/gas/i386/x86-64.exp
Index: binutils-2.43/gas/testsuite/gas/i386/x86-64.exp
===================================================================
--- binutils-2.42.orig/gas/testsuite/gas/i386/x86-64.exp 2024-01-29 01:00:00.000000000 +0100
+++ binutils-2.42/gas/testsuite/gas/i386/x86-64.exp 2024-01-30 17:54:25.166311271 +0100
@@ -628,7 +628,6 @@ if [is_elf_format] then {
--- 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"
run_list_test "x86-64-inval-tls"
run_dump_test "mixed-mode-reloc64"

View File

@@ -1,3 +1,131 @@
-------------------------------------------------------------------
Thu Jul 10 05:26:01 UTC 2025 - Bernhard Wiedemann <bwiedemann@suse.com>
- Skip PGO with %want_reproducible_builds (boo#1040589)
-------------------------------------------------------------------
Wed Jun 18 09:30:37 UTC 2025 - Andreas Schwab <schwab@suse.de>
- pr33029.patch: Fix crash in assembler with -gdwarf-5
-------------------------------------------------------------------
Tue Jun 3 09:07:07 UTC 2025 - Andreas Schwab <schwab@suse.de>
- Drop aarch64-common-pagesize.patch, aarch64 no longer uses 64K page size
-------------------------------------------------------------------
Tue May 6 14:33:48 UTC 2025 - Michael Matz <matz@suse.com>
- Add -std=gnu17 to move gcc15 forward, as temporary measure until
the binutils version can be updated [bsc#1241916].
-------------------------------------------------------------------
Thu Feb 13 09:39:06 UTC 2025 - Richard Biener <rguenther@suse.com>
- Do not build binutils-gold for SLFO.
-------------------------------------------------------------------
Fri Jan 10 08:54:55 UTC 2025 - JS <obs.coke518@passinbox.com>
- Enable multitarget build on loongarch64
-------------------------------------------------------------------
Tue Dec 17 14:09:54 UTC 2024 - Andreas Schwab <schwab@suse.de>
- Unset SUSE_ZNOW while running testsuite, many tests cannot cope
-------------------------------------------------------------------
Mon Dec 9 14:49:46 UTC 2024 - Michael Matz <matz@suse.com>
- Update to current 2.43.1 branch [PED-10254, PED-10306]:
* s390 - Add arch15 instructions
* various fixes from upstream: PR32153, PR32171, PR32189,
PR32196, PR32191, PR32109, PR32372, PR32387
- Adjusted binutils-2.43-branch.diff.gz.
- Disable zstd-by-default again (needs adjustments in at least
golang,llvm15,llvm17 first)
- Add binutils-fix-branch.diff.
- Check non-changing of flex/bison inputs only after applying
branch and fix-branch diffs.
-------------------------------------------------------------------
Wed Nov 20 14:59:28 UTC 2024 - Jiri Slaby <jslaby@suse.cz>
- drop ld-relro.diff (relro is the default for some time)
and it warns on avr spuriously (bsc#1233520)
-------------------------------------------------------------------
Mon Nov 18 18:12:05 UTC 2024 - John Paul Adrian Glaubitz <adrian.glaubitz@suse.com>
- Add loongarch64 as new target
-------------------------------------------------------------------
Tue Sep 10 05:25:27 UTC 2024 - Martin Liška <martin.liska@hey.com>
- Enable zstd compression algorithm (instead of zlib)
for debug info sections by default.
-------------------------------------------------------------------
Wed Aug 28 13:18:28 UTC 2024 - Michael Matz <matz@suse.com>
- Update to current 2.43.1 branch [PED-10474]:
* PR32109 - fuzzing problem
* PR32083 - LTO vs overridden common symbols
* PR32067 - crash with LTO-plugin and --oformat=binary
* PR31956 - LTO vs wrapper symbols
* riscv - add Zimop and Zcmop extensions
- Adjusted binutils-2.43-branch.diff.gz.
-------------------------------------------------------------------
Tue Aug 6 14:09:24 UTC 2024 - Michael Matz <matz@suse.com>
- Update to version 2.43:
* new .base64 pseudo-op, allowing base64 encoded data as strings
* Intel APX: add support for CFCMOV, CCMP, CTEST, zero-upper, NF
(APX_F now fully supported)
* x86 Intel syntax now warns about more mnemonic suffixes
* macros and .irp/.irpc/.rept bodies can use \+ to get at number
of times the macro/body was executed
* aarch64: support 'armv9.5-a' for -march, add support for LUT
and LUT2
* s390: base register operand in D(X,B) and D(L,B) can now be
omitted (ala 'D(X,)'); warn when register type doesn't match
operand type (use option
'warn-regtype-mismatch=[strict|relaxed|no]' to adjust)
* riscv: support various extensions: Zacas, Zcmp, Zfbfmin,
Zvfbfmin, Zvfbfwma, Smcsrind/Sscsrind, XCvMem, XCvBi, XCvElw,
XSfCease, all at version 1.0;
remove support for assembly of privileged spec 1.9.1 (linking
support remains)
* arm: remove support for some old co-processors: Maverick and FPA
* mips: '--trap' now causes either trap or breakpoint instructions
to be emitted as per current ISA, instead of always using trap
insn and failing when current ISA was incompatible with that
* LoongArch: accept .option pseudo-op for fine-grained control
of assembly code options; add support for DT_RELR
* readelf: now displays RELR relocations in full detail;
add -j/--display-section to show just those section(s) content
according to their type
* objdump/readelf now dump also .eh_frame_hdr (when present) when
dumping .eh_frame
* gprofng: add event types for AMD Zen3/Zen4 and Intel Ice Lake
processors; add minimal support for riscv
* linker:
- put .got and .got.plt into relro segment
- add -z isa-level-report=[none|all|needed|used] to the x86 ELF
linker to report needed and used x86-64 ISA levels
- add --rosegment option which changes the -z separate-code
option so that only one read-only segment is created (instead
of two)
- add --section-ordering-file <FILE> option to add extra
mapping of input sections to output sections
- add -plugin-save-temps to store plugin intermediate files
permanently
- Removed binutils-2.42.tar.bz2, binutils-2.42-branch.diff.gz.
- Added binutils-2.43.tar.bz2, binutils-2.43-branch.diff.gz.
- Removed upstream patch riscv-no-relax.patch.
- Rebased ld-relro.diff and binutils-revert-rela.diff.
-------------------------------------------------------------------
Thu Jun 13 08:35:38 UTC 2024 - Andreas Schwab <schwab@suse.de>

View File

@@ -1,7 +1,7 @@
#
# spec file for package binutils
#
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -64,7 +64,7 @@ BuildRequires: zlib-devel
%if %{suse_version} > 1500
BuildRequires: libzstd-devel
%endif
Version: 2.42
Version: 2.43
Release: 0
# disable libalternatives for now until it's changed to not
@@ -99,12 +99,12 @@ Release: 0
%define make_check_handling false
%endif
# handle all binary object formats supported by SUSE (and a few more)
%ifarch %ix86 %arm aarch64 ia64 ppc ppc64 ppc64le riscv64 s390 s390x x86_64 %x86_64
%ifarch %ix86 %arm aarch64 ia64 ppc ppc64 ppc64le riscv64 s390 s390x x86_64 %x86_64 loongarch64
%define build_multitarget 1
%else
%define build_multitarget 0
%endif
%define target_list aarch64 alpha armv5l armv6l armv7l armv8l avr pru epiphany hppa hppa64 i686 ia64 m68k mips powerpc powerpc64 powerpc64le riscv64 rx s390 s390x sh4 sparc sparc64 x86_64 xtensa
%define target_list aarch64 alpha armv5l armv6l armv7l armv8l avr pru epiphany hppa hppa64 i686 ia64 loongarch64 m68k mips powerpc powerpc64 powerpc64le riscv64 rx s390 s390x sh4 sparc sparc64 x86_64 xtensa
%define build_gprofng 0
@@ -131,19 +131,18 @@ Source: binutils-%{version}.tar.bz2
Source2: binutils-%{version}.tar.bz2.sig
Source3: binutils.keyring
Source4: baselibs.conf
Patch1: binutils-2.42-branch.diff.gz
Patch1: binutils-2.43-branch.diff.gz
Patch2: binutils-fix-branch.diff
Patch3: binutils-skip-rpaths.patch
Patch4: s390-biarch.diff
Patch5: x86-64-biarch.patch
Patch6: unit-at-a-time.patch
Patch8: ld-relro.diff
Patch9: testsuite.diff
Patch10: enable-targets-gold.diff
Patch12: s390-pic-dso.diff
Patch14: binutils-build-as-needed.diff
Patch15: binutils-znow.patch
Patch22: binutils-bfd_h.patch
Patch34: aarch64-common-pagesize.patch
Patch37: binutils-revert-plt32-in-branches.diff
Patch38: binutils-fix-invalid-op-errata.diff
Patch39: binutils-revert-nm-symversion.diff
@@ -153,7 +152,7 @@ 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: riscv-no-relax.patch
Patch61: pr33029.patch
Patch90: cross-avr-nesc-as.patch
Patch92: cross-avr-omit_section_dynsym.patch
Patch93: cross-avr-size.patch
@@ -179,7 +178,8 @@ Requires: alts
%else
PreReq: update-alternatives
%endif
%if 0%{!?cross:1} && 0%{?suse_version} >= 1310
# 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
%endif
@@ -246,26 +246,29 @@ The next generation profiling tool for Linux
echo "make check will return with %{make_check_handling} in case of testsuite failures."
%setup -q -n binutils-%{version}
# Backup flex and biscon files for later verification.
cp ld/ldlex.l ld/ldlex.l.orig
cp ld/ldgram.y ld/ldgram.y.orig
# 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
# Backup flex and biscon files for later verification. Do this
# after branch and fix-branch patches are applied (which are assumed
# to manual fixup generated files, in case the branch diff touches
# the flex/bison source files)
cp ld/ldlex.l ld/ldlex.l.orig
cp ld/ldgram.y ld/ldgram.y.orig
%if !%{test_vanilla}
%patch -P 3 -p1
%patch -P 4
%patch -P 5
%patch -P 6
%patch -P 8
%patch -P 9
%patch -P 10
%patch -P 12
%patch -P 14
%patch -P 15
%patch -P 22
%patch -P 34 -p1
%if %{suse_version} < 1550
%patch -P 37 -p1
%endif
@@ -300,6 +303,14 @@ diff -u ld/ldgram.y ld/ldgram.y.orig
sed -i -e '/BFD_VERSION_DATE/s/$/-%(echo %release | sed 's/\.[0-9]*$//')/' bfd/version.h
RPM_OPT_FLAGS="$RPM_OPT_FLAGS -Wno-error"
# 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
%if %{suse_version} > 1600
CC="gcc -std=gnu17"
export CC
%endif
%if 0%{!?cross:1}
# Building native binutils
echo "Building native binutils."
@@ -378,7 +389,7 @@ cd build-dir
%endif
--enable-shared \
%if %{suse_version} > 1500
%if %{with bootstrap} && 0%{?do_profiling}
%if %{with bootstrap} && 0%{?do_profiling} && !0%{?want_reproducible_builds}
--enable-pgo-build=lto \
%endif
--enable-colored-disassembly \
@@ -390,8 +401,9 @@ cd build-dir
--enable-warn-execstack=yes \
--enable-warn-rwx-segments=yes
#FIXME: enable in the future
#%if %{suse_version} > 1550
# FIXME: enable in future, when at least llvm15,llvm17,golang are
# fixed to accept zstd
#%if %{suse_version} > 1600
# --enable-default-compressed-debug-sections-algorithm=zstd \
#%endif
@@ -491,7 +503,7 @@ make -C gas-nesc %{?make_output_sync} %{?_smp_mflags}
%endif
%check
unset SUSE_ASNEEDED
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
# designed for checking file replacement in archives based on mtime.

View File

@@ -1,63 +0,0 @@
Index: ld/lexsup.c
===================================================================
--- ld/lexsup.c.orig 2014-10-14 17:43:07.000000000 +0200
+++ ld/lexsup.c 2014-10-14 17:43:26.000000000 +0200
@@ -623,6 +623,9 @@ parse_args (unsigned argc, char **argv)
}
}
+ optarg = "relro";
+ ldemul_handle_option ('z');
+
last_optind = -1;
while (1)
{
Index: ld/testsuite/config/default.exp
===================================================================
--- ld/testsuite/config/default.exp.orig 2014-10-14 17:43:07.000000000 +0200
+++ ld/testsuite/config/default.exp 2014-10-14 17:44:58.000000000 +0200
@@ -22,7 +22,7 @@
#
if ![info exists ld] then {
- set ld [findfile $base_dir/ld-new $base_dir/ld-new [transform ld]]
+ set ld "[findfile $base_dir/ld-new $base_dir/ld-new [transform ld]] -znorelro"
}
if ![info exists as] then {
@@ -70,7 +70,7 @@ if {[info exists ld_testsuite_bindir]} {
catch "exec ln -s ld tmpdir/ld/collect-ld" status
catch "exec ln -s ../../../gas/as-new tmpdir/ld/as" status
}
- set gcc_B_opt "-B[pwd]/tmpdir/ld/"
+ set gcc_B_opt "-B[pwd]/tmpdir/ld/ -Wl,-z,norelro"
}
# load the linker path
@@ -272,7 +272,7 @@ if ![info exists READELFFLAGS] then {
}
if ![info exists LD] then {
- set LD [findfile $base_dir/ld-new ./ld-new [transform ld]]
+ set LD "[findfile $base_dir/ld-new ./ld-new [transform ld]] -znorelro"
}
if ![info exists LDFLAGS] then {
Index: ld/testsuite/ld-bootstrap/bootstrap.exp
===================================================================
--- ld/testsuite/ld-bootstrap/bootstrap.exp.orig 2014-10-14 17:43:07.000000000 +0200
+++ ld/testsuite/ld-bootstrap/bootstrap.exp 2014-10-14 17:43:26.000000000 +0200
@@ -106,7 +106,12 @@ foreach flags $test_flags {
# This test can only be run if we have the ld build directory,
# since we need the object files.
- if {[file normalize $ld] != [file normalize $objdir/ld-new]} {
+ set ldexe $ld
+ set ldparm [string first " " $ld]
+ if { $ldparm > 0 } then {
+ set ldexe [string range $ld 0 $ldparm]
+ }
+ if {[file normalize $ldexe] != [file normalize $objdir/ld-new]} {
untested $testname
continue
}

43
pr33029.patch Normal file
View File

@@ -0,0 +1,43 @@
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

View File

@@ -1,64 +0,0 @@
From af514e5f6d1d0233a251a3ae17f7cb8d9ba8e36b Mon Sep 17 00:00:00 2001
From: Nelson Chu <nelson@rivosinc.com>
Date: Mon, 29 Jan 2024 21:17:41 +0800
Subject: [PATCH] RISC-V: Don't generate branch/jump relocation if symbol is
local when no-relax.
Refer to commit, dff565fcca8137954d6ad571ef39f6aec5c0429c. Theoretically,
assembler don't need to generate the pc-relative relocation and the refered
local .L symbol when relaxation is disabled. The above commit improved the
pcrel_hi/pcrel_lo relocations, and this commit improves branch and jump
relocations.
Passed the gcc/binutils regressions of riscv-gnu-toolchain.
gas/
* config/tc-riscv.c (md_apply_fix): Raise fixP->fx_done for all
branch and jump relocations when -mno-relax.
---
gas/config/tc-riscv.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/gas/config/tc-riscv.c b/gas/config/tc-riscv.c
index a4161420128..cbead954f09 100644
--- a/gas/config/tc-riscv.c
+++ b/gas/config/tc-riscv.c
@@ -4390,6 +4390,8 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
bfd_vma target = S_GET_VALUE (fixP->fx_addsy) + *valP;
bfd_vma delta = target - md_pcrel_from (fixP);
bfd_putl32 (bfd_getl32 (buf) | ENCODE_JTYPE_IMM (delta), buf);
+ if (!riscv_opts.relax && S_IS_LOCAL (fixP->fx_addsy))
+ fixP->fx_done = 1;
}
break;
@@ -4400,6 +4402,8 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
bfd_vma target = S_GET_VALUE (fixP->fx_addsy) + *valP;
bfd_vma delta = target - md_pcrel_from (fixP);
bfd_putl32 (bfd_getl32 (buf) | ENCODE_BTYPE_IMM (delta), buf);
+ if (!riscv_opts.relax && S_IS_LOCAL (fixP->fx_addsy))
+ fixP->fx_done = 1;
}
break;
@@ -4410,6 +4414,8 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
bfd_vma target = S_GET_VALUE (fixP->fx_addsy) + *valP;
bfd_vma delta = target - md_pcrel_from (fixP);
bfd_putl16 (bfd_getl16 (buf) | ENCODE_CBTYPE_IMM (delta), buf);
+ if (!riscv_opts.relax && S_IS_LOCAL (fixP->fx_addsy))
+ fixP->fx_done = 1;
}
break;
@@ -4420,6 +4426,8 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
bfd_vma target = S_GET_VALUE (fixP->fx_addsy) + *valP;
bfd_vma delta = target - md_pcrel_from (fixP);
bfd_putl16 (bfd_getl16 (buf) | ENCODE_CJTYPE_IMM (delta), buf);
+ if (!riscv_opts.relax && S_IS_LOCAL (fixP->fx_addsy))
+ fixP->fx_done = 1;
}
break;
--
2.43.2