tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Tests requiring MD hooks



> On Jul 10, 2011, at 7:58 PM, Valeriy E. Ushakov wrote:
> 
> >> That seems to be a bit tricky to write in a portable way: testing --x
> >> right in memory pages requires to put/copy some payload in a page and
> >> call it.
> > 
> > dlopen something, find a function with dlsym, disable exec on that
> > page and call the function.  Catch SIGSEGV, check siginfo.  mprotect
> > it back and call the function again.
> 
> doesn't work when the target uses function descriptors.

You mean "fat" function pointers like e.g. ia64?  It's easier to
special case couple of arches where we introduce a bit of special case
MI code to deconstruct the fat function pointer to get the code
address, than to write asm code for all arches.  Or?

-uwe


Home | Main Index | Thread Index | Old Index