Pragma mangle and D shared objects

John Colvin via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Oct 25 13:05:18 PDT 2014


On Saturday, 25 October 2014 at 18:40:23 UTC, H. S. Teoh via 
Digitalmars-d-learn wrote:
> Actually, the object file (library) itself should already have 
> a list of
> exported symbols; you could then use core.demangle to extract 
> the
> function signatures from the mangled symbols and construct a 
> hash of all
> exported symbols and their types. The only thing is, I don't 
> know of any
> cross-platform method of retrieving the list of exported 
> symbols -- the
> Posix dlsym() family of functions only allow lookup by explicit 
> symbol
> name, no iteration primitives are specified. But the 
> information is
> definitely there, since that's how the OS's dynamic linker 
> figures out
> how to link dynamic libraries in the first place!
>
> T

I wonder what nm uses. AFAIK it works on everything posix.


More information about the Digitalmars-d-learn mailing list