From 32cb0558e45355b4b0cb2553928304ad0078afae Mon Sep 17 00:00:00 2001 From: Rangi Date: Sun, 6 Nov 2022 17:31:49 -0500 Subject: [PATCH] Print "; Next union/fragment" between "pieces" in .map file Resolves #1099 --- src/link/output.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/link/output.c b/src/link/output.c index 66993e45..00cfc294 100644 --- a/src/link/output.c +++ b/src/link/output.c @@ -460,16 +460,20 @@ static uint16_t writeMapBank(struct SortedSections const *sectList, uint16_t org = sect->org; while (sect) { - if (sect->modifier == SECTION_UNION) - fprintf(mapFile, "\t\t; New union\n"); - else if (sect->modifier == SECTION_FRAGMENT) - fprintf(mapFile, "\t\t; New fragment\n"); for (size_t i = 0; i < sect->nbSymbols; i++) - // "\tSECTION: $xxxx ..." + // Space matches "\tSECTION: $xxxx ..." fprintf(mapFile, "\t $%04" PRIx32 " = %s\n", sect->symbols[i]->offset + org, sect->symbols[i]->name); + if (sect->nextu) { + // Announce the following "piece" + if (sect->nextu->modifier == SECTION_UNION) + fprintf(mapFile, "\t\t; Next union\n"); + else if (sect->nextu->modifier == SECTION_FRAGMENT) + fprintf(mapFile, "\t\t; Next fragment\n"); + } + sect = sect->nextu; // Also print symbols in the following "pieces" } }