Questions about trampolines

Robert Dewar dewar@adacore.com
Mon Mar 14 14:36:00 GMT 2005


Marc Espie wrote:

> I don't want to dive into the glibc mess, thanks god, but if the dynamic
> linker is implemented like dynamic linkers I know, it means any binary
> using a dynamic linker that uses trampolines will lose any kind of stack
> protection on some badly designed architectures, like say, i386...

Again, be careful to distinguish between use of nested functions (which does
not require trampolines), and taking pointers to such functions (which does
require trampolines). Normal use of nested functions without taking pointers
is entirely compatible with protecting the stack.

I would say that the use of trampolines should be pretty severely deprecated
in C, and I would think that as an intermediate stage, that code that takes
the address of a nested function should get a big warning that this may be
incompatible with protected stacks, and may be inefficient.





More information about the Gcc mailing list