This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] fix bugzilla 24959
- From: Eric Christopher <echristo at apple dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Geoffrey Keating <geoffk at apple dot com>
- Date: Tue, 28 Feb 2006 01:58:36 -0800
- Subject: [patch] fix bugzilla 24959
x86-darwin doesn't have an executable stack by default. There are a
couple of ways to enable it:
a) Use the -allow_stack_execute flag to the linker for nested functions
b) Use -allow_stack_execute all the time
c) Use mprotect
For the general case without adding a command line flag to turn on
nested functions (what's done on the apple branch) to give us
something to base the linker flag off of, we'll need to use mprotect
the way that it's done on the *bsd systems.
I've added it into the target directories instead of at the config/
level because the rs6000 port has a function to return the trampoline
size which isn't linked into libgcc and so we need to make sure we
use the darwin specific values for the rs6000 port. I also needed to
add an IN_LIBGCC option for TARGET_64BIT.
Tested by bootstrap and test on x86-darwin and ppc-darwin. Fixes a
pile of testcases on x86-darwin.
It isn't necessary for ppc-darwin yet, and I can #if 0 that out if we
don't want it for now.
-eric
2006-02-28 Eric Christopher <echristo@apple.com>
* config/rs6000/darwin.h (ENABLE_STACK_EXECUTE): Define.
Set up IN_LIBGCC definition of TARGET_64BIT.
* config/i386/darwin.h (ENABLE_STACK_EXECUTE): Define.
Attachment:
stack.diff.txt
Description: Text document