Sets a flag in the output file that indicates this section has an absolute address, and should not be moved. Program loaders and other utilities that manipulate the output image should not include this section in any movement related to position independent code or data.
Sets or removes the clear attribute of this section. If the clear attribute is present, an entry is made in the Runtime Clear Table, which is often used by startup code to initialize memory regions to a particular value.
The clear attribute is set by default for any section that includes a COMMON or SMALLCOMMON section, which are by default included by .bss and .sbss, respectively.
.bss : /* defaults to { *(.bss) *(COMMON) } - which implies CLEAR */
.sbss NOCLEAR : /* defaults to { *(.sbss) *(SMALLCOMMON)}, but will now not have a clear entry */
.mysbss NOCLEAR : { file1.o(SMALLCOMMON) } /* disables default clearing */
.stack CLEAR PAD(0x1000) : /* this section will now have a clear entry */
The linker will place value bytes of padding at the beginning of this section. This is equivalent to specifying padding at the beginning of the section contents.
The following two examples are equivalent:
.stack PAD(0x10000) : {}
.stack : { . += 0x10000; }
This section becomes a ROMmable copy of section. This section inherits the attributes and data of section, while section is modified to reserve address space only (as if it were all padding with no data). An entry is made in the Section-Info section to allow startup code to copy this section from this section (ROM) to section (RAM). See Runtime Copy Table. It is an error to specify section contents for a ROM section, or to have multiple sections ROMming the same section.
Instructs the linker to possibly pad to ensure that this section is at least size bytes in length.
.stack MIN_SIZE(0x400) : { ... } /* equivalent to the following: */
.stack : { ... . = max(.,0x400); }
Instructs the linker to possibly pad to ensure that this section extends to at least address.
.stack MIN_ENDADDRESS(0x10000) : { ... } /* equivalent to the following: */
.stack : { ... . = max(ABSOLUTE(.),0x10000) - ADDR(.stack); }
Indicates that an error should be generated if this section exceeds size bytes in length during final layout.
.stack MAX_SIZE(0x4000) : { ... } /* equivalent to the following: */
.stack : { ... final(. > 0x4000 ? ERROR("section limit exceeded") : 0; }
Indicates that an error should be generated if this section extends beyond address during final layout.
.stack MAX_ENDADDRESS(0x10000) : { ... } /* equivalent to the following: */
.stack : { ... final(ABSOLUTE(.) > 0x10000 ? ERROR("section limit exceeded") : 0; }