SECTIONS

A basic SECTIONS directive has the following form:

Prototype
SECTIONS { <section_spec> } 

section_spec is one of the following:

sectionName is the section name for the output section. It must start with a period character. For example, ".mysection".

AT (loadAddress) is an optional parameter that specifies the address of the section. The default (if not specified) is to make the load address the same as the relocation address.

contents are made up of statements. These statements can:

segmentName is the predefined memory segment into which you want to put the contents of the section. The two variants are:

Table 1. Option Choices
>segmentName Places the section contents at the beginning of the memory segment segmentName.
>>segmentName Appends the section contents to the memory segment segmentName.
Example
SECTIONS {

   .text : {

           F_textSegmentStart = .;

           footpad.c (.text)

           . = ALIGN (0x10);

           padfoot.c (.text)

           F_textSegmentEnd = .;

   } > TEXT

  .data : { *(.data) } > DATA

  .bss  : { *(.bss) > BSS

  *(COMMON)

  }

}