From a2930664f42d5c7635bb83b3c7f3c988c5849c78 Mon Sep 17 00:00:00 2001 From: Zhang Xianyi Date: Sun, 28 Jul 2013 00:09:40 +0800 Subject: [PATCH] Refs #262. Added executable stack markings. --- CONTRIBUTORS.md | 4 ++++ common_alpha.h | 10 +++++++++- common_ia64.h | 9 ++++++++- common_mips64.h | 9 ++++++++- common_sparc.h | 11 ++++++++++- common_x86.h | 4 +++- common_x86_64.h | 5 ++++- 7 files changed, 46 insertions(+), 6 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 4a13bcc..59df776 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -79,5 +79,9 @@ In chronological order: * [2013-07-11] create openblas_get_parallel to retrieve information which parallelization model is used by OpenBLAS. +* Sébastien Fabbro + * [2013-07-24] Modify makefile to respect user's LDFLAGS + * [2013-07-24] Add stack markings for GNU as arch-independent for assembler files + * [Your name or handle] <[email or website]> * [Date] [Brief summary of your changes] diff --git a/common_alpha.h b/common_alpha.h index cf79473..3b46c74 100644 --- a/common_alpha.h +++ b/common_alpha.h @@ -150,9 +150,17 @@ REALNAME: #define PROFCODE .prologue 0 #endif +#if defined(__linux__) && defined(__ELF__) +#define GNUSTACK .section .note.GNU-stack,"",%progbits +#else +#define GNUSTACK +#endif + #define EPILOGUE \ .end REALNAME; \ - .ident VERSION + .ident VERSION; \ + GNUSTACK + #endif #ifdef DOUBLE diff --git a/common_ia64.h b/common_ia64.h index 81939cc..3530e0b 100644 --- a/common_ia64.h +++ b/common_ia64.h @@ -379,8 +379,15 @@ REALNAME: #define PROFCODE #endif +#if defined(__linux__) && defined(__ELF__) +#define GNUSTACK .section .note.GNU-stack,"",%progbits +#else +#define GNUSTACK +#endif + #define EPILOGUE \ - .endp REALNAME + .endp REALNAME ; \ + GNUSTACK #define START_ADDRESS 0x20000fc800000000UL diff --git a/common_mips64.h b/common_mips64.h index 1bee694..c08fb2c 100644 --- a/common_mips64.h +++ b/common_mips64.h @@ -235,10 +235,17 @@ REALNAME: ;\ .set noreorder ;\ .set nomacro +#if defined(__linux__) && defined(__ELF__) +#define GNUSTACK .section .note.GNU-stack,"",%progbits +#else +#define GNUSTACK +#endif + #define EPILOGUE \ .set macro ;\ .set reorder ;\ - .end REALNAME + .end REALNAME ;\ + GNUSTACK #define PROFCODE #endif diff --git a/common_sparc.h b/common_sparc.h index 35d8bdb..cfd27f7 100644 --- a/common_sparc.h +++ b/common_sparc.h @@ -199,8 +199,17 @@ static __inline int blas_quickdivide(blasint x, blasint y){ .type REALNAME, #function; \ .proc 07; \ REALNAME:; + +#if defined(__linux__) && defined(__ELF__) +#define GNUSTACK .section .note.GNU-stack,"",%progbits +#else +#define GNUSTACK +#endif + #define EPILOGUE \ - .size REALNAME, .-REALNAME + .size REALNAME, .-REALNAME; \ + GNUSTACK + #endif #endif diff --git a/common_x86.h b/common_x86.h index 5f56839..48517d9 100644 --- a/common_x86.h +++ b/common_x86.h @@ -301,7 +301,9 @@ REALNAME: #define PROFCODE #endif -#define EPILOGUE .size REALNAME, .-REALNAME +#define EPILOGUE \ + .size REALNAME, .-REALNAME; \ + .section .note.GNU-stack,"",%progbits #endif diff --git a/common_x86_64.h b/common_x86_64.h index 8f9f736..1889038 100644 --- a/common_x86_64.h +++ b/common_x86_64.h @@ -372,7 +372,10 @@ REALNAME: #define PROFCODE #endif -#define EPILOGUE .size REALNAME, .-REALNAME +#define EPILOGUE \ + .size REALNAME, .-REALNAME; \ + .section .note.GNU-stack,"",%progbits + #endif -- 2.7.4