KERNEL_VMA = 0xFFFFFFFF80000000 ; KERNEL_LMA = 0x100000 ; ENTRY(_multiboot_entry) SECTIONS { . = KERNEL_LMA; .bootstrap : { boot32.o ( .multiboot ) boot32.o (.text) boot32.o (.data) } . += KERNEL_VMA; /* += so that the code can just run, might be able to "org" the code */ .text : AT(ADDR(.text) - KERNEL_VMA) { _code = .; *(EXCLUDE_FILE(*boot32.o) .text) *(.rodata*) . = ALIGN(4096); } .data : AT(ADDR(.data) - KERNEL_VMA) { _data = .; *(EXCLUDE_FILE(*boot32.o) .data) . = ALIGN(8); _kernel_vma = .; QUAD(KERNEL_VMA); . += 8; _kernel_end = .; QUAD(KERNEL_END); . += 8; _kernel_phys_end = .; QUAD(KERNEL_PHYS_END); . += 8; _kernel_size = .; QUAD(KERNEL_SIZE); . += 8; . = ALIGN(4096); } .bss : AT(ADDR(.bss) - KERNEL_VMA) { _bss = .; *(.bss) /* * You usually need to include generated COMMON symbols * under kernel BSS section or use gcc's -fno-common */ *(COMMON) . = ALIGN(4096); } KERNEL_SIZE = . - KERNEL_VMA - KERNEL_LMA; KERNEL_PHYS_END = . - KERNEL_VMA; KERNEL_END = .; /DISCARD/ : { *(.comment) } }