The pragmas that allow you to change the default section names may well be a little cumbersome for some uses. The CrossWorks C compiler allows you to specify the section name to use for both data items and functions using the __at keyword.

Placing data objects in sections

To define the variable config and place it in the section CONFIGVARS, you would use:

int config __at "CONFIGVARS";

This will allocate space for the variable config in the CONFIGVARS section.

Placing functions in sections

To define the function startup and place it in section BOOTSTRAP, you would use:

void startup(void) __at "BOOTSTRAP"
{
  // Bootstrap code
}