Print "; Next union/fragment" between "pieces" in .map file

Resolves #1099
This commit is contained in:
Rangi
2022-11-06 17:31:49 -05:00
committed by Eldred Habert
parent 92b2ac3c8c
commit 32cb0558e4

View File

@@ -460,16 +460,20 @@ static uint16_t writeMapBank(struct SortedSections const *sectList,
uint16_t org = sect->org; uint16_t org = sect->org;
while (sect) { 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++) for (size_t i = 0; i < sect->nbSymbols; i++)
// "\tSECTION: $xxxx ..." // Space matches "\tSECTION: $xxxx ..."
fprintf(mapFile, "\t $%04" PRIx32 " = %s\n", fprintf(mapFile, "\t $%04" PRIx32 " = %s\n",
sect->symbols[i]->offset + org, sect->symbols[i]->offset + org,
sect->symbols[i]->name); 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" sect = sect->nextu; // Also print symbols in the following "pieces"
} }
} }