comparison lwlink/trunk/src/output.c @ 132:b972e45b5e07

Don't generate a preamble for a zero-sized section
author lost
date Sun, 25 Jan 2009 16:45:31 +0000
parents 6084a3859fb4
children
comparison
equal deleted inserted replaced
131:5276565799bd 132:b972e45b5e07
78 if (sectlist[sn].ptr -> flags & SECTION_BSS) 78 if (sectlist[sn].ptr -> flags & SECTION_BSS)
79 { 79 {
80 // no output for a BSS section 80 // no output for a BSS section
81 continue; 81 continue;
82 } 82 }
83 if (sectlist[sn].ptr -> codesize == 0)
84 {
85 // don't generate output for a zero size section
86 continue;
87 }
83 // write a preamble 88 // write a preamble
84 buf[0] = 0x00; 89 buf[0] = 0x00;
85 buf[1] = sectlist[sn].ptr -> codesize >> 8; 90 buf[1] = sectlist[sn].ptr -> codesize >> 8;
86 buf[2] = sectlist[sn].ptr -> codesize & 0xff; 91 buf[2] = sectlist[sn].ptr -> codesize & 0xff;
87 buf[3] = sectlist[sn].ptr -> loadaddress >> 8; 92 buf[3] = sectlist[sn].ptr -> loadaddress >> 8;