On Sun, 2007-07-22 at 18:30 +0100, Ralph Corderoy wrote: > Hi Peter, > > > > I investigated a problem on the llvmdev mailing list where someone was > > > trying to find the value of a symbol that has an address of 0. > > > > > > $ nm /System/Library/Frameworks/Foundation.framework/Foundation | > > > > grep .objc_class_name_NSAutoreleasePool > > > 00000000 A .objc_class_name_NSAutoreleasePool > > > $ > > > > It is not possible to lookup this symbol on Mac OS X with dlsym() > > because it does not have an underscore prefix. > > I don't know if dlsym() is being used on Mac OS X, I just went looking > there because I understand it behaviour.
Yes, dlsym is used on Mac OS X 10.3 and later, and it will return a symbol not found error (and set dlerror) when you call dlsym(h,".objc_foo") because it will look for _.objc_foo and not find it. This is something that the llvm people will have to figure out on their end. See the manpages for Mac OS X's dlsym at http://developer.apple.com/documentation/Darwin/Reference/ManPages/man3/dlsym.3.html for confirmation. > > Thanks, my dlsym(3) on Ubuntu Linux warns me it can return NULL when the > found symbol has an address of 0 and to use dlerror() twice to find out > what really happened. Yes, I agree with your analysis, lt_dlerror should return NULL if dlerror() would have done so. If you want to send a patch to do this (for HEAD - a quite different libltdl), please do so, if not, I guess it's up to me :-) I don't believe that changing this behavior in ltdl will actually help in the llvm objc case though, sorry. Peter _______________________________________________ Bug-libtool mailing list Bug-libtool@gnu.org http://lists.gnu.org/mailman/listinfo/bug-libtool