[ORC][COFF] Introduce DLLImportDefinitionGenerator.
authorSunho Kim <ksunhokim123@gmail.com>
Mon, 15 Aug 2022 16:35:18 +0000 (01:35 +0900)
committerSunho Kim <ksunhokim123@gmail.com>
Mon, 15 Aug 2022 17:06:57 +0000 (02:06 +0900)
commit0c69f9f32c83002006a91639a950d9fd70f1b1bb
tree685cea2adf5a2f0d9fe969fd294f1aedfd449b88
parente5748c6e73e7a3173046002b1f9a556965552c37
[ORC][COFF] Introduce DLLImportDefinitionGenerator.

This class will be used to properly solve the `__imp_` symbol and jump-thunk generation issues. It is assumed to be the last definition generator to be called, and as it's the last generator the only symbols remaining in the lookup set are the symbols that are supposed to be queried outside this jitdylib. Instead of just letting them through, we issue another lookup invocation and fetch the allocated addresses, and then create jitlink graph containing `__imp_` GOT symbols and jump-thunks targetting the fetched addresses.

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D131833
llvm/include/llvm/ExecutionEngine/Orc/ExecutionUtils.h
llvm/lib/ExecutionEngine/Orc/ExecutionUtils.cpp