Skip to content

Commit

Permalink
[lld-macho] Increase slops to prevent thunk out of range
Browse files Browse the repository at this point in the history
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
  • Loading branch information
thevinster committed Jan 6, 2022
1 parent bf9d8d9 commit a963bc4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lld/MachO/ConcatOutputSection.cpp
Expand Up @@ -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++]);
Expand Down

0 comments on commit a963bc4

Please sign in to comment.