[ORC][JITLink] Retain Weak flags in JITDylib interfaces, propagate to LinkGraph.
authorLang Hames <lhames@gmail.com>
Tue, 27 Sep 2022 15:59:58 +0000 (08:59 -0700)
committerLang Hames <lhames@gmail.com>
Tue, 27 Sep 2022 17:04:59 +0000 (10:04 -0700)
commitffe2dda29f34c221ab84c574406d7e0c062c0ab4
tree7b3f8ebc2325bddf75e8ca4625a4193a6195e73e
parent57f6fd0a348f47ca70fabdd3ed098bc59db22c09
[ORC][JITLink] Retain Weak flags in JITDylib interfaces, propagate to LinkGraph.

Previously we stripped Weak flags from JITDylib symbol table entries once they
were resolved (there was no particularly good reason for this). Now we want to
retain them and query them when setting the Linkage on external symbols in
LinkGraphs during symbol resolution (this was the motivation for 75404e9ef88).
Making weak linkage of external definitions discoverable in the LinkGraph will
in turn allow future plugins to implement correct handling for them (by
recording locations that depend on exported weak definitions and pointing all
of these at one chosen definition at runtime).
llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h
llvm/lib/ExecutionEngine/JITLink/COFFLinkGraphBuilder.cpp
llvm/lib/ExecutionEngine/JITLink/ELFLinkGraphBuilder.h
llvm/lib/ExecutionEngine/JITLink/JITLinkGeneric.cpp
llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.cpp
llvm/lib/ExecutionEngine/Orc/Core.cpp
llvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp
llvm/lib/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.cpp
llvm/test/ExecutionEngine/JITLink/X86/COFF_common_symbol.s