]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
xtensa: add .note.GNU-stack section on linux
authorMax Filippov <jcmvbkbc@gmail.com>
Thu, 2 Mar 2023 17:45:41 +0000 (09:45 -0800)
committerMax Filippov <jcmvbkbc@gmail.com>
Mon, 13 Mar 2023 20:42:18 +0000 (13:42 -0700)
gcc/
* config/xtensa/linux.h (TARGET_ASM_FILE_END): New macro.

libgcc/
* config/xtensa/crti.S: Add .note.GNU-stack section on linux.
* config/xtensa/crtn.S: Likewise.
* config/xtensa/lib1funcs.S: Likewise.
* config/xtensa/lib2funcs.S: Likewise.

gcc/config/xtensa/linux.h
libgcc/config/xtensa/crti.S
libgcc/config/xtensa/crtn.S
libgcc/config/xtensa/lib1funcs.S
libgcc/config/xtensa/lib2funcs.S

index dc4d547fc5fd08914807f1c0860f069ea2d626e1..e684e7deebf924aa54f6d5086f375a89d7396b69 100644 (file)
@@ -69,3 +69,5 @@ along with GCC; see the file COPYING3.  If not see
 #define XTENSA_ALWAYS_PIC 1
 
 #undef DEBUGGER_REGNO
+
+#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
index b88df50207b6a7e6c8b9f927ef7558838c2d37b2..637203500c41c5f1eff3cd63f58fbe378d9f4365 100644 (file)
 
 #include "xtensa-config-builtin.h"
 
+/* An executable stack is *not* required for these functions.  */
+#if defined(__ELF__) && defined(__linux__)
+.section .note.GNU-stack,"",%progbits
+.previous
+#endif
+
        .section .init
        .globl _init
        .type _init,@function
index 7f271660f942914a686314e367e13b8208311466..15c13ea03d0ddf502d149d9100f2cf90b39a4ac6 100644 (file)
 
 #include "xtensa-config-builtin.h"
 
+/* An executable stack is *not* required for these functions.  */
+#if defined(__ELF__) && defined(__linux__)
+.section .note.GNU-stack,"",%progbits
+.previous
+#endif
+
        .section .init
 #if XCHAL_HAVE_WINDOWED && !__XTENSA_CALL0_ABI__
        retw
index a3f17b6b2cbc10560e251d19c2b0855ee528a3af..5baf2df1d20e96c5a078e7cd3c57e2f1714ed717 100644 (file)
@@ -25,6 +25,12 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 
 #include "xtensa-config-builtin.h"
 
+/* An executable stack is *not* required for these functions.  */
+#if defined(__ELF__) && defined(__linux__)
+.section .note.GNU-stack,"",%progbits
+.previous
+#endif
+
 /* Define macros for the ABS and ADDX* instructions to handle cases
    where they are not included in the Xtensa processor configuration.  */
 
index e038e41eb6f1b3c42f505872889a61f6d54bdeff..992f712238c430d88cc3b4911518e7de492a79ff 100644 (file)
@@ -25,6 +25,12 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 
 #include "xtensa-config-builtin.h"
 
+/* An executable stack is *not* required for these functions.  */
+#if defined(__ELF__) && defined(__linux__)
+.section .note.GNU-stack,"",%progbits
+.previous
+#endif
+
 /* __xtensa_libgcc_window_spill: This function flushes out all but the
    current register window.  This is used to set up the stack so that
    arbitrary frames can be accessed.  */