Re:Sorry state of dynamic libraries on Linux
by saurik on Monday September 17, 2012 @06:23AM
(#4531904)
Mach-O, the executable format used by Darwin (and hence Mac OS X) also has that feature, where it is called "two-level namespaces".
[ Parent
| on HN ]
Re:Sorry state of dynamic libraries on Linux
by quotemstr on Monday September 17, 2012 @06:38AM
(#4531950)
Sure. Windows has one additional feature that dyld lacks, however: activation contexts[1]. You can have in the same process modAv1!foo and modAv2!foo even if modAv1 comes from c:\foo\moda.dll and modAv2 comes from c:\bar\moda.dll. (Note that the module filenames are identical.)
[1] http://msdn.microsoft.com/en-us/library/windows/desktop/aa37...
Re:Sorry state of dynamic libraries on Linux
by saurik on Monday September 17, 2012 @11:34AM
(#4533021)
Mach-O's two-level namespace does not work based on the one-level filename of the library on disk: it works based on the canonical full path stored in the LC_ID_DYLIB load command of the library; these names should contain the version number of the library, and so provides the functionality that you seem to be referencing (although I am very rusty at Windows and never knew how things worked at this particular level, so I'm working off of the short paragraph you just linked).
As an example:
/usr/lib/libreadline.dylib is actually /usr/lib/libedit.2.dylib
/System/Library/Frameworks/Python.framework/Python is actually /System/Library/Frameworks/Python.framework/Versions/2.6/Python
You can thereby have symbols linked from both /System/Library/Frameworks/Python.framework/Versions/2.5/Python and /System/Library/Frameworks/Python.framework/Versions/2.6/Python. "(Note that the module filenames are identical.)"