SPRUIG8J January 2018 – March 2024
You can tell the linker to place an output section at an address that falls on an n-byte boundary, where n is a power of 2, by using the align keyword. For example, the following code allocates .text so that it falls on a 32-byte boundary:
.text: load = align(32)
Blocking is a weaker form of alignment that allocates a section anywhere within a block of size n. The specified block size must be a power of 2. For example, the following code allocates .bss so that the entire section is contained in a single 128-byte or begins on that boundary:
You can use alignment or blocking alone or in conjunction with a memory area, but alignment and blocking cannot be used together.