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.
@@ -96,9 +96,14 @@ MapfileWriteSection(struct sSection * pSect)
SLONG i;
if (mf) {
- fprintf(mf, " SECTION: $%04lX-$%04lX ($%04lX bytes)\n",
+ if (pSect->nByteSize > 0) {
+ fprintf(mf, " SECTION: $%04lX-$%04lX ($%04lX bytes) [\"%s\"]\n",
pSect->nOrg, pSect->nOrg + pSect->nByteSize - 1,
- pSect->nByteSize);
+ 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) {
