summaryrefslogtreecommitdiff
path: root/execstack.patch
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2023-10-28 09:59:10 +0000
committerCoprDistGit <infra@openeuler.org>2023-10-28 09:59:10 +0000
commitb02e7abee55d6e9e31efa2fc9f3df455ca9c9f1d (patch)
tree4d726cdf3e5fc4329489fd1a3645cc1c5e4e20a3 /execstack.patch
parent1cc8798baf9426f821b4f887f2914eac62e3ecd8 (diff)
automatic import of ghcopeneuler23.03
Diffstat (limited to 'execstack.patch')
-rw-r--r--execstack.patch50
1 files changed, 50 insertions, 0 deletions
diff --git a/execstack.patch b/execstack.patch
new file mode 100644
index 0000000..f8370a4
--- /dev/null
+++ b/execstack.patch
@@ -0,0 +1,50 @@
+From 3739e565f8fa09b3a31ba8f563c518480585f6f9 Mon Sep 17 00:00:00 2001
+From: Andreas Schwab <schwab@suse.de>
+Date: Sat, 11 Jun 2022 23:29:24 +0200
+Subject: [PATCH] RTS: Add stack marker to StgCRunAsm.S
+
+Every object file must be properly marked for non-executable stack, even if it
+contains no code.
+---
+ rts/StgCRunAsm.S | 11 +++++------
+ 1 file changed, 5 insertions(+), 6 deletions(-)
+
+diff --git a/rts/StgCRunAsm.S b/rts/StgCRunAsm.S
+index aed3241d12..9216e6c759 100644
+--- a/rts/StgCRunAsm.S
++++ b/rts/StgCRunAsm.S
+@@ -66,8 +66,6 @@ StgReturn:
+ addi 12,1,-(8*18)
+ bl _restgpr1_14
+ b _restfpr_14
+-
+- .section .note.GNU-stack,"",@progbits
+ # else // linux_HOST_OS
+ # error Only Linux support for power64 little endian right now.
+ # endif
+@@ -231,8 +229,6 @@ StgReturn:
+ .cfi_endproc
+ .size StgReturn, .-StgReturn
+
+- .section .note.GNU-stack,"",@progbits
+-
+ #elif defined(riscv64_HOST_ARCH)
+ # define STACK_FRAME_SIZE (RESERVED_C_STACK_BYTES+208)
+ .text
+@@ -374,8 +370,11 @@ StgReturn:
+ ret
+ .cfi_endproc
+ .size StgReturn, .-StgReturn
+-
+- .section .note.GNU-stack,"",@progbits
+ #endif
+
+ #endif /* !USE_MINIINTERPRETER */
++
++/* mark stack as nonexecutable */
++#if defined(__linux__) && defined(__ELF__)
++.section .note.GNU-stack,"",@progbits
++#endif
+--
+2.37.0
+