Controlling Alignment

Use the ALIGN argument in a SECTIONS or GROUP directive to specify an alignment relative to the start of the physical address.

Example of the ALIGN directive shows an example.

Listing 1. Example of the ALIGN directive
SECTIONS
{
   GROUP: 
   {
      .init ALIGN(0x1000) : {}
      .text ALIGN(0x1000) : {}
   } > text

}

This example defines two sections named .init and .text . At runtime, each section will be loaded at the next available address that is evenly divisible by 0x1000 in the memory area named text on the target platform.

Related information
Specifying Link Order in the IDE
Dead-Stripping
Defining the Target's Memory Map
Defining Sections in the Output File
Associating Input Sections With Output Sections
Specifying Memory Area Locations and Sizes
Creating Memory Gaps
Creating Symbols
Linker Command File Syntax
Commands, Directives, and Keywords