82feefbaee
From release 0.1.0 pre-patched archive. This includes all Red Bear modifications previously maintained as patches in local/patches/kernel/.
62 lines
1.5 KiB
Plaintext
62 lines
1.5 KiB
Plaintext
ENTRY(kstart)
|
|
OUTPUT_FORMAT("elf64-littleriscv", "elf64-littleriscv", "elf64-littleriscv" )
|
|
|
|
KERNEL_OFFSET = 0xFFFFFFFF80000000;
|
|
|
|
SECTIONS {
|
|
. = KERNEL_OFFSET;
|
|
|
|
. += SIZEOF_HEADERS;
|
|
|
|
/* Force the zero page to be part of a segment by creating a
|
|
* dummy section in the zero page.
|
|
* Linker will map the segment with the lowest vaddr value at
|
|
* 0xFFFFFFFF80000000 even if the segment has a higher vaddr.
|
|
* As such without the zero page being part of a segment, the
|
|
* kernel would be loaded at an offset from the expected
|
|
* location. As the redox kernel is not currently relocatable,
|
|
* this would result in a crash. A similar issue likely exists
|
|
* with multiboot/multiboot2 and the paddr of the segment.
|
|
*/
|
|
.dummy ALIGN(8) : AT(ADDR(.dummy) - KERNEL_OFFSET) {}
|
|
|
|
. = ALIGN(4096);
|
|
|
|
.text : AT(ADDR(.text) - KERNEL_OFFSET) {
|
|
__text_start = .;
|
|
*(.early_init.text*)
|
|
. = ALIGN(4096);
|
|
*(.text*)
|
|
. = ALIGN(4096);
|
|
__text_end = .;
|
|
}
|
|
|
|
.rodata : AT(ADDR(.rodata) - KERNEL_OFFSET) {
|
|
__rodata_start = .;
|
|
*(.rodata*)
|
|
. = ALIGN(4096);
|
|
__rodata_end = .;
|
|
}
|
|
|
|
.data : AT(ADDR(.data) - KERNEL_OFFSET) {
|
|
*(.data*)
|
|
*(.sdata*)
|
|
. = ALIGN(4096);
|
|
*(.got*)
|
|
. = ALIGN(4096);
|
|
*(.bss*)
|
|
*(.sbss*)
|
|
. = ALIGN(4096);
|
|
}
|
|
|
|
__end = .;
|
|
|
|
/DISCARD/ : {
|
|
*(.comment*)
|
|
*(.eh_frame*)
|
|
*(.gcc_except_table*)
|
|
*(.note*)
|
|
*(.rel.eh_frame*)
|
|
}
|
|
}
|