RTLD_NEXT does not look into INSERTED_LIBRARIES
RTLD_NEXT does not look into INSERTED_LIBRARIES
- Subject: RTLD_NEXT does not look into INSERTED_LIBRARIES
- From: Carlos Sánchez de La Lama <email@hidden>
- Date: Fri, 10 Feb 2012 09:48:30 +0100
Hi all,
I am interposing some functions between an application and a framework, having two different interposing dynamic libraries: an enhancer and a profiler, where both define the same functions. They work separately, meaning:
application -> framework (normal case, works of course).
application -> enhancer -> framework (interposing the enhancer, works).
application -> profiler -> framework (interposing the profiler, works).
However, when I try to interpose both (enhancing and profiling), like in:
application -> enhancer -> profiler -> framework
by using DYLD_INSERT_LIBRARIES="enhancer:profiler", it does not work correctly. When using RTLD_NEXT on dlsym to access next symbol, enhancer goes directly for framework symbols even when the profiler was forcedly inserter after it. For clarity, I am also forcing FLAT_NAMESPACE.
My guess is RTLD_NEXT looks for linked dynamic libraries only, does not look into runtime inserted ones. I can solve my problem linking the enhancer against the profiler when I want to profile, but (if possible) I would prefer not to need that so I can interpose each "piece" as needed with no need to recompile/relink.
Does anybody know if my guess is correct, or am I missing something?
Thanks and best regards,
Carlos
_______________________________________________
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