From a49af505567f853bccdbf75bd8daac87f5250df4 Mon Sep 17 00:00:00 2001 From: Pedro Martelletto Date: Sat, 28 Oct 2006 03:30:32 +0000 Subject: Make stack executable when doing trampolines on macppc Okay espie@, kettenis@ --- gnu/usr.bin/gcc/gcc/config/rs6000/openbsd.h | 3 +++ gnu/usr.bin/gcc/gcc/config/rs6000/rs6000.c | 7 +++++++ 2 files changed, 10 insertions(+) (limited to 'gnu/usr.bin/gcc') diff --git a/gnu/usr.bin/gcc/gcc/config/rs6000/openbsd.h b/gnu/usr.bin/gcc/gcc/config/rs6000/openbsd.h index 17cb85e46bd..25e92a18bec 100644 --- a/gnu/usr.bin/gcc/gcc/config/rs6000/openbsd.h +++ b/gnu/usr.bin/gcc/gcc/config/rs6000/openbsd.h @@ -127,3 +127,6 @@ Boston, MA 02111-1307, USA. */ #undef WCHAR_TYPE_SIZE #define WCHAR_TYPE_SIZE 32 +#undef TRAMPOLINE_SIZE +#define TRAMPOLINE_SIZE 40 + diff --git a/gnu/usr.bin/gcc/gcc/config/rs6000/rs6000.c b/gnu/usr.bin/gcc/gcc/config/rs6000/rs6000.c index 0ba733942fa..991b81e1848 100644 --- a/gnu/usr.bin/gcc/gcc/config/rs6000/rs6000.c +++ b/gnu/usr.bin/gcc/gcc/config/rs6000/rs6000.c @@ -12510,6 +12510,13 @@ rs6000_initialize_trampoline (addr, fnaddr, cxt) break; } + /* Call __enable_execute_stack after writing onto the stack to make sure + the stack address is accessible. */ +#ifdef TRANSFER_FROM_TRAMPOLINE + emit_library_call (gen_rtx (SYMBOL_REF, Pmode, "__enable_execute_stack"), + LCT_NORMAL, VOIDmode, 1, addr, Pmode); +#endif + return; } -- cgit v1.2.3