Re: RTTI and exceptions between plugins (solution)
Re: RTTI and exceptions between plugins (solution)
- Subject: Re: RTTI and exceptions between plugins (solution)
- From: Steve Checkoway <email@hidden>
- Date: Tue, 07 Feb 2006 19:37:25 -0800
Steve Baxter wrote:
NSLINKMODULE_OPTION_PRIVATE appears to have the same behaviour as
RTLD_LOCAL (as far as I can tell, dlopen() actually calls
NSLinkModule()). This will prevent symbols being resolved properly
across plugins if you use CFBundle. This may be a bug in CFBundle, I'm
not sure though (sometimes you might want private visibility for
plugins). Possibly the bug is that CFBundle does not give you the choice.
I would say that this is a bug.
A solution to this is to call dlopen() on the bundle executable with
RTLD_GLOBAL before calling CFBundleLoadExecutable(). This forces the
dylib to be loaded with global visibility.
OK, hope that helps someone. It's taken me a long time to figure this
out for our application! If anyone can think of any simplifications or
anything I've missed, I'd be keen to hear them!
That is very good to know. The only issue that I can think of is dlopen
was added in 10.3 (thank you Jorge Acereda and Peter O'Gorman!). If
you're targeting any OS before that, it seems that you should call
NSLinkModule() before calling CFBundleLoadExecutable() rather than dlopen().
- Steve
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden