[lld] [ELF] Postpone "unable to move location counter backward" error (PR #66854)
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 19 22:48:24 PDT 2023
================
@@ -169,9 +169,16 @@ void LinkerScript::expandOutputSection(uint64_t size) {
void LinkerScript::setDot(Expr e, const Twine &loc, bool inSec) {
uint64_t val = e().getValue();
- if (val < dot && inSec)
- error(loc + ": unable to move location counter backward for: " +
- state->outSec->name);
+ // If val is smaller and we are in an output section, record the error and
+ // report it if this is the last assignAddresses iteration. dot may be smaller
+ // if there is another assignAddresses iteration.
+ if (val < dot && inSec) {
+ backwardDotErr =
+ (loc + ": unable to move location counter (0x" + Twine::utohexstr(dot) +
+ ") backward (0x" + Twine::utohexstr(val) + ") for section '" +
----------------
MaskRay wrote:
Updated in 54daea8e15f7e5e95e6531d34616062af81c4d84 to `backward to 0x... for section 'xxx'`
https://github.com/llvm/llvm-project/pull/66854
More information about the llvm-commits
mailing list