File binutils-compat-old-behaviour.diff of Package binutils.41432

This adjusts some testcases that expect new behaviour:
* that relaxable relocations are generated
* that separate-code is default
  - this also implies that default max-page-size is 0x1000, instead of the
    old 0x200000, so some testcases need to encode that as well
* aarch64: don't enable '-z gcs=implicit' by default
Index: binutils-2.45/ld/testsuite/ld-elf/linux-x86.exp
===================================================================
--- binutils-2.45.orig/ld/testsuite/ld-elf/linux-x86.exp	2025-07-27 01:00:00.000000000 +0200
+++ binutils-2.45/ld/testsuite/ld-elf/linux-x86.exp	2025-10-28 15:10:38.085247199 +0100
@@ -324,7 +324,7 @@ proc check_pr25749a {testname srcfilea s
     }
 
     # Suppress warning for unsupported attribute from older GCC.
-    append cflags " -w"
+    append cflags " -w -Wa,-mrelax-relocations=yes"
 
     exec cp $srcdir/$subdir/$srcfilea $srcfilea
     exec chmod +w $srcfilea
@@ -445,7 +445,7 @@ proc check_pr25749b {testname srcfilea s
 	[list \
 	    "Build lib${testname}.so ($dsoldflags)" \
 	    "-shared $dsoldflags tmpdir/pr25749-bin.o -z noexecstack" \
-	    "-fPIC -I../bfd" \
+	    "-fPIC -I../bfd -Wa,-mrelax-relocations=yes" \
 	    [list $srcfileb] \
 	    {{readelf {-Wr} pr25749.rd}}  \
 	    "lib${testname}.so" \
Index: binutils-2.45/ld/testsuite/ld-i386/report-reloc-1.d
===================================================================
--- binutils-2.45.orig/ld/testsuite/ld-i386/report-reloc-1.d	2025-07-27 01:00:00.000000000 +0200
+++ binutils-2.45/ld/testsuite/ld-i386/report-reloc-1.d	2025-10-28 15:10:38.085247199 +0100
@@ -1,6 +1,6 @@
 #source: report-reloc-1.s
 #as: --32
-#ld: -pie -melf_i386 -z report-relative-reloc $NO_DT_RELR_LDFLAGS
+#ld: -pie -melf_i386 -z report-relative-reloc -z separate-code $NO_DT_RELR_LDFLAGS
 #warning_output: report-reloc-1.l
 #readelf: -r --wide
 
Index: binutils-2.45/ld/testsuite/ld-x86-64/report-reloc-1-x32.d
===================================================================
--- binutils-2.45.orig/ld/testsuite/ld-x86-64/report-reloc-1-x32.d	2025-07-27 01:00:00.000000000 +0200
+++ binutils-2.45/ld/testsuite/ld-x86-64/report-reloc-1-x32.d	2025-10-28 15:10:38.085247199 +0100
@@ -1,6 +1,6 @@
 #source: report-reloc-1.s
 #as: --x32
-#ld: -pie -melf32_x86_64 -z report-relative-reloc $NO_DT_RELR_LDFLAGS
+#ld: -pie -melf32_x86_64 -z report-relative-reloc -z separate-code -z max-page-size=4096 $NO_DT_RELR_LDFLAGS
 #warning_output: report-reloc-1.l
 #readelf: -r --wide
 
Index: binutils-2.45/ld/testsuite/ld-x86-64/report-reloc-1.d
===================================================================
--- binutils-2.45.orig/ld/testsuite/ld-x86-64/report-reloc-1.d	2025-07-27 01:00:00.000000000 +0200
+++ binutils-2.45/ld/testsuite/ld-x86-64/report-reloc-1.d	2025-10-28 15:10:38.085247199 +0100
@@ -1,6 +1,6 @@
 #source: report-reloc-1.s
 #as: --64
-#ld: -pie -melf_x86_64 -z report-relative-reloc $NO_DT_RELR_LDFLAGS
+#ld: -pie -melf_x86_64 -z report-relative-reloc -z separate-code -z max-page-size=4096 $NO_DT_RELR_LDFLAGS
 #warning_output: report-reloc-1.l
 #readelf: -r --wide
 
Index: binutils-2.45/ld/emultempl/aarch64elf.em
===================================================================
--- binutils-2.45.orig/ld/emultempl/aarch64elf.em	2025-07-27 01:00:00.000000000 +0200
+++ binutils-2.45/ld/emultempl/aarch64elf.em	2025-10-28 15:10:38.085247199 +0100
@@ -37,7 +37,7 @@ static int no_apply_dynamic_relocs = 0;
 static aarch64_protection_opts sw_protections = {
   .plt_type = PLT_NORMAL,
   .bti_report = MARKING_WARN,
-  .gcs_type = GCS_IMPLICIT,
+  .gcs_type = GCS_NEVER,
   .gcs_report = MARKING_WARN,
   .gcs_report_dynamic = MARKING_UNSET,
 };
Index: binutils-2.45/ld/testsuite/ld-aarch64/protections/gcs-1-b.d
===================================================================
--- binutils-2.45.orig/ld/testsuite/ld-aarch64/protections/gcs-1-b.d	2025-07-27 01:00:00.000000000 +0200
+++ binutils-2.45/ld/testsuite/ld-aarch64/protections/gcs-1-b.d	2025-10-28 15:11:41.600313675 +0100
@@ -3,7 +3,7 @@
 #source: gcs2.s
 #alltargets: [check_shared_lib_support] *linux*
 #as: -march=armv9.4-a+gcs -defsym __property_gcs__=1
-#ld: -shared
+#ld: -shared -z gcs=implicit
 #readelf: -n
 
 Displaying notes found in: .note.gnu.property
openSUSE Build Service is sponsored by