From: Mark Wooding Date: Fri, 28 Apr 2023 13:06:11 +0000 (+0100) Subject: base/asm-common.h: Hoist executable-stack stuff into the ELF block. X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb/commitdiff_plain/67e712360a64e904d0475ace013ec52092efcfc8 base/asm-common.h: Hoist executable-stack stuff into the ELF block. --- diff --git a/base/asm-common.h b/base/asm-common.h index 5a5063ac..b4d4a909 100644 --- a/base/asm-common.h +++ b/base/asm-common.h @@ -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