crtend*: Add GNU_STACK note

Add a GNU_STACK marker to crtend* files. This tells the linker
that these files do not require an executable stack.

When linking, a missing GNU_STACK marker in any .o file can prevent
the compiler from automatically marking the final executable as NX
safe (executable stack not required).  In Android, we normally work
around this by adding -Wa,--noexecstack / -Wl,-z,noexecstack.
For files like crtend.S / crtend_so.S, which are included in every
executable / shared library, it's better to add the GNU_STACK note
directly to the assembly file.  This allows the compiler to
automatically mark the final executable as NX safe without any
special command line options.


Change-Id: I07bd058f9f60ddd8b146e0fb36ba26ff84c0357d
diff --git a/libc/arch-arm/bionic/crtend.S b/libc/arch-arm/bionic/crtend.S
index 2f3b1ed..7196fc1 100644
--- a/libc/arch-arm/bionic/crtend.S
+++ b/libc/arch-arm/bionic/crtend.S
@@ -38,3 +38,6 @@
 	.section .ctors, "aw"
 	.long 0
+#if defined(__linux__) && defined(__ELF__)
+	.section .note.GNU-stack,"",%progbits
diff --git a/libc/arch-arm/bionic/crtend_so.S b/libc/arch-arm/bionic/crtend_so.S
index a1281c4..0cb9947 100644
--- a/libc/arch-arm/bionic/crtend_so.S
+++ b/libc/arch-arm/bionic/crtend_so.S
@@ -36,3 +36,6 @@
 	.section .fini_array, "aw"
 	.long 0
+#if defined(__linux__) && defined(__ELF__)
+	.section .note.GNU-stack,"",%progbits