From 79b4dd0fb073407121c6fd280fd3e787d6184a8f Mon Sep 17 00:00:00 2001 From: minicx Date: Wed, 18 Jun 2025 15:03:03 +0300 Subject: [PATCH] fix(arm): add .note.GNU-stack to ARM assembly to prevent writable-stack warnings Add .section .note.GNU-stack in ARM assembly epilogue on Linux/ELF targets to avoid warnings about a writable/executable stack and ensure shared objects do not require an executable stack. Signed-off-by: minicx --- common_arm.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/common_arm.h b/common_arm.h index d6291018b..d0d245143 100644 --- a/common_arm.h +++ b/common_arm.h @@ -114,7 +114,15 @@ static inline int blas_quickdivide(blasint x, blasint y){ OPENBLAS_ARM_TYPE_FUNCTION \ REALNAME: -#define EPILOGUE +#if defined(__ELF__) && defined(__linux__) +# define GNUSTACK .section .note.GNU-stack,"",%progbits +#else +# define GNUSTACK +#endif + +#define EPILOGUE \ + GNUSTACK + #define PROFCODE