base/asm-common.h: Hoist executable-stack stuff into the ELF block.
authorMark Wooding <mdw@distorted.org.uk>
Fri, 28 Apr 2023 13:06:11 +0000 (14:06 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Fri, 28 Apr 2023 13:06:11 +0000 (14:06 +0100)
base/asm-common.h

index 5a5063a..b4d4a90 100644 (file)
@@ -106,6 +106,12 @@ name:
 #  define WANT_PIC 1
 #endif
 
+// Don't make the stack executable by default.
+#ifndef FORCE_EXECUTABLE_STACK
+       .pushsection .note.GNU-stack, "", _SECTTY(progbits)
+       .popsection
+#endif
+
 #endif
 
 ///--------------------------------------------------------------------------
@@ -1209,11 +1215,6 @@ name:
 #  define SIZE_OBJ(name)
 #endif
 
-#if __ELF__ && !defined(FORCE_EXECUTABLE_STACK)
-       .pushsection .note.GNU-stack, "", _SECTTY(progbits)
-       .popsection
-#endif
-
 ///----- That's all, folks --------------------------------------------------
 
 #endif