summaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/alpha/linux-elf.h7
-rw-r--r--gcc/config/i386/i386.c4
-rw-r--r--gcc/config/i386/linux.h7
-rw-r--r--gcc/config/i386/linux64.h7
-rw-r--r--gcc/config/m68k/linux.h7
-rw-r--r--gcc/config/rs6000/linux.h7
-rw-r--r--gcc/config/rs6000/linux64.h8
-rw-r--r--gcc/config/rs6000/ppc-asm.h5
-rw-r--r--gcc/config/s390/linux.h6
-rw-r--r--gcc/config/sparc/linux.h7
-rw-r--r--gcc/config/sparc/linux64.h7
11 files changed, 72 insertions, 0 deletions
diff --git a/gcc/config/alpha/linux-elf.h b/gcc/config/alpha/linux-elf.h
index be17dddab24..c7319f31ffe 100644
--- a/gcc/config/alpha/linux-elf.h
+++ b/gcc/config/alpha/linux-elf.h
@@ -41,3 +41,10 @@ Boston, MA 02111-1307, USA. */
#undef LIB_SPEC
#define LIB_SPEC \
"%{pthread:-lpthread} %{shared:-lc}%{!shared:%{profile:-lc_p}%{!profile:-lc}} "
+
+#define ASM_FILE_END(FILE) \
+ do { \
+ named_section_flags (".note.GNU-stack", \
+ SECTION_DEBUG \
+ | (trampolines_created ? SECTION_CODE : 0)); \
+ } while (0)
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index c96ac8c68c7..f2d94c20cdc 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -4729,6 +4729,10 @@ ix86_asm_file_end (file)
output_asm_insn ("mov{l}\t{%1, %0|%0, %1}", xops);
output_asm_insn ("ret", xops);
}
+
+#ifdef SUBTARGET_FILE_END
+ SUBTARGET_FILE_END (file);
+#endif
}
/* Emit code for the SET_GOT patterns. */
diff --git a/gcc/config/i386/linux.h b/gcc/config/i386/linux.h
index 90dcd1dad5c..3041368f27d 100644
--- a/gcc/config/i386/linux.h
+++ b/gcc/config/i386/linux.h
@@ -219,6 +219,13 @@ Boston, MA 02111-1307, USA. */
: "=d"(BASE))
#endif
+#define SUBTARGET_FILE_END(FILE) \
+ do { \
+ named_section_flags (".note.GNU-stack", \
+ SECTION_DEBUG \
+ | (trampolines_created ? SECTION_CODE : 0)); \
+ } while (0)
+
/* Do code reading to identify a signal frame, and set the frame
state data appropriately. See unwind-dw2.c for the structs. */
diff --git a/gcc/config/i386/linux64.h b/gcc/config/i386/linux64.h
index 575cbee10cc..341ef32feb1 100644
--- a/gcc/config/i386/linux64.h
+++ b/gcc/config/i386/linux64.h
@@ -67,6 +67,13 @@ Boston, MA 02111-1307, USA. */
#define MULTILIB_DEFAULTS { "m64" }
+#define SUBTARGET_FILE_END(FILE) \
+ do { \
+ named_section_flags (".note.GNU-stack", \
+ SECTION_DEBUG \
+ | (trampolines_created ? SECTION_CODE : 0)); \
+ } while (0)
+
/* Do code reading to identify a signal frame, and set the frame
state data appropriately. See unwind-dw2.c for the structs.
Don't use this at all if inhibit_libc is used. */
diff --git a/gcc/config/m68k/linux.h b/gcc/config/m68k/linux.h
index 9e81a0a8109..82015d300ae 100644
--- a/gcc/config/m68k/linux.h
+++ b/gcc/config/m68k/linux.h
@@ -334,3 +334,10 @@ do { \
: "d" (_beg), "d" (_len) \
: "%d0", "%d2", "%d3"); \
}
+
+#define ASM_FILE_END(FILE) \
+ do { \
+ named_section_flags (".note.GNU-stack", \
+ SECTION_DEBUG \
+ | (trampolines_created ? SECTION_CODE : 0)); \
+ } while (0)
diff --git a/gcc/config/rs6000/linux.h b/gcc/config/rs6000/linux.h
index 0eaf5df6772..7234d136171 100644
--- a/gcc/config/rs6000/linux.h
+++ b/gcc/config/rs6000/linux.h
@@ -86,6 +86,13 @@
/* We don't need to generate entries in .fixup. */
#undef RELOCATABLE_NEEDS_FIXUP
+#define ASM_FILE_END(FILE) \
+ do { \
+ named_section_flags (".note.GNU-stack", \
+ SECTION_DEBUG \
+ | (trampolines_created ? SECTION_CODE : 0)); \
+ } while (0)
+
/* Do code reading to identify a signal frame, and set the frame
state data appropriately. See unwind-dw2.c for the structs. */
diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h
index f63b7d41923..f611471900b 100644
--- a/gcc/config/rs6000/linux64.h
+++ b/gcc/config/rs6000/linux64.h
@@ -503,6 +503,14 @@ while (0)
#undef DRAFT_V4_STRUCT_RET
#define DRAFT_V4_STRUCT_RET (!TARGET_64BIT)
+#define ASM_FILE_END(FILE) \
+ do { \
+ if (! TARGET_64BIT) \
+ named_section_flags (".note.GNU-stack", \
+ SECTION_DEBUG \
+ | (trampolines_created ? SECTION_CODE : 0)); \
+ } while (0)
+
/* Do code reading to identify a signal frame, and set the frame
state data appropriately. See unwind-dw2.c for the structs. */
diff --git a/gcc/config/rs6000/ppc-asm.h b/gcc/config/rs6000/ppc-asm.h
index 0553283aa75..74e14836286 100644
--- a/gcc/config/rs6000/ppc-asm.h
+++ b/gcc/config/rs6000/ppc-asm.h
@@ -157,3 +157,8 @@ FUNC_NAME(name):
GLUE(.L,name): \
.size FUNC_NAME(name),GLUE(.L,name)-FUNC_NAME(name)
#endif
+
+#if defined __linux__ && !defined __powerpc64__
+ .section .note.GNU-stack
+ .previous
+#endif
diff --git a/gcc/config/s390/linux.h b/gcc/config/s390/linux.h
index cc496bdb63b..e4b34537a01 100644
--- a/gcc/config/s390/linux.h
+++ b/gcc/config/s390/linux.h
@@ -121,6 +121,12 @@ Boston, MA 02111-1307, USA. */
{ "link_arch31", LINK_ARCH31_SPEC }, \
{ "link_arch64", LINK_ARCH64_SPEC }, \
+#define ASM_FILE_END(FILE) \
+ do { \
+ named_section_flags (".note.GNU-stack", \
+ SECTION_DEBUG \
+ | (trampolines_created ? SECTION_CODE : 0)); \
+ } while (0)
/* Do code reading to identify a signal frame, and set the frame
state data appropriately. See unwind-dw2.c for the structs. */
diff --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h
index 63ce3b95e68..c78f1562e9a 100644
--- a/gcc/config/sparc/linux.h
+++ b/gcc/config/sparc/linux.h
@@ -259,6 +259,13 @@ do { \
#undef CTORS_SECTION_ASM_OP
#undef DTORS_SECTION_ASM_OP
+#define ASM_FILE_END(FILE) \
+ do { \
+ named_section_flags (".note.GNU-stack", \
+ SECTION_DEBUG \
+ | (trampolines_created ? SECTION_CODE : 0)); \
+ } while (0)
+
/* Do code reading to identify a signal frame, and set the frame
state data appropriately. See unwind-dw2.c for the structs. */
diff --git a/gcc/config/sparc/linux64.h b/gcc/config/sparc/linux64.h
index ecdd5204ee6..0bb1e646b1d 100644
--- a/gcc/config/sparc/linux64.h
+++ b/gcc/config/sparc/linux64.h
@@ -324,6 +324,13 @@ do { \
#undef CTORS_SECTION_ASM_OP
#undef DTORS_SECTION_ASM_OP
+#define ASM_FILE_END(FILE) \
+ do { \
+ named_section_flags (".note.GNU-stack", \
+ SECTION_DEBUG \
+ | (trampolines_created ? SECTION_CODE : 0)); \
+ } while (0)
+
/* Do code reading to identify a signal frame, and set the frame
state data appropriately. See unwind-dw2.c for the structs. */