Using dlopen/dlsym

Martin Nowak via Digitalmars-d digitalmars-d at puremagic.com
Sat Dec 31 07:17:26 PST 2016


On Tuesday, 27 December 2016 at 00:05:39 UTC, Andrei Alexandrescu 
wrote:
> ./test: undefined symbol: fun
>
> I'm building with no flags using dmd. What could be the problem 
> here?

Importing symbols from your executable requires to tell the 
linker to create a dynamic symbol table, i.e. using 
--export-dynamic for ld.
We also add that flag by default on many platforms because our 
exception backtraces still rely on the dynamic symbol tables, 
instead of exclusively using dedicated DWARF information.
Combining both effects might lead to confusing behavior.

Also see:

[Issue 11870 – replace dynamic symbol table (--export-dynamic) 
for backtraces](https://issues.dlang.org/show_bug.cgi?id=11870)
https://dlang.org/changelog/2.069.0.html#curl-dynamic-loading


More information about the Digitalmars-d mailing list