OUTPUT_FORMAT("binary") . = 0x8200; SECTIONS { /* Prelude must come first so it's in the single sector loaded by stage 1. */ .prelude : { *(.prelude) } .text : { *(.text) *(.text.*) } .data : { *(.data) *(.data.*) } .bss : { *(.bss) *(.bss.*) } .rodata : { *(.rodata) *(.rodata.*) } .magic : { /* Magic bytes stage 2 uses to make sure it's loaded the subsequent sectors correctly. */ LONG(0x544e4150) } s2_magic = ADDR(.magic); /* Define a symbol for the total length of the binary, so the prelude knows how many blocks to * load from disk. */ s2_bin_len = . - 0x8200; s2_bin_sectors = (s2_bin_len + 511) / 512; }