ALIGN in linker scripts

What does the ALIGN keyword do in linker scripts? I have read many linker scripting tutorials, but I can't figure out what ALIGN really does. Can anyone explain this simply. Thanks!

+8
linker linker-scripts
source share
1 answer

Typical use

. = ALIGN(8); 

This means: insert padding bytes until the current location is aligned with an 8-byte boundary. I.e:

 while ((current_location & 7) != 0) *current_location++ = padding_value; 
+15
source share

All Articles