s390x: Specify program headers with flags to avoid linker warnings

Avoid "LOAD segment with RWX permissions" warnings from new linkers
by specifying program headers. See 59a797f451cde and linked commits
for similar fixes for other architectures.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Message-ID: <20240602130656.120866-3-npiggin@gmail.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
diff --git a/s390x/snippets/c/flat.lds.S b/s390x/snippets/c/flat.lds.S
index 468b5f1..6b8ceb9 100644
--- a/s390x/snippets/c/flat.lds.S
+++ b/s390x/snippets/c/flat.lds.S
@@ -1,5 +1,11 @@
 #include <asm/asm-offsets.h>
 
+PHDRS
+{
+    text PT_LOAD FLAGS(5);
+    data PT_LOAD FLAGS(6);
+}
+
 SECTIONS
 {
 	.lowcore : {
@@ -29,7 +35,7 @@
 		*(.init)
 		*(.text)
 		*(.text.*)
-	}
+	} :text
 	. = ALIGN(4K);
 	etext = .;
 	/* End text */
@@ -37,9 +43,9 @@
 	.data : {
 		*(.data)
 		*(.data.rel*)
-	}
+	} :data
 	. = ALIGN(16);
-	.rodata : { *(.rodata) *(.rodata.*) }
+	.rodata : { *(.rodata) *(.rodata.*) } :data
 	. = ALIGN(16);
 	.bss : { *(.bss) }
 	/* End data */