This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: trampolines: __disable_execute_stack ?
- From: Richard Henderson <rth at redhat dot com>
- To: Zack Weinberg <zack at codesourcery dot com>
- Cc: espie at nerim dot net, gcc at gcc dot gnu dot org
- Date: Tue, 18 Jan 2005 11:43:03 -0800
- Subject: Re: trampolines: __disable_execute_stack ?
- References: <20050118112146.GA3526@tetto.home> <878y6q7fnr.fsf@codesourcery.com>
On Tue, Jan 18, 2005 at 10:31:20AM -0800, Zack Weinberg wrote:
> I don't see why not. The appropriate point to call it would be when
> the function that created the trampoline returns, and you could use
> the WITH_CLEANUP_EXPR/ CLEANUP_POINT_EXPR mechanism to guarantee that
> this would happen. (Think of the trampoline object as a C++ object
> with a destructor.)
Because non-local goto doesn't respect that mechanism.
The only thing I've thought of before that would have a chance of
working is an external trampoline manager that garbage collects
based on the stack base/depth. With the advantage that it would
be explicitly allocating anon mmap pages with the X bit set.
On the other hand, my feeling is that trampolines are either
non-existant in the application, or common. For the former, we
never enable the X bit; for the later it would be a waste of time
to turn it off afterward. Thus I am more or less happy with the
PT_GNU_STACK solution we currently have.
r~