public inbox for libffi-discuss@sourceware.org
 help / color / mirror / Atom feed
* Constant trampoline pages
@ 2015-01-23 17:54 Richard Henderson
  2015-01-26 10:02 ` Andrew Haley
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Henderson @ 2015-01-23 17:54 UTC (permalink / raw)
  To: libffi-discuss

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~

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-01-26 17:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-23 17:54 Constant trampoline pages Richard Henderson
2015-01-26 10:02 ` Andrew Haley
2015-01-26 17:31   ` Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).