Skip to content

Commit 1b551e7

Browse files
authored
[LLD][COFF] Call setLocation on DelayAddressChunk when inserting into the addresses vector (NFC) (llvm#124736)
This change prepares for ARM64X delay-load imports support (llvm#124600). Delaying the `setLocation` call is problematic on ARM64X because the order of addresses may not align with the order of symbols.
1 parent 6d0dd3d commit 1b551e7

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lld/COFF/DLL.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -927,6 +927,7 @@ void DelayLoadContents::create() {
927927
Chunk *t = newThunkChunk(s, tm);
928928
auto *a = make<DelayAddressChunk>(ctx, t);
929929
addresses.push_back(a);
930+
s->setLocation(a);
930931
thunks.push_back(t);
931932
StringRef extName = s->getExternalName();
932933
if (extName.empty()) {
@@ -967,8 +968,6 @@ void DelayLoadContents::create() {
967968
auxIatCopy.push_back(make<NullChunk>(ctx, 8));
968969
}
969970

970-
for (int i = 0, e = syms.size(); i < e; ++i)
971-
syms[i]->setLocation(addresses[base + i]);
972971
auto *mh = make<NullChunk>(8, 8);
973972
moduleHandles.push_back(mh);
974973

0 commit comments

Comments
 (0)