summaryrefslogtreecommitdiff
path: root/lld/COFF/Writer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/COFF/Writer.cpp')
-rw-r--r--lld/COFF/Writer.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lld/COFF/Writer.cpp b/lld/COFF/Writer.cpp
index 68993232f09c..f776c76a47ae 100644
--- a/lld/COFF/Writer.cpp
+++ b/lld/COFF/Writer.cpp
@@ -1532,6 +1532,10 @@ void Writer::assignAddresses() {
}
if (padding && c->isHotPatchable())
virtualSize += padding;
+ // If chunk has EC entry thunk, reserve a space for an offset to the
+ // thunk.
+ if (c->getEntryThunk())
+ virtualSize += sizeof(uint32_t);
virtualSize = alignTo(virtualSize, c->getAlignment());
c->setRVA(rva + virtualSize);
virtualSize += c->getSize();