[llvm] r362151 - [RuntimeDyld] Update reserveAllocationSpace to account for stub padding.

Lang Hames via llvm-commits llvm-commits at lists.llvm.org
Thu May 30 13:58:29 PDT 2019


Author: lhames
Date: Thu May 30 13:58:28 2019
New Revision: 362151

URL: http://llvm.org/viewvc/llvm-project?rev=362151&view=rev
Log:
[RuntimeDyld] Update reserveAllocationSpace to account for stub padding.

This should fix the buildbot failures caused by r362139.

Modified:
    llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp

Modified: llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp?rev=362151&r1=362150&r2=362151&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp Thu May 30 13:58:28 2019
@@ -540,7 +540,14 @@ Error RuntimeDyldImpl::computeTotalAlloc
         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




More information about the llvm-commits mailing list