Improve map file output

Print the name of each section along with the size, base and end
addresses. If a section is empty, don't print the end address, as it
can overflow if the base address is 0.

Signed-off-by: AntonioND <antonio_nd@outlook.com>
This commit is contained in:
AntonioND
2017-03-15 23:52:05 +00:00
parent 469e3e7c86
commit 317b206fa8

View File

@@ -96,9 +96,14 @@ MapfileWriteSection(struct sSection * pSect)
SLONG i; SLONG i;
if (mf) { if (mf) {
fprintf(mf, " SECTION: $%04lX-$%04lX ($%04lX bytes)\n", if (pSect->nByteSize > 0) {
pSect->nOrg, pSect->nOrg + pSect->nByteSize - 1, fprintf(mf, " SECTION: $%04lX-$%04lX ($%04lX bytes) [\"%s\"]\n",
pSect->nByteSize); pSect->nOrg, pSect->nOrg + pSect->nByteSize - 1,
pSect->nByteSize, pSect->pzName);
} else {
fprintf(mf, " SECTION: $%04lX ($0 bytes) [\"%s\"]\n",
pSect->nOrg, pSect->pzName);
}
} }
for (i = 0; i < pSect->nNumberOfSymbols; i += 1) { for (i = 0; i < pSect->nNumberOfSymbols; i += 1) {