[lld] a963bc4 - [lld-macho] Increase slops to prevent thunk out of range

Vincent Lee via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 6 12:29:23 PST 2022


Author: Vincent Lee
Date: 2022-01-06T12:29:12-08:00
New Revision: a963bc490d689cdd2e46d0c347f8e0927b502fdd

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

LOG: [lld-macho] Increase slops to prevent thunk out of range

One of our internal arm64 apps hit a thunk out of range error when building
with LLD. Per the comment, I'm arbitrarily increasing slop size to 256.

Reviewed By: #lld-macho, thakis

Differential Revision: https://reviews.llvm.org/D116705

Added: 
    

Modified: 
    lld/MachO/ConcatOutputSection.cpp

Removed: 
    


################################################################################
diff  --git a/lld/MachO/ConcatOutputSection.cpp b/lld/MachO/ConcatOutputSection.cpp
index 9f71e81b073a8..f63c2e6eb321c 100644
--- a/lld/MachO/ConcatOutputSection.cpp
+++ b/lld/MachO/ConcatOutputSection.cpp
@@ -244,7 +244,7 @@ void ConcatOutputSection::finalize() {
     // contains several branch instructions in succession, then the distance
     // from the current position to the position where the thunks are inserted
     // grows. So leave room for a bunch of thunks.
-    unsigned slop = 100 * thunkSize;
+    unsigned slop = 256 * thunkSize;
     while (finalIdx < endIdx && isecAddr + inputs[finalIdx]->getSize() <
                                     isecVA + forwardBranchRange - slop)
       finalizeOne(inputs[finalIdx++]);


        


More information about the llvm-commits mailing list