Fix incorrect EMPTY space in .map files (#2119)

This commit is contained in:
Rangi
2026-09-19 03:17:15 +02:00
committed by GitHub
parent 44328d522b
commit 76bba2809b
3 changed files with 36 additions and 13 deletions
+5 -4
View File
@@ -468,11 +468,12 @@ static void writeMapBank(SortedSections const &sectList, SectionType type, uint3
uint16_t prevEndAddr = sectionTypeInfo[type].startAddr;
uint16_t used = forEachSection(sectList, [&](Section const &sect) {
assume(sect.offset == 0);
writeEmptySpace(prevEndAddr, sect.org);
assume(sect.org + sect.size <= UINT16_MAX);
prevEndAddr = sect.org + sect.size;
if (uint16_t endAddr = sect.org + sect.size; endAddr > prevEndAddr) {
writeEmptySpace(prevEndAddr, sect.org);
prevEndAddr = endAddr;
}
fprintf(mapFile, "\tSECTION: $%04" PRIx16, sect.org);
if (sect.size != 0) {