Commit 978e411f by Carlos O'Donell Committed by Paul Brook

linux-elf.h (NEED_INDICATE_EXEC_STACK): Define as 1.

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
parent 50f606a6
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> 2006-11-02 Ben Elliston <bje@au.ibm.com>
* tree-ssa.c (warn_uninit): Use expand_location variables for * tree-ssa.c (warn_uninit): Use expand_location variables for
......
...@@ -14417,6 +14417,10 @@ arm_file_end (void) ...@@ -14417,6 +14417,10 @@ arm_file_end (void)
{ {
int regno; int regno;
if (NEED_INDICATE_EXEC_STACK)
/* Add .note.GNU-stack. */
file_end_indicate_exec_stack ();
if (! thumb_call_reg_needed) if (! thumb_call_reg_needed)
return; return;
......
...@@ -2591,4 +2591,10 @@ enum arm_builtins ...@@ -2591,4 +2591,10 @@ enum arm_builtins
ARM_BUILTIN_MAX 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 */ #endif /* ! GCC_ARM_H */
...@@ -31,6 +31,12 @@ ...@@ -31,6 +31,12 @@
# the executable file might be covered by the GNU General Public License. # 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 # This file just make a stack frame for the contents of the .fini and
# .init sections. Users may put any desired instructions in those # .init sections. Users may put any desired instructions in those
# sections. # sections.
......
...@@ -31,6 +31,12 @@ ...@@ -31,6 +31,12 @@
# the executable file might be covered by the GNU General Public License. # 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 # This file just makes sure that the .fini and .init sections do in
# fact return. Users may put any desired instructions in those sections. # fact return. Users may put any desired instructions in those sections.
# This file is the last thing linked into any executable. # This file is the last thing linked into any executable.
......
...@@ -27,6 +27,13 @@ You should have received a copy of the GNU General Public License ...@@ -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 along with this program; see the file COPYING. If not, write to
the Free Software Foundation, 51 Franklin Street, Fifth Floor, the Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */ 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. */ /* We need to know what prefix to add to function names. */
......
...@@ -26,6 +26,12 @@ ...@@ -26,6 +26,12 @@
the Free Software Foundation, 51 Franklin Street, Fifth Floor, the Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */ 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__ #ifndef __symbian__
#include "lib1funcs.asm" #include "lib1funcs.asm"
......
...@@ -104,3 +104,7 @@ ...@@ -104,3 +104,7 @@
/* The GNU/Linux profiler needs a frame pointer. */ /* The GNU/Linux profiler needs a frame pointer. */
#define SUBTARGET_FRAME_POINTER_REQUIRED current_function_profile #define SUBTARGET_FRAME_POINTER_REQUIRED current_function_profile
/* Add .note.GNU-stack. */
#undef NEED_INDICATE_EXEC_STACK
#define NEED_INDICATE_EXEC_STACK 1
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment