[lld] [LLD][COFF][NFC] Store live flag in ImportThunkChunk. (PR #108459)

Jacek Caban via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 13 05:07:32 PDT 2024


================
@@ -125,7 +125,7 @@ static void getSymbols(const COFFLinkerContext &ctx,
     if (!file->thunkSym)
       continue;
 
-    if (!file->thunkLive)
+    if (!file->thunkSym->isLive())
----------------
cjacek wrote:

I believe that in most cases, these symbols will be emitted regardless of the loop. They are typically referenced by some object file and pulled in earlier during the function execution. If no object file references the symbol, it wouldn’t be pulled in the first place. However, if the code only references the thunk `foo`, this implicitly requires `__imp_foo` to be defined as well. I assume this pull is intended to handle that specific case.

In the context of ARM64EC, there are additional symbols implicitly defined, so this logic won’t fully cover those scenarios. I'll take a closer look at that.

https://github.com/llvm/llvm-project/pull/108459


More information about the llvm-commits mailing list