Re: dlsym interposition question
On Oct 6, 2013, at 6:29 PM, Ariel Burton <ariel.burton@roguewave.com> 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 (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.app... This email sent to site_archiver@lists.apple.com
participants (1)
-
Stephen Checkoway