ld: Use --no-rosegment to ld for PR ld/22393 tests

The commit

bf6d7087de0 ld: Move the .note.build-id section to near the start of the memory map

moves the .note.build-id section before text sections.  When --rosegment
and -z separate-code are used together, the .note.gnu.property section
is placed between the .note.build-id section and text sections in the
same PT_LOAD segment by orphan placement.  Pass --no-rosegment to ld for
PR ld/22393 tests to avoid linker test failures.

	PR ld/32190
	* testsuite/ld-elf/pr22393-2a.rd: Pass --no-rosegment to ld.
	* testsuite/ld-elf/pr22393-2b.rd: Likewise.
	* testsuite/ld-elf/shared.exp: Pass --no-rosegment to ld when
	building pr22393-2 tests.
	* testsuite/ld-x86-64/pr22393-3a.rd: Pass --no-rosegment to ld.
	* testsuite/ld-x86-64/pr22393-3b.rd: Likewise.
	* testsuite/ld-x86-64/x86-64.exp: Pass --no-rosegment to ld when
	building pr22393-3 tests.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
diff --git a/ld/testsuite/ld-elf/pr22393-2a.rd b/ld/testsuite/ld-elf/pr22393-2a.rd
index 0050f1b..a9c5478 100644
--- a/ld/testsuite/ld-elf/pr22393-2a.rd
+++ b/ld/testsuite/ld-elf/pr22393-2a.rd
@@ -1,5 +1,5 @@
 #source: pr22393-1.s
-#ld: -shared -z separate-code
+#ld: -shared -z separate-code --no-rosegment
 #readelf: -l --wide
 #target: *-*-linux-gnu *-*-gnu* *-*-nacl*
 
diff --git a/ld/testsuite/ld-elf/pr22393-2b.rd b/ld/testsuite/ld-elf/pr22393-2b.rd
index 0050f1b..a9c5478 100644
--- a/ld/testsuite/ld-elf/pr22393-2b.rd
+++ b/ld/testsuite/ld-elf/pr22393-2b.rd
@@ -1,5 +1,5 @@
 #source: pr22393-1.s
-#ld: -shared -z separate-code
+#ld: -shared -z separate-code --no-rosegment
 #readelf: -l --wide
 #target: *-*-linux-gnu *-*-gnu* *-*-nacl*
 
diff --git a/ld/testsuite/ld-elf/shared.exp b/ld/testsuite/ld-elf/shared.exp
index 281c3f5..e13e7e0 100644
--- a/ld/testsuite/ld-elf/shared.exp
+++ b/ld/testsuite/ld-elf/shared.exp
@@ -1410,7 +1410,7 @@
 	] \
 	[list \
 	    "Build pr22393-2a.so" \
-	    "-shared -Wl,-z,separate-code" \
+	    "-shared -Wl,-z,separate-code,--no-rosegment" \
 	    "-fPIC" \
 	    {pr22393-2a.c} \
 	    {{readelf -lW pr22393-2a.rd} \
@@ -1419,7 +1419,7 @@
 	] \
 	[list \
 	    "Build pr22393-2a-now.so" \
-	    "-shared -Wl,-z,separate-code,-z,now" \
+	    "-shared -Wl,-z,separate-code,-z,now,--no-rosegment" \
 	    "-fPIC" \
 	    {pr22393-2a.c} \
 	    {{readelf -lW pr22393-2a.rd} \
@@ -1428,7 +1428,7 @@
 	] \
 	[list \
 	    "Build pr22393-2" \
-	    "$NOPIE_LDFLAGS -Wl,-z,separate-code,--no-as-needed tmpdir/pr22393-2a.so" \
+	    "$NOPIE_LDFLAGS -Wl,-z,separate-code,--no-rosegment,--no-as-needed tmpdir/pr22393-2a.so" \
 	    "$NOPIE_CFLAGS" \
 	    {pr22393-2b.c} \
 	    {{readelf -lW pr22393-2a.rd} \
@@ -1437,7 +1437,7 @@
 	] \
 	[list \
 	    "Build pr22393-2 (PIE)" \
-	    "-pie -Wl,-z,separate-code,--no-as-needed tmpdir/pr22393-2a-now.so" \
+	    "-pie -Wl,-z,separate-code,--no-rosegment,--no-as-needed tmpdir/pr22393-2a-now.so" \
 	    "-fPIE" \
 	    {pr22393-2b.c} \
 	    {{readelf -lW pr22393-2a.rd} \
@@ -1446,7 +1446,7 @@
 	] \
 	[list \
 	    "Build pr22393-2 (static)" \
-	    "-static -Wl,-z,separate-code" \
+	    "-static -Wl,-z,separate-code,--no-rosegment" \
 	    "" \
 	    {pr22393-2a.c pr22393-2b.c} \
 	    {{readelf -lW pr22393-2a.rd} \
diff --git a/ld/testsuite/ld-x86-64/pr22393-3a.rd b/ld/testsuite/ld-x86-64/pr22393-3a.rd
index b17e09b..4027ed3 100644
--- a/ld/testsuite/ld-x86-64/pr22393-3a.rd
+++ b/ld/testsuite/ld-x86-64/pr22393-3a.rd
@@ -1,5 +1,5 @@
 #source: pr22393-1.s
-#ld: -shared -z separate-code
+#ld: -shared -z separate-code --no-rosegment
 #readelf: -l --wide
 #target: *-*-linux-gnu *-*-gnu*
 
diff --git a/ld/testsuite/ld-x86-64/pr22393-3b.rd b/ld/testsuite/ld-x86-64/pr22393-3b.rd
index b17e09b..4027ed3 100644
--- a/ld/testsuite/ld-x86-64/pr22393-3b.rd
+++ b/ld/testsuite/ld-x86-64/pr22393-3b.rd
@@ -1,5 +1,5 @@
 #source: pr22393-1.s
-#ld: -shared -z separate-code
+#ld: -shared -z separate-code --no-rosegment
 #readelf: -l --wide
 #target: *-*-linux-gnu *-*-gnu*
 
diff --git a/ld/testsuite/ld-x86-64/x86-64.exp b/ld/testsuite/ld-x86-64/x86-64.exp
index d87ab1f..cf78fff 100644
--- a/ld/testsuite/ld-x86-64/x86-64.exp
+++ b/ld/testsuite/ld-x86-64/x86-64.exp
@@ -1219,7 +1219,7 @@
 	] \
 	[list \
 	    "Build pr22393-3a.so" \
-	    "-shared -Wl,-z,separate-code,-z,max-page-size=0x1000" \
+	    "-shared -Wl,-z,separate-code,-z,max-page-size=0x1000,--no-rosegment" \
 	    "-fPIC -Wa,-mx86-used-note=yes" \
 	    {pr22393-3a.c} \
 	    {{readelf -lW pr22393-3a.rd} \
@@ -1228,7 +1228,7 @@
 	] \
 	[list \
 	    "Build pr22393-3a-now.so" \
-	    "-shared -Wl,-z,separate-code,-z,now,-z,max-page-size=0x1000" \
+	    "-shared -Wl,-z,separate-code,-z,now,-z,max-page-size=0x1000,--no-rosegment" \
 	    "-fPIC -Wa,-mx86-used-note=yes" \
 	    {pr22393-3a.c} \
 	    {{readelf -lW pr22393-3a.rd} \
@@ -1237,7 +1237,7 @@
 	] \
 	[list \
 	    "Build pr22393-3" \
-	    "$NOPIE_LDFLAGS -Wl,-z,separate-code,-z,max-page-size=0x1000,--no-as-needed tmpdir/pr22393-3a.so" \
+	    "$NOPIE_LDFLAGS -Wl,-z,separate-code,-z,max-page-size=0x1000,--no-rosegment,--no-as-needed tmpdir/pr22393-3a.so" \
 	    "$NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \
 	    {pr22393-3b.c} \
 	    {{readelf -lW pr22393-3a.rd} \
@@ -1246,7 +1246,7 @@
 	] \
 	[list \
 	    "Build pr22393-3 (PIE)" \
-	    "-pie -Wl,-z,separate-code,-z,max-page-size=0x1000,--no-as-needed tmpdir/pr22393-3a-now.so" \
+	    "-pie -Wl,-z,separate-code,-z,max-page-size=0x1000,--no-rosegment,--no-as-needed tmpdir/pr22393-3a-now.so" \
 	    "-fPIE -Wa,-mx86-used-note=yes" \
 	    {pr22393-3b.c} \
 	    {{readelf -lW pr22393-3a.rd} \
@@ -1255,7 +1255,7 @@
 	] \
 	[list \
 	    "Build pr22393-3 (static)" \
-	    "-static -Wl,-z,separate-code,-z,max-page-size=0x1000" \
+	    "-static -Wl,-z,separate-code,-z,max-page-size=0x1000,--no-rosegment" \
 	    "-Wa,-mx86-used-note=yes" \
 	    {pr22393-3a.c pr22393-3b.c} \
 	    {{readelf -lW pr22393-3a.rd} \