ALIGNALL

Forces minimum alignment of all sections in the current segment to the specified value.

  ALIGNALL(alignValue);
  
  
Note: ALIGNALL does not enforce alignment for string as an array of wide character (2 byte).
Parameter

alignValue

Alignment-value specifier; must be a power of two.

Remarks

ALIGNALL is the command version of the ALIGN function. It updates the location counter as each section is written to the output. This alignment is not enforced on the objects inside the section.

For object alignment inside a section refer #pragma pack().

Example

The following listing is an example use for ALIGNALL() command.

Listing: ALIGNALL Example

.code :

{

    ALIGNALL(16);  // Align code on 16-byte boundary. i.e. Each of the 
.init and .text section addresses are aligned to 16-byte boundary

    *    (.init)

    *    (.text)

    ALIGNALL(64);  //align data on 64-byte boundary.i.e Each of 
.rodata section addresses are aligned to 64-byte boundary.

    *    (.rodata)

} > .text