From a963bc490d689cdd2e46d0c347f8e0927b502fdd Mon Sep 17 00:00:00 2001 From: Vincent Lee Date: Wed, 5 Jan 2022 15:05:09 -0800 Subject: [PATCH] [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 --- lld/MachO/ConcatOutputSection.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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++]);