[llvm-jitlink] Don't add process symbols to every JITDylib.
authorLang Hames <lhames@gmail.com>
Tue, 8 Feb 2022 05:18:43 +0000 (16:18 +1100)
committerLang Hames <lhames@gmail.com>
Tue, 8 Feb 2022 05:18:43 +0000 (16:18 +1100)
commitadbc7a2665768d54a7b35e8d9e5d4a02dee6de6d
treedaba9c34f985e287374c7f712eef978e04b33b40
parentea0ce326fd12178b1797b7f3e3b2a204d22d0ab7
[llvm-jitlink] Don't add process symbols to every JITDylib.

The addProcessSymbols function added a generator for process symbols to every
JITDylib in the session, but this is unhelpful default behavior (e.g. it will
cause the ORC runtime's definition of __cxa_atexit to be shadowed by the
process's definition for all JITDylibs except main).

Since the loadProcessSymbols function already added a generator to main we only
need to drop this function. Other JITDylibs wishing to resolve process symbols
can link against the main JITDylib by passing `-lmain`.
llvm/tools/llvm-jitlink/llvm-jitlink.cpp