kernel/kernel.ld
45 lines
1OUTPUT_ARCH( "riscv" )2ENTRY( _entry )34SECTIONS5{6 /*7 * ensure that entry.S / _entry is at 0x80000000,8 * where qemu's -kernel jumps.9 */10 . = 0x80000000;1112 .text : {13 kernel/entry.o(_entry)14 *(.text .text.*)15 . = ALIGN(0x1000);16 _trampoline = .;17 *(trampsec)18 . = ALIGN(0x1000);19 ASSERT(. - _trampoline == 0x1000, "error: trampoline larger than one page");20 PROVIDE(etext = .);21 }2223 .rodata : {24 . = ALIGN(16);25 *(.srodata .srodata.*) /* do not need to distinguish this from .rodata */26 . = ALIGN(16);27 *(.rodata .rodata.*)28 }2930 .data : {31 . = ALIGN(16);32 *(.sdata .sdata.*) /* do not need to distinguish this from .data */33 . = ALIGN(16);34 *(.data .data.*)35 }3637 .bss : {38 . = ALIGN(16);39 *(.sbss .sbss.*) /* do not need to distinguish this from .bss */40 . = ALIGN(16);41 *(.bss .bss.*)42 }4344 PROVIDE(end = .);45}46