This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PowerPC64] Fix target/21098: .note.GNU-stack emitted
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 19 Apr 2005 16:31:16 +0930
- Subject: [PowerPC64] Fix target/21098: .note.GNU-stack emitted
Prevents needless .note.GNU-stack sections on powerpc64. The PR gives
background info on why they aren't needed and why only emitting the note
on some object files is a bad idea. Jakub's original patch to support
.note.GNU-stack had this right for powerpc64, but Zack's conversion of
ASM_FILE_END to target hooks (rev 1.44 of linux64.h) broke it.
PR target/21098
* config/rs6000/rs6000.c (rs6000_elf_end_indicate_exec_stack): New.
* config/rs6000/linux64.h (TARGET_ASM_FILE_END): Use the above.
Applying mainline as obvious. OK for 4.0.1 and 3.4?
diff -urp -xCVS -x'*~' -x'.#*' gcc-4.0-virgin/gcc/config/rs6000/linux64.h gcc-4.0/gcc/config/rs6000/linux64.h
--- gcc-4.0-virgin/gcc/config/rs6000/linux64.h 2004-12-02 12:53:05.000000000 +1030
+++ gcc-4.0/gcc/config/rs6000/linux64.h 2005-04-19 09:17:19.000000000 +0930
@@ -558,7 +561,7 @@ while (0)
#undef DRAFT_V4_STRUCT_RET
#define DRAFT_V4_STRUCT_RET (!TARGET_64BIT)
-#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
+#define TARGET_ASM_FILE_END rs6000_elf_end_indicate_exec_stack
#define TARGET_HAS_F_SETLKW
diff -urp -xCVS -x'*~' -x'.#*' gcc-4.0-virgin/gcc/config/rs6000/rs6000.c gcc-4.0/gcc/config/rs6000/rs6000.c
--- gcc-4.0-virgin/gcc/config/rs6000/rs6000.c 2005-03-31 21:02:13.000000000 +0930
+++ gcc-4.0/gcc/config/rs6000/rs6000.c 2005-04-19 09:17:21.000000000 +0930
@@ -649,6 +649,7 @@ static void rs6000_file_start (void);
static unsigned int rs6000_elf_section_type_flags (tree, const char *, int);
static void rs6000_elf_asm_out_constructor (rtx, int);
static void rs6000_elf_asm_out_destructor (rtx, int);
+static void rs6000_elf_end_indicate_exec_stack (void) ATTRIBUTE_UNUSED;
static void rs6000_elf_select_section (tree, int, unsigned HOST_WIDE_INT);
static void rs6000_elf_unique_section (tree, int);
static void rs6000_elf_select_rtx_section (enum machine_mode, rtx,
@@ -18094,6 +18149,13 @@ rs6000_elf_declare_function_name (FILE *
}
ASM_OUTPUT_LABEL (file, name);
}
+
+static void
+rs6000_elf_end_indicate_exec_stack (void)
+{
+ if (TARGET_32BIT)
+ file_end_indicate_exec_stack ();
+}
#endif
#if TARGET_XCOFF
--
Alan Modra
IBM OzLabs - Linux Technology Centre