section

Previous Specifying Attributes of Functions Next

Syntax: section ("section-name")

Normally, the compiler places all code and data it generates in the .data section. Sometimes, however, you need additional sections, or you need certain particular functions to appear in special sections. The section attribute specifies that a function lives in a particular section. For example, the declaration:

extern void foobar (void) __attribute__ ((section ("bar")));
puts the function foobar in the bar section.

The use of this attribute is limited in TIGCC, because its linker supports only a few types of sections.

The section attribute can also be used for variables.