|
|
The BLOCK option, applied to any output section or GROUP directive, is used to direct ld to align a section at a specified byte offset in the output file. Note that this has no effect on the address at which the section is allocated nor on any part of the link edit process. It is used purely to adjust the physical position of the section in the output file.
SECTIONS { .text BLOCK(0x200) : { } .data ALIGN(0x20000) BLOCK(0x200) : { } }
With this SECTIONS directive, ld assures that each section, .text and .data, is physically written at a file offset, which is a multiple of 0x200 (at an offset of 0, 0x200, 0x400, and so forth, in the file).