linux-elf.h (NEED_INDICATE_EXEC_STACK): Define as 1.
authorCarlos O'Donell <carlos@codesourcery.com>
Fri, 3 Nov 2006 00:59:32 +0000 (00:59 +0000)
committerPaul Brook <pbrook@gcc.gnu.org>
Fri, 3 Nov 2006 00:59:32 +0000 (00:59 +0000)
2006-11-02  Carlos O'Donell  <carlos@codesourcery.com>

gcc/
* config/arm/linux-elf.h (NEED_INDICATE_EXEC_STACK): Define as 1.
* arm.c (arm_file_end): If NEED_INDICATE_EXEC_STACK call
file_end_indicate_exec_stack.
* arm.h [!NEED_INDICATE_EXEC_STACK] (NEED_INIDCATE_EXEC_STACK):
Define as 0.
* lib1funcs.asm [__ELF__ && __linux__]: Emit .note.GNU-stack section
for a non-executable stack.
* crti.asm: Likewise.
* crtn.asm: Likewise.
* libunwind.S: Likewise.

From-SVN: r118445

gcc/ChangeLog
gcc/config/arm/arm.c
gcc/config/arm/arm.h
gcc/config/arm/crti.asm
gcc/config/arm/crtn.asm
gcc/config/arm/lib1funcs.asm
gcc/config/arm/libunwind.S
gcc/config/arm/linux-elf.h

index 189604c5c398690ab5969d7772dd7cb59e9b28b4..db5ad31fa9d6a890dd5d01a896e1f1e9e54ec5fd 100644 (file)
@@ -1,3 +1,16 @@
+2006-11-02  Carlos O'Donell  <carlos@codesourcery.com>
+
+       * config/arm/linux-elf.h (NEED_INDICATE_EXEC_STACK): Define as 1.
+       * arm.c (arm_file_end): If NEED_INDICATE_EXEC_STACK call 
+       file_end_indicate_exec_stack. 
+       * arm.h [!NEED_INDICATE_EXEC_STACK] (NEED_INIDCATE_EXEC_STACK): 
+       Define as 0.
+       * lib1funcs.asm [__ELF__ && __linux__]: Emit .note.GNU-stack section
+       for a non-executable stack.
+       * crti.asm: Likewise.
+       * crtn.asm: Likewise.
+       * libunwind.S: Likewise. 
+
 2006-11-02  Ben Elliston  <bje@au.ibm.com>
 
        * tree-ssa.c (warn_uninit): Use expand_location variables for
index 7c82fcf403636986aae949df6134c1fd273b0d3e..bbf4863a7adfff80eedceca1d069959c12d698aa 100644 (file)
@@ -14417,6 +14417,10 @@ arm_file_end (void)
 {
   int regno;
 
+  if (NEED_INDICATE_EXEC_STACK)
+    /* Add .note.GNU-stack.  */
+    file_end_indicate_exec_stack ();
+
   if (! thumb_call_reg_needed)
     return;
 
index 26d397726dbe6994abd943d0483a3025eeeda443..beb222263ab156d95410a099d37a2b67ad774e41 100644 (file)
@@ -2591,4 +2591,10 @@ enum arm_builtins
 
   ARM_BUILTIN_MAX
 };
+
+/* Do not emit .note.GNU-stack by default.  */
+#ifndef NEED_INDICATE_EXEC_STACK
+#define NEED_INDICATE_EXEC_STACK       0
+#endif
+
 #endif /* ! GCC_ARM_H */
index 166a3ce34e8cca3dde9889e927b018e2876df71b..6f0acd199e0309854edb32d113eb080d5f281aea 100644 (file)
 #    the executable file might be covered by the GNU General Public License.
 # 
 
+/* An executable stack is *not* required for these functions.  */
+#if defined(__ELF__) && defined(__linux__)
+.section .note.GNU-stack,"",%progbits
+.previous
+#endif
+
 # This file just make a stack frame for the contents of the .fini and
 # .init sections.  Users may put any desired instructions in those
 # sections.
index 360afae9753bea152d293e9edccf106290d32f80..36c417d7ddef69b9322bcab770ff8663ef2b40ae 100644 (file)
 #    the executable file might be covered by the GNU General Public License.
 # 
 
+/* An executable stack is *not* required for these functions.  */
+#if defined(__ELF__) && defined(__linux__)
+.section .note.GNU-stack,"",%progbits
+.previous
+#endif
+
 # This file just makes sure that the .fini and .init sections do in
 # fact return.  Users may put any desired instructions in those sections.
 # This file is the last thing linked into any executable.
index 9245b3ca0c0d281afe5ff136746ac8db4addf1fc..93c0df824a870cdadf43b3ad051124d9b3a07004 100644 (file)
@@ -27,6 +27,13 @@ You should have received a copy of the GNU General Public License
 along with this program; see the file COPYING.  If not, write to
 the Free Software Foundation, 51 Franklin Street, Fifth Floor,
 Boston, MA 02110-1301, USA.  */
+
+/* An executable stack is *not* required for these functions.  */
+#if defined(__ELF__) && defined(__linux__)
+.section .note.GNU-stack,"",%progbits
+.previous
+#endif
+
 /* ------------------------------------------------------------------------ */
 
 /* We need to know what prefix to add to function names.  */
index 06e13107d2ab5a474ea696af626c260ebede31e8..f53a20232b81f013c457d950e6299333383ef94e 100644 (file)
    the Free Software Foundation, 51 Franklin Street, Fifth Floor,
    Boston, MA 02110-1301, USA.  */
 
+/* An executable stack is *not* required for these functions.  */
+#if defined(__ELF__) && defined(__linux__)
+.section .note.GNU-stack,"",%progbits
+.previous
+#endif
+
 #ifndef __symbian__
 
 #include "lib1funcs.asm"
index acb13cd013f37c24d648d13b00fe43edd5f38042..d4e83514206971efe8ad2bd589e4b8a1bfd4af1c 100644 (file)
 
 /* The GNU/Linux profiler needs a frame pointer.  */
 #define SUBTARGET_FRAME_POINTER_REQUIRED current_function_profile
+
+/* Add .note.GNU-stack.  */
+#undef NEED_INDICATE_EXEC_STACK
+#define NEED_INDICATE_EXEC_STACK       1