# DP: Add .note.GNU-stack sections for gcc's crt files, libffi and boehm-gc
# DP: Taken from FC.

gcc/

2004-09-20  Jakub Jelinek  <jakub@redhat.com>

	* config/rs6000/ppc-asm.h: Add .note.GNU-stack section also
	on ppc64-linux.

	* config/ia64/lib1funcs.asm: Add .note.GNU-stack section on
	ia64-linux.
	* config/ia64/crtbegin.asm: Likewise.
	* config/ia64/crtend.asm: Likewise.
	* config/ia64/crti.asm: Likewise.
	* config/ia64/crtn.asm: Likewise.

2004-05-14  Jakub Jelinek  <jakub@redhat.com>

	* config/ia64/linux.h (TARGET_ASM_FILE_END): Define.

boehm-gc/

2005-02-08  Jakub Jelinek  <jakub@redhat.com>

	* ia64_save_regs_in_stack.s: Moved to...
	* ia64_save_regs_in_stack.S: ... this.  Add .note.GNU-stack
	on Linux.

libffi/

2007-05-11  Daniel Jacobowitz  <dan@debian.org>

	* src/arm/sysv.S: Fix ARM comment marker.

2005-02-08  Jakub Jelinek  <jakub@redhat.com>

	* src/alpha/osf.S: Add .note.GNU-stack on Linux.
	* src/s390/sysv.S: Likewise.
	* src/powerpc/linux64.S: Likewise.
	* src/powerpc/linux64_closure.S: Likewise.
	* src/powerpc/ppc_closure.S: Likewise.
	* src/powerpc/sysv.S: Likewise.
	* src/x86/unix64.S: Likewise.
	* src/x86/sysv.S: Likewise.
	* src/sparc/v8.S: Likewise.
	* src/sparc/v9.S: Likewise.
	* src/m68k/sysv.S: Likewise.
	* src/ia64/unix.S: Likewise.
	* src/arm/sysv.S: Likewise.

---
 boehm-gc/ia64_save_regs_in_stack.s   |   12 ------------
 gcc/config/ia64/crtbegin.asm         |    4 ++++
 gcc/config/ia64/crtend.asm           |    4 ++++
 gcc/config/ia64/crti.asm             |    4 ++++
 gcc/config/ia64/crtn.asm             |    4 ++++
 gcc/config/ia64/lib1funcs.asm        |    4 ++++
 gcc/config/ia64/linux.h              |    2 ++
 gcc/config/rs6000/ppc-asm.h          |    2 +-
 libffi/src/ia64/unix.S               |    4 ++++
 libffi/src/powerpc/linux64.S         |    4 ++++
 libffi/src/powerpc/linux64_closure.S |    4 ++++
 11 files changed, 35 insertions(+), 13 deletions(-)

--- a/src/boehm-gc/ia64_save_regs_in_stack.s
+++ /dev/null
@@ -1,12 +0,0 @@
-        .text
-        .align 16
-        .global GC_save_regs_in_stack
-        .proc GC_save_regs_in_stack
-GC_save_regs_in_stack:
-        .body
-        flushrs
-        ;;
-        mov r8=ar.bsp
-        br.ret.sptk.few rp
-        .endp GC_save_regs_in_stack
-
--- /dev/null
+++ b/src/boehm-gc/ia64_save_regs_in_stack.S
@@ -0,0 +1,15 @@
+        .text
+        .align 16
+        .global GC_save_regs_in_stack
+        .proc GC_save_regs_in_stack
+GC_save_regs_in_stack:
+        .body
+        flushrs
+        ;;
+        mov r8=ar.bsp
+        br.ret.sptk.few rp
+        .endp GC_save_regs_in_stack
+
+#ifdef __linux__
+	.section .note.GNU-stack,"",@progbits
+#endif
--- a/src/gcc/config/ia64/crtbegin.asm
+++ b/src/gcc/config/ia64/crtbegin.asm
@@ -252,3 +252,7 @@
 .weak __cxa_finalize
 #endif
 .weak _Jv_RegisterClasses
+
+#ifdef __linux__
+.section .note.GNU-stack; .previous
+#endif
--- a/src/gcc/config/ia64/crtend.asm
+++ b/src/gcc/config/ia64/crtend.asm
@@ -119,3 +119,7 @@
 
 	br.ret.sptk.many rp
 	.endp __do_global_ctors_aux
+
+#ifdef __linux__
+.section .note.GNU-stack; .previous
+#endif
--- a/src/gcc/config/ia64/crti.asm
+++ b/src/gcc/config/ia64/crti.asm
@@ -51,3 +51,7 @@
 	.body
 
 # end of crti.asm
+
+#ifdef __linux__
+.section .note.GNU-stack; .previous
+#endif
--- a/src/gcc/config/ia64/crtn.asm
+++ b/src/gcc/config/ia64/crtn.asm
@@ -41,3 +41,7 @@
 	br.ret.sptk.many b0
 
 # end of crtn.asm
+
+#ifdef __linux__
+.section .note.GNU-stack; .previous
+#endif
--- a/src/gcc/config/ia64/lib1funcs.asm
+++ b/src/gcc/config/ia64/lib1funcs.asm
@@ -793,3 +793,7 @@
 	.endp __floattitf
 #endif
 #endif
+
+#ifdef __linux__
+.section .note.GNU-stack; .previous
+#endif
--- a/src/gcc/config/ia64/linux.h
+++ b/src/gcc/config/ia64/linux.h
@@ -29,6 +29,8 @@
 
 #define TARGET_VERSION fprintf (stderr, " (IA-64) Linux");
 
+#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
+
 /* This is for -profile to use -lc_p instead of -lc.  */
 #undef CC1_SPEC
 #define CC1_SPEC "%{profile:-p} %{G*}"
--- a/src/gcc/config/rs6000/ppc-asm.h
+++ b/src/gcc/config/rs6000/ppc-asm.h
@@ -352,7 +352,7 @@
 #endif
 #endif
 
-#if defined __linux__ && !defined __powerpc64__
+#if defined __linux__
 	.section .note.GNU-stack
 	.previous
 #endif
