Re: dlsym interposition question
Re: dlsym interposition question
- Subject: Re: dlsym interposition question
- From: Stephen Checkoway <email@hidden>
- Date: Sun, 06 Oct 2013 20:08:47 -0400
On Oct 6, 2013, at 6:29 PM, Ariel Burton <email@hidden> wrote:
> This also doesn't quite do what I'm after.
>
> How are you loading libfoo.dylib? Are you linking it with your
> main program? Are you loading it with dlopen? Or are you
> perlaoding it with DYLD_INSERT_LIBRARIES?
Sorry, I didn't pay close enough attention to your actual question. Looking through the source for dyld, it isn't obvious how to avoid the interposed symbols:
From <http://www.opensource.apple.com/source/dyld/dyld-210.2.3/src/dyldAPIs.cpp> and <http://www.opensource.apple.com/source/dyld/dyld-210.2.3/src/ImageLoaderMachO.cpp>, dlsym() calls ImageLoaderMachO::getExportedSymbolAddress() which calls ImageLoaderMachO::getSymbolAddress() which checks the list of interposed symbols.
Similarly, the deprecated NSAddressOfSymbol() uses ImageLoaderMachO::getExportedSymbolAddress().
You could use the functions and data structures in mach-o/*.h to parse the various images and get the interposed symbol addresses, I suppose.
--
Stephen Checkoway
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden