diff options
author | Andreas Schwab <schwab@suse.de> | 2022-06-11 23:29:24 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-07-07 23:25:10 -0400 |
commit | 3739e565f8fa09b3a31ba8f563c518480585f6f9 (patch) | |
tree | c153ec989582764b4649e5912399ecb72fcd759e | |
parent | 42c917df5be8d75f79a283a8ed59fbaf099bc973 (diff) | |
download | haskell-3739e565f8fa09b3a31ba8f563c518480585f6f9.tar.gz |
RTS: Add stack marker to StgCRunAsm.S
Every object file must be properly marked for non-executable stack, even if it
contains no code.
-rw-r--r-- | rts/StgCRunAsm.S | 11 |
1 files 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 |