Constant trampoline pages
Richard Henderson
rth@redhat.com
Fri Jan 23 17:54:00 GMT 2015
The current iOS support to have a page of allocated trampolines that gets
remapped as needed, rather than writing and flushing them, makes me wonder if
we shouldn't do the same thing for *all* targets.
Years ago I wrote a small library to demonstrate this on Linux. The idea was
to be able to use these trampolines for nested functions within gcc. That
never went anywhere because people were more interested in avoiding trampolines
entirely than making them work better.
But for libffi it could work better than our current workarounds for selinux.
The source for my trampoline library can be found at
git://github.com/rth7680/tramp.git
Possibly the most interesting part is the tramp-raw.c file, where I map back
from an address in virtual memory back to a filename + file offset. At least
for elf hosts with dl_iterate_phdr, which is Linux plus recent BSDs afaik.
Thoughts?
r~
More information about the Libffi-discuss
mailing list