GROUP

Organizes objects listed in a linker command file.

Syntax
GROUP 
  address-modifiers  : { 
  section-spec 
    [, 
  section-spec ]* }
  
[ > 
  memory-area-name  ]
  
Remarks

The GROUP directive lets you organize the linker command file.

Example of linker GROUP directive shows that each group starts at a specified address. If no address_modifiers are present, it would start following the previous section or group. Although you normally do not have an address_modifier for an output_spec within a group; all sections in a group follow contiguously unless there is an address_modifier for that output_spec .

The optional memory-area-name clause specifies a name defined with the MEMORY directive. Using this clause specifies the memory space in the target platform where the group's object code should be placed.

Listing 1. Example of linker GROUP directive
SECTIONS {
 GROUP BIND(0x00010000) : {

  .text : {}

  .rodata : {*(.rodata) *(extab) *(extabindex)}

  }



 GROUP BIND(0x2000) : {

  .data : {}

  .bss : {}

  .sdata BIND(0x3500) : {}

  .sbss  : {}

  .sdata2 : {}

  .sbss2  : {}

  }



 GROUP BIND(0xffff8000) : {

  .PPC.EMB.sdata0  : {}

  .PPC.EMB.sbss0 : {}

  }

}