From 434afd372b1f92adacb8ff87c4a715ac6d4448da Mon Sep 17 00:00:00 2001 From: Lang Hames Date: Thu, 30 May 2019 20:58:28 +0000 Subject: [PATCH] [RuntimeDyld] Update reserveAllocationSpace to account for stub padding. This should fix the buildbot failures caused by r362139. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362151 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp index b1d22b89af0..e0642adbd31 100644 --- a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp +++ b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp @@ -540,7 +540,14 @@ Error RuntimeDyldImpl::computeTotalAllocSize(const ObjectFile &Obj, return errorCodeToError(EC); uint64_t StubBufSize = computeSectionStubBufSize(Obj, Section); - uint64_t SectionSize = DataSize + StubBufSize; + + uint64_t PaddingSize = 0; + if (Name == ".eh_frame") + PaddingSize += 4; + if (StubBufSize != 0) + PaddingSize += getStubAlignment() - 1; + + uint64_t SectionSize = DataSize + PaddingSize + StubBufSize; // The .eh_frame section (at least on Linux) needs an extra four bytes // padded -- 2.40.0