Fix missing .sym/.map symbols in SECTION UNION/FRAGMENTs

Only the first "slice"'s symbols were considered, forgetting some symbols
This commit is contained in:
ISSOtm
2021-03-22 23:22:53 +01:00
parent 5406674cdd
commit 46d6652df1

View File

@@ -368,11 +368,17 @@ static uint16_t writeMapBank(struct SortedSections const *sectList,
fprintf(mapFile, " SECTION: $%04" PRIx16 " (0 bytes) [\"%s\"]\n",
sect->org, sect->name);
uint16_t org = sect->org;
while (sect) {
for (size_t i = 0; i < sect->nbSymbols; i++)
fprintf(mapFile, " $%04" PRIx32 " = %s\n",
sect->symbols[i]->offset + sect->org,
sect->symbols[i]->offset + org,
sect->symbols[i]->name);
sect = sect->nextu; // Also print symbols in the following "pieces"
}
*pickedSection = (*pickedSection)->next;
}