From 25bf3687361501e711d50a8038f0f8de4a2d2aa3 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Wed, 10 Aug 2011 11:01:26 +0300 Subject: [PATCH] Mark stack of 'rts/AdjustorAsm.S' as nonexecutable on linux Gentoo's scanelf program found executable stack in many resulting binaries: * RWX --- --- home/prefix/gentoo/usr/lib/ghc-7.2.1/ghc * !WX --- --- home/prefix/gentoo/usr/lib/ghc-7.2.1/libHSrts.a:AdjustorAsm.o More info can be found here: http://www.gentoo.org/proj/en/hardened/gnu-stack.xml Signed-off-by: Sergei Trofimovich --- rts/AdjustorAsm.S | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/rts/AdjustorAsm.S b/rts/AdjustorAsm.S index 75b83f6..8045bfe 100644 --- a/rts/AdjustorAsm.S +++ b/rts/AdjustorAsm.S @@ -192,3 +192,7 @@ adjustorCode: ret #endif +/* mark stack as nonexecutable */ +#if defined(__linux__) && defined(__ELF__) +.section .note.GNU-stack,"",@progbits +#endif -- 1.7.3.4