This is the mail archive of the
mailing list for the GCC project.
a question about trampolines and non-exec stacks
- From: Marc Espie <espie at nerim dot net>
- To: gcc at gcc dot gnu dot org
- Date: Thu, 29 Aug 2002 20:01:42 +0200
- Subject: a question about trampolines and non-exec stacks
- Reply-to: espie at nerim dot net
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 ?