From 142eae4558ddbf7713f48aec0d30c8981a825eac Mon Sep 17 00:00:00 2001 From: Rangi <35663410+Rangi42@users.noreply.github.com> Date: Fri, 18 Sep 2026 17:35:30 -0400 Subject: [PATCH] Fix repeated "And N more" in overlay error message (#2118) --- src/link/assign.cpp | 4 +++- test/link/overlay/unfixed/a.asm | 3 +++ test/link/overlay/unfixed/out.err | 6 +++--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/link/assign.cpp b/src/link/assign.cpp index b5d4deba..62a9acc9 100644 --- a/src/link/assign.cpp +++ b/src/link/assign.cpp @@ -445,8 +445,9 @@ static void checkOverlayCompat() { unfixedList += "\n- and "; unfixedList += std::to_string(nbUnfixedSections - nbListed); unfixedList += " more"; - break; + goto finish; } + unfixedList += "\n- \""; unfixedList += section->name; unfixedList += "\" ("; @@ -463,6 +464,7 @@ static void checkOverlayCompat() { } } +finish: // Can't `break` out of a nested loop fatal( "All sections must be fixed when using an overlay file; %zu %s not:%s", nbUnfixedSections, diff --git a/test/link/overlay/unfixed/a.asm b/test/link/overlay/unfixed/a.asm index b1d41ee1..1153929d 100644 --- a/test/link/overlay/unfixed/a.asm +++ b/test/link/overlay/unfixed/a.asm @@ -8,3 +8,6 @@ FOR n, 1, 5 SECTION "ROMX #{d:n}", ROMX db n ENDR + +SECTION "aligned", ROMX, ALIGN[4] +SECTION "unconstrained", ROMX diff --git a/test/link/overlay/unfixed/out.err b/test/link/overlay/unfixed/out.err index d7f99b2e..3fd6d0be 100644 --- a/test/link/overlay/unfixed/out.err +++ b/test/link/overlay/unfixed/out.err @@ -1,4 +1,4 @@ -FATAL: All sections must be fixed when using an overlay file; 12 are not: +FATAL: All sections must be fixed when using an overlay file; 14 are not: - "ROMX BANK[4]" (address not specified) - "ROMX BANK[3]" (address not specified) - "ROMX BANK[2]" (address not specified) @@ -7,7 +7,7 @@ FATAL: All sections must be fixed when using an overlay file; 12 are not: - "ROMX[$4003]" (bank not specified) - "ROMX[$4002]" (bank not specified) - "ROMX[$4001]" (bank not specified) +- "aligned" (bank and address not specified) - "ROMX #4" (bank and address not specified) -- "ROMX #3" (bank and address not specified) -- and 2 more +- and 4 more Linking aborted with 1 error