[lld] r234378 - Allow undefined symbols in shared library by default.

Rafael EspĂ­ndola rafael.espindola at gmail.com
Wed Apr 8 06:30:00 PDT 2015


> The second case is easier. libc++ is linked against libm, the main
> program links against libc++ and uses e.g. pow(3). It is not undefined
> in the ELF sense as libm provides it. GNU ld (both BFD and GOLD) decided
> to screw the ELF semantic in later version by complaining in this case,
> but this is actually quite important if you change the perspective from
> defining the ABI as "libfoo provides bar" to "libfoo ensures that bar is
> available". The ELF behavior is fundamentally the latter case and all
> dependencies have to be scanned for correct COPY relocations anyway.

That seems bad practice at least. If pow is used in a program, the
program should link with libm.

I grant that we might have to support it, but we really should have a
"don't look past foo.so" mode.

Cheers,
Rafael



More information about the llvm-commits mailing list