8.5.8 Special Section Types (DSECT, COPY, NOLOAD, NOINIT, and VECT_INIT)
You can assign the following special types to output sections: DSECT, COPY, NOLOAD, NOINIT, and VECT_INIT. These types affect the way that the program is treated when it is linked and loaded. You can assign a type to a section by placing the type after the section definition. For example:
SECTIONS
{
sec1: load = 0x00002000, type = DSECT {f1.c.obj}
sec2: load = 0x00004000, type = COPY {f2.c.obj}
sec3: load = 0x00006000, type = NOLOAD {f3.c.obj}
sec4: load = 0x00008000, type = NOINIT {f4.c.obj}
TIMER0_A1 : { * ( .int53 ) } > INT53 type = VECT_INIT
}
- The DSECT type creates a dummy section with the following characteristics:
- It is not included in the output section memory allocation. It takes up no memory and is not included in the memory map listing.
- It can overlay other output sections, other DSECTs, and unconfigured memory.
- Global symbols defined in a dummy section are relocated normally. They appear in the output module's symbol table with the same value they would have if the DSECT had actually been loaded. These symbols can be referenced by other input sections.
- Undefined external symbols found in a DSECT cause specified archive libraries to be searched.
- The section's contents, relocation information, and line number information are not placed in the output module.
In the preceding example, none of the sections from f1.c.obj are allocated, but all the symbols are relocated as though the sections were linked at address 0x2000. The other sections can refer to any of the global symbols in sec1.
- A COPY section is similar to a DSECT section, except that its contents and associated information are written to the output module. The .cinit section that contains initialization tables for the MSP430 C/C++ compiler has this attribute under the run-time initialization model.
- A NOLOAD section differs from a normal output section in one respect: the section's contents, relocation information, and line number information are not placed in the output module. The linker allocates space for the section, and it appears in the memory map listing.
- A NOINIT section is not C auto-initialized by the linker. It is your responsibility to initialize this section as needed.
- A VECT_INIT section type directs the linker to emit a warning if a particular device interrupt was not initialized using the vector pragma for an interrupt sub-routine (ISR) (see the Optimizing C/C++ Compiler User's Guide for details on the vector pragma and interrupt keyword). However, a default vector handler is now provided by the run-time support (RTS) library, so you should not see this error if you are linking with the provided RTS library. The following output section entry will generate a linker warning if the device interrupt TIMER0_A1 does not have an associated ISR and is not using the default ISR:
- TIMER0_A1 : { * ( .int53 ) } > INT53 type = VECT_INIT