ENTRY(_start) SECTIONS { /* Starts at LOADER_ADDR, which is 0x8000 - that's where RPis in */ /* 32-bit mode load kernel at. */ /* My experiments do, however, show, that qemu emulating RPi2 */ /* loads the kernel at 0x10000! (took some pain to find out). */ /* Since we're using a bootloader now, we can compile the kernel */ /* for 0x8000 and bootloader will load it properly (although it */ /* itself still has to be compiled for 0x10000) */ /* rpi-open-firmware, ont he other hand, loads kernel at 0x2000000 */ /* This issue is also to be avoided by the use of bootloader */ . = 0x8000; /* For AArch64, use . = 0x80000; Unless this too is wrong in qemu… */ __start = .; __text_start = .; .text : { KEEP(*(.text.boot)) *(.text) } . = ALIGN(4096); /* align to page size */ __text_end = .; __rodata_start = .; .rodata : { *(.rodata) } . = ALIGN(4096); /* align to page size */ __rodata_end = .; __data_start = .; .data : { *(.data) } . = ALIGN(4096); /* align to page size */ __data_end = .; __bss_start = .; .bss : { bss = .; *(.bss) } . = ALIGN(4096); /* align to page size */ __bss_end = .; __bss_size = __bss_end - __bss_start; __end = .; }