xv6-riscv-kernel/kernel/kernel.ld

45 lines
864 B
Text
Raw Normal View History

2019-05-31 15:45:59 +02:00
OUTPUT_ARCH( "riscv" )
ENTRY( _entry )
2011-08-07 18:30:34 +02:00
SECTIONS
{
2019-05-31 15:45:59 +02:00
/*
* ensure that entry.S / _entry is at 0x80000000,
* where qemu's -kernel jumps.
*/
. = 0x80000000;
.text : {
*(.text .text.*)
2019-05-31 15:45:59 +02:00
. = ALIGN(0x1000);
_trampoline = .;
2019-07-26 10:53:46 +02:00
*(trampsec)
. = ALIGN(0x1000);
ASSERT(. - _trampoline == 0x1000, "error: trampoline larger than one page");
PROVIDE(etext = .);
2019-05-31 15:45:59 +02:00
}
2011-08-07 18:30:34 +02:00
.rodata : {
. = ALIGN(16);
*(.srodata .srodata.*) /* do not need to distinguish this from .rodata */
. = ALIGN(16);
*(.rodata .rodata.*)
}
2011-08-07 18:30:34 +02:00
2019-05-31 15:45:59 +02:00
.data : {
. = ALIGN(16);
*(.sdata .sdata.*) /* do not need to distinguish this from .data */
. = ALIGN(16);
*(.data .data.*)
2019-05-31 15:45:59 +02:00
}
2019-09-08 12:51:58 +02:00
.bss : {
. = ALIGN(16);
*(.sbss .sbss.*) /* do not need to distinguish this from .bss */
. = ALIGN(16);
*(.bss .bss.*)
2019-05-31 15:45:59 +02:00
}
PROVIDE(end = .);
2011-08-07 18:30:34 +02:00
}