[lld] 1b551e7 - [LLD][COFF] Call setLocation on DelayAddressChunk when inserting into the addresses vector (NFC) (#124736)

via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 28 03:56:42 PST 2025


Author: Jacek Caban
Date: 2025-01-28T12:56:38+01:00
New Revision: 1b551e76a2fec3a1ab7d36476ab99f2504e6f6c9

URL: https://github.com/llvm/llvm-project/commit/1b551e76a2fec3a1ab7d36476ab99f2504e6f6c9
DIFF: https://github.com/llvm/llvm-project/commit/1b551e76a2fec3a1ab7d36476ab99f2504e6f6c9.diff

LOG: [LLD][COFF] Call setLocation on DelayAddressChunk when inserting into the addresses vector (NFC) (#124736)

This change prepares for ARM64X delay-load imports support (#124600).
Delaying the `setLocation` call is problematic on ARM64X because the
order of addresses may not align with the order of symbols.

Added: 
    

Modified: 
    lld/COFF/DLL.cpp

Removed: 
    


################################################################################
diff  --git a/lld/COFF/DLL.cpp b/lld/COFF/DLL.cpp
index 534cd47be1051f..76b7bee0e77e32 100644
--- a/lld/COFF/DLL.cpp
+++ b/lld/COFF/DLL.cpp
@@ -927,6 +927,7 @@ void DelayLoadContents::create() {
       Chunk *t = newThunkChunk(s, tm);
       auto *a = make<DelayAddressChunk>(ctx, t);
       addresses.push_back(a);
+      s->setLocation(a);
       thunks.push_back(t);
       StringRef extName = s->getExternalName();
       if (extName.empty()) {
@@ -967,8 +968,6 @@ void DelayLoadContents::create() {
       auxIatCopy.push_back(make<NullChunk>(ctx, 8));
     }
 
-    for (int i = 0, e = syms.size(); i < e; ++i)
-      syms[i]->setLocation(addresses[base + i]);
     auto *mh = make<NullChunk>(8, 8);
     moduleHandles.push_back(mh);
 


        


More information about the llvm-commits mailing list