diff mbox series

[kvm-unit-tests,2/2] s390x: Specify program headers with flags to avoid linker warnings

Message ID 20240602130656.120866-3-npiggin@gmail.com (mailing list archive)
State New, archived
Headers show
Series s390x: Fix build error messages | expand

Commit Message

Nicholas Piggin June 2, 2024, 1:06 p.m. UTC
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>
---
 s390x/snippets/c/flat.lds.S | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/s390x/snippets/c/flat.lds.S b/s390x/snippets/c/flat.lds.S
index 468b5f1ee..6b8ceb9e0 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 @@  SECTIONS
 		*(.init)
 		*(.text)
 		*(.text.*)
-	}
+	} :text
 	. = ALIGN(4K);
 	etext = .;
 	/* End text */
@@ -37,9 +43,9 @@  SECTIONS
 	.data : {
 		*(.data)
 		*(.data.rel*)
-	}
+	} :data
 	. = ALIGN(16);
-	.rodata : { *(.rodata) *(.rodata.*) }
+	.rodata : { *(.rodata) *(.rodata.*) } :data
 	. = ALIGN(16);
 	.bss : { *(.bss) }
 	/* End data */