[llvm-dev] [lld] bug detecting undefined symbols in shared libraries

Rafael Avila de Espindola via llvm-dev llvm-dev at lists.llvm.org
Thu Dec 14 20:03:46 PST 2017


Scott Smith via llvm-dev <llvm-dev at lists.llvm.org> writes:

> With shared libraries, it is always possible that you end up running with a
> different set of libraries than you actually linked with.  However, how
> often is that actually the case?  It seems at the very least there should
> be an option to tell the user that unless they switch libraries, their code
> won't be runnable.  In most cases, everything is available to the linker to
> detect the situation (as both ld and gold do).

Your best option for checking that during link time is to use -z defs
when linking the shared library.

Cheers,
Rafael


More information about the llvm-dev mailing list