On Sun, 2007-07-22 at 11:01 +0100, Ralph Corderoy wrote:
> Hi,
> 
> 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
>     $
Hi,

It is not possible to lookup this symbol on Mac OS X with dlsym()
because it does not have an underscore prefix. If you
dlsym(handle,"foo") on Mac OS X, it will actually look for
"_foo" (because if you have a C function or variable named foo, it gets
an underscore prepended in the object file). It is also not necessary to
look up objective C symbols, as far as I am aware, objective C modules
are bound fully when loaded and are always loaded globally (I may be
wrong on this, please feel free to correct me).

In the rest of your email, you suggest that NULL is a valid return and
can indicate that a symbol was actually found. I was not previously
aware of this, I'll look it up.

Thanks,
Peter






_______________________________________________
Bug-libtool mailing list
Bug-libtool@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-libtool

Reply via email to