realbasic-plugins
[Top] [All Lists]

Re: dylibs, function loading and getting the wrong one called

To: REALbasic Plugins <realbasic-plugins at lists dot realsoftware dot com>
Subject: Re: dylibs, function loading and getting the wrong one called
From: Jonathan Johnson <jonj at realsoftware dot com>
Date: Sun, 10 Dec 2006 15:08:13 -0600
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-plugins at lists dot realsoftware dot com
References: <FF8466A2-36B7-4475-B1D8-3CAA6CDFEC1E at great-white-software dot com> <9098A1BD-4056-438C-938E-02FCCE3D16B5 at realsoftware dot com> <66EFC441-94D9-4A82-91DA-A3AB94F1A193 at great-white-software dot com> <5AE32349-26CB-474A-91A3-4BF496A55B41 at realsoftware dot com> <F12AC1FD-8A98-47B6-B85F-FD4FB81DEE33 at mac dot com>

On Dec 9, 2006, at 9:35 AM, Alfred Van Hoek wrote:


On Oct 25, 2006, at 11:32 AM, Jonathan Johnson wrote:

Well, here's the issue. It turns out this is the problem. We use NSAddImage and NSLookupSymbolInImage because dyld isn't available in anything prior to 10.3. NSAddImage has no notion of adding an image to a private namespace, even if two level namespaces are used. So, whichever library loads the symbol first will be used for the rest of the run.

We can use dyld on 10.3 and higher though, so if possible, please file a report against this. One workaround might be to package the dylib into a bundle and declare against the bundle. This should work.


Does this still holds? I mean it is an issue that I have. If REALbasic is adding an image to a private namespace, our code will fail to add it's own image, and when we call a symbol, it is the symbol owned by the rbframework that will crash our app. (Using the current RB version in 10.4.8).

Yes and no. For soft declares, it still does matter. For plugins, you can build your plugin as a Bundle instead of a Dylib (not an actual folder bundle, just a Mach-O bundle). As of 2006r4 we support these library types, and back to 10.1 they have a private namespace.

HTH,
Jon


--
Jonathan Johnson
jonj at realsoftware dot com
REAL Software, Inc.


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>