The gcc compiler generates three distinct sections for RAM-based data whose names are .noinit, .bss and .data. The .noinit section is for uninitialized data items. The .bss section is for zero-initialized data items (BSS stands for Block Started by Symbol, a throwback to FORTRAN or even earlier days). The .data section is for data items with non-zero initialization values. After setting up the stack pointer (usually to the end of internal RAM), zeroes out the .bss section. For the .data section, it copies a block of data from Flash (containing the initialization data) to the RAM section. It does nothing at all to the .init section. If needed, there is a means to inject code into various places of the startup sequence. See the discussion of the .initN sections for more details. In particular, see http://www.nongnu.org/avr-libc/user-manual/mem_sections.html Don Kinzer ZBasic Microcontrollers http://www.zbasic.net
Message
Re: Finally, really, actually, starting off with C
2009-01-07 by Don Kinzer
Attachments
- No local attachments were found for this message.