aboutsummaryrefslogtreecommitdiff
path: root/libgcc
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2023-03-02 09:45:41 -0800
committerMax Filippov <jcmvbkbc@gmail.com>2023-03-13 13:42:18 -0700
commit6360bf9a2d08f08c151464c77c0da53cd702ff25 (patch)
tree931ee8d0c5b0b6e0c773555ec01b3ef7cda70ebf /libgcc
parent538a0d0f29b12cff05681b6de2e0a3d7b33f3ef0 (diff)
downloadgcc-6360bf9a2d08f08c151464c77c0da53cd702ff25.zip
gcc-6360bf9a2d08f08c151464c77c0da53cd702ff25.tar.gz
gcc-6360bf9a2d08f08c151464c77c0da53cd702ff25.tar.bz2
xtensa: add .note.GNU-stack section on linux
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.
Diffstat (limited to 'libgcc')
-rw-r--r--libgcc/config/xtensa/crti.S6
-rw-r--r--libgcc/config/xtensa/crtn.S6
-rw-r--r--libgcc/config/xtensa/lib1funcs.S6
-rw-r--r--libgcc/config/xtensa/lib2funcs.S6
4 files changed, 24 insertions, 0 deletions
diff --git a/libgcc/config/xtensa/crti.S b/libgcc/config/xtensa/crti.S
index b88df50..6372035 100644
--- a/libgcc/config/xtensa/crti.S
+++ b/libgcc/config/xtensa/crti.S
@@ -26,6 +26,12 @@
#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
diff --git a/libgcc/config/xtensa/crtn.S b/libgcc/config/xtensa/crtn.S
index 7f27166..15c13ea 100644
--- a/libgcc/config/xtensa/crtn.S
+++ b/libgcc/config/xtensa/crtn.S
@@ -27,6 +27,12 @@
#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
diff --git a/libgcc/config/xtensa/lib1funcs.S b/libgcc/config/xtensa/lib1funcs.S
index a3f17b6..5baf2df 100644
--- a/libgcc/config/xtensa/lib1funcs.S
+++ b/libgcc/config/xtensa/lib1funcs.S
@@ -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. */
diff --git a/libgcc/config/xtensa/lib2funcs.S b/libgcc/config/xtensa/lib2funcs.S
index e038e41..992f712 100644
--- a/libgcc/config/xtensa/lib2funcs.S
+++ b/libgcc/config/xtensa/lib2funcs.S
@@ -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. */