On 06/26/2017 03:13 AM, Segher Boessenkool wrote: > On Sun, Jun 25, 2017 at 06:27:38PM -0400, Jeffrey Walton wrote: >> It may be more than a minor bug. The trampoline often requires an >> executable stack, and that's usually a SDLC violation. > > Nested functions often do not need trampolines, they just need an > environment pointer (the static chain). Trampolines are only needed > if you pass around the address of a nested function, and it needs one > of its parents frames, and your function pointers do not hold space > for an environment pointer already. Trampolines do not need an > executable stack, it's just the traditional way to implement them > (and a very convenient and on most archs very efficient way). Right. Furthermore, GCC now has fairly generic code to construct function descriptors on the fly which eliminates the need for executable stack trampolines. See Eric B's changes from Oct. 2016. jeff