From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marc Espie To: gcc@gcc.gnu.org Subject: a question about trampolines and non-exec stacks Date: Thu, 29 Aug 2002 11:01:00 -0000 Message-id: <20020829180142.GA6209@tetto.liafa.jussieu.fr> X-SW-Source: 2002-08/msg01914.html OpenBSD moved to a non-exec stacks on a few arches recently... as a result, trampolines no longer work. Looking through gcc's code, I see a few instances of trampoline code that does more or less the right thing. - I like m68k's FINALIZE_TRAMPOLINE code. Any issue in adding the same hook to other arches, e.g., i386 ? - I'm a bit lost as to TRAMPOLINE_SIZE... Is it supposed to be exact, or should it be conservative ? At a guess, if I add some emit_library_call to make the stack executable around the area, I believe the trampoline size ought to be adjusted upwards, right ? - where to stick a make_stack_executable function ? I see that nextstep has some explicit code in libgcc2.c, whereas solaris2 goes through TRANSFER_FROM_TRAMPOLINE... but it looks to me like either solaris2 is wrong or the description of TRANSFER_FROM_TRAMPOLINE is. Looking further, basically, things either go through the nextstep model (FINALIZE_TRAMPOLINE code) or through some TRANSFER_FROM_TRAMPOLINE code that calls a make_stack_executable function... I think the FINALIZE_TRAMPOLINE approach is cleaner. What should I do ?