bug-libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lt_dlsym() Doesn't Allow for a Symbol with Address of 0.


From: Peter O'Gorman
Subject: Re: lt_dlsym() Doesn't Allow for a Symbol with Address of 0.
Date: Sun, 22 Jul 2007 11:57:47 -0500

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








reply via email to

[Prev in Thread] Current Thread [Next in Thread]