Skip to content

Commit 7ffeab3

Browse files
authored
[LLD][ELF] Generically report "address assignment did not converge" (#128774)
There are considerable number of changes done in the address assignment fixed point loop, and errors in any of them could cause address assignment not to converge. However, this is reported to the user as either "thunk creation not converged" or "relaxation not converged". We saw a confused bug about this in the wild when spilling failed to converge. (I'm working on a fix for that.) We may eventually want a complete reason system when reporting address assignment taking too many passes, but in the interim it seems prudent to generalize the error message to "address assignment did not converge".
1 parent c0abae3 commit 7ffeab3

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

lld/ELF/Writer.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1531,8 +1531,7 @@ template <class ELFT> void Writer<ELFT>::finalizeAddressDependentContent() {
15311531
// With Thunk Size much smaller than branch range we expect to
15321532
// converge quickly; if we get to 30 something has gone wrong.
15331533
if (changed && pass >= 30) {
1534-
Err(ctx) << (ctx.target->needsThunks ? "thunk creation not converged"
1535-
: "relaxation not converged");
1534+
Err(ctx) << "address assignment did not converge";
15361535
break;
15371536
}
15381537

lld/test/ELF/linkerscript/symbol-assign-many-passes2.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
## arm-thunk-many-passes.s is worst case case of thunk generation that takes 9
77
## passes to converge. It takes a few more passes to make symbol assignment
88
## converge. Test that
9-
## 1. we don't error that "thunk creation not converged".
9+
## 1. we don't error that "address assignment did not converge".
1010
## 2. we check convergence of symbols defined in an output section descriptor.
1111

1212
# CHECK: 01011050 T a

0 commit comments

Comments
 (0)