From 67e712360a64e904d0475ace013ec52092efcfc8 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Fri, 28 Apr 2023 14:06:11 +0100 Subject: [PATCH] base/asm-common.h: Hoist executable-stack stuff into the ELF block. --- base/asm-common.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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 -- 2.11.0