[lld] ff111a9 - [lld-macho] Increase slop to prevent thunk out of range again.

Jez Ng via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 16 19:12:03 PST 2022


Author: Mike Hommey
Date: 2022-11-16T22:11:54-05:00
New Revision: ff111a997f1b40a531bc68b543542746d4b08a5f

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

LOG: [lld-macho] Increase slop to prevent thunk out of range again.

Building Firefox with -O0 on arm64 mac recently hit the
"FIXME: thunk range overrun" error on multiple occasions.

Doubling or tripling slop was not sufficient in some cases, so
quadruple it.

Reviewed By: #lld-macho, int3

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

Added: 
    

Modified: 
    lld/MachO/ConcatOutputSection.cpp

Removed: 
    


################################################################################
diff  --git a/lld/MachO/ConcatOutputSection.cpp b/lld/MachO/ConcatOutputSection.cpp
index e97f1e9b9ddd1..cbd3a2492d251 100644
--- a/lld/MachO/ConcatOutputSection.cpp
+++ b/lld/MachO/ConcatOutputSection.cpp
@@ -246,7 +246,7 @@ void TextOutputSection::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 = 256 * thunkSize;
+    unsigned slop = 1024 * thunkSize;
     while (finalIdx < endIdx && addr + size + inputs[finalIdx]->getSize() <
                                     isecVA + forwardBranchRange - slop)
       finalizeOne(inputs[finalIdx++]);


        


More information about the llvm-commits mailing list