38 lines
903 B
Plaintext
38 lines
903 B
Plaintext
/* Tell the linker that we want the symbol _start to be our entry point */
|
|
ENTRY(_start)
|
|
|
|
SECTIONS
|
|
{
|
|
/* We wanna be placed in the higher half, 2MiB above 0 in physical memory. */
|
|
/* Since we are going to use PIE, this is just the base load address, but the */
|
|
/* bootloader will be able to relocate us as it sees fit. */
|
|
. = 0xffffffff80200000;
|
|
|
|
_kernel_start = .;
|
|
|
|
/* We place the .stivale2hdr section containing the header in its own section, */
|
|
/* and we use the KEEP directive on it to make sure it doesn't get discarded. */
|
|
.stivale2hdr : {
|
|
KEEP(*(.stivale2hdr))
|
|
}
|
|
|
|
/* Then let's place all the other traditional executable sections afterwards. */
|
|
.text : {
|
|
*(.text*)
|
|
}
|
|
|
|
.rodata : {
|
|
*(.rodata*)
|
|
}
|
|
|
|
.data : {
|
|
*(.data*)
|
|
}
|
|
|
|
.bss : {
|
|
*(COMMON)
|
|
*(.bss*)
|
|
}
|
|
|
|
_kernel_end = .;
|
|
} |