Skip to content

Commit 79b4dd0

Browse files
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 <minicx@disroot.org>
1 parent 5ad6435 commit 79b4dd0

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

common_arm.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,15 @@ static inline int blas_quickdivide(blasint x, blasint y){
114114
OPENBLAS_ARM_TYPE_FUNCTION \
115115
REALNAME:
116116

117-
#define EPILOGUE
117+
#if defined(__ELF__) && defined(__linux__)
118+
# define GNUSTACK .section .note.GNU-stack,"",%progbits
119+
#else
120+
# define GNUSTACK
121+
#endif
122+
123+
#define EPILOGUE \
124+
GNUSTACK
125+
118126

119127
#define PROFCODE
120128

0 commit comments

Comments
 (0)