summaryrefslogtreecommitdiffstats
path: root/contrib/gcc
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2011-01-14 11:31:22 +0000
committerkib <kib@FreeBSD.org>2011-01-14 11:31:22 +0000
commit683e7808763778fc3385cac28e91f35d71791d2b (patch)
tree25ee8afe90681f04c354d468f704ef11bdbae7f4 /contrib/gcc
parent019965af3d88e9036cfdad4fc96823ae27bc890b (diff)
downloadFreeBSD-src-683e7808763778fc3385cac28e91f35d71791d2b.zip
FreeBSD-src-683e7808763778fc3385cac28e91f35d71791d2b.tar.gz
Configure gcc to emit .note.GNU-stack for both 32 and 64 bits PowerPC.
Mark gcc-provided asm files as not requiring executable stack. It seems that non-FreeBSD ABIs for powerpc64 claim stack non-executable. Due to this, rs6000_elf_end_indicate_exec_stack() only emit the note for 32 bit target. I decided not to change FreeBSD ABI and patch emit the notes for both variants. Reviewed and tested by: nwhitehorn
Diffstat (limited to 'contrib/gcc')
-rw-r--r--contrib/gcc/config/rs6000/crtsavres.asm2
-rw-r--r--contrib/gcc/config/rs6000/freebsd.h4
-rw-r--r--contrib/gcc/config/rs6000/rs6000.c2
-rw-r--r--contrib/gcc/config/rs6000/tramp.asm2
4 files changed, 9 insertions, 1 deletions
diff --git a/contrib/gcc/config/rs6000/crtsavres.asm b/contrib/gcc/config/rs6000/crtsavres.asm
index 498759d..bda8b54 100644
--- a/contrib/gcc/config/rs6000/crtsavres.asm
+++ b/contrib/gcc/config/rs6000/crtsavres.asm
@@ -305,3 +305,5 @@ FUNC_END(_restgpr_15_x)
FUNC_END(_restgpr_14_x)
#endif
+
+ .section .note.GNU-stack,"",%progbits
diff --git a/contrib/gcc/config/rs6000/freebsd.h b/contrib/gcc/config/rs6000/freebsd.h
index 34c93b8..ca06d20 100644
--- a/contrib/gcc/config/rs6000/freebsd.h
+++ b/contrib/gcc/config/rs6000/freebsd.h
@@ -230,6 +230,8 @@
}
#endif
+#define TARGET_ASM_FILE_END rs6000_elf_end_indicate_exec_stack
+
/* FreeBSD doesn't support saving and restoring 64-bit regs with a 32-bit
kernel. This is supported when running on a 64-bit kernel with
COMPAT_FREEBSD32, but tell GCC it isn't so that our 32-bit binaries
@@ -242,3 +244,5 @@
#define PROFILE_HOOK(LABEL) \
do { if (TARGET_64BIT) output_profile_hook (LABEL); } while (0)
+#undef NEED_INDICATE_EXEC_STACK
+#define NEED_INDICATE_EXEC_STACK 1
diff --git a/contrib/gcc/config/rs6000/rs6000.c b/contrib/gcc/config/rs6000/rs6000.c
index 6670a20..2c60fdf 100644
--- a/contrib/gcc/config/rs6000/rs6000.c
+++ b/contrib/gcc/config/rs6000/rs6000.c
@@ -18426,7 +18426,7 @@ rs6000_elf_declare_function_name (FILE *file, const char *name, tree decl)
static void
rs6000_elf_end_indicate_exec_stack (void)
{
- if (TARGET_32BIT)
+ if (NEED_INDICATE_EXEC_STACK)
file_end_indicate_exec_stack ();
}
#endif
diff --git a/contrib/gcc/config/rs6000/tramp.asm b/contrib/gcc/config/rs6000/tramp.asm
index 63dacc0..013cac3 100644
--- a/contrib/gcc/config/rs6000/tramp.asm
+++ b/contrib/gcc/config/rs6000/tramp.asm
@@ -115,3 +115,5 @@ FUNC_START(__trampoline_setup)
FUNC_END(__trampoline_setup)
#endif
+
+ .section .note.GNU-stack,"",%progbits
OpenPOWER on IntegriCloud