This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

a question about trampolines and non-exec stacks

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
that calls a make_stack_executable function... I think the
FINALIZE_TRAMPOLINE approach is cleaner.

What should I do ?

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]