2021-07-02 21:49:20 +03:00
|
|
|
/* Tell the linker that we want the symbol _start to be our entry point */
|
2020-11-21 18:38:44 +02:00
|
|
|
ENTRY(_start)
|
|
|
|
|
|
|
|
SECTIONS
|
|
|
|
{
|
2021-07-02 21:49:20 +03:00
|
|
|
/* 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;
|
2021-08-17 12:45:35 +03:00
|
|
|
|
|
|
|
_kernel_start = .;
|
|
|
|
|
2021-07-02 21:49:20 +03:00
|
|
|
/* 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))
|
|
|
|
}
|
2020-11-21 18:38:44 +02:00
|
|
|
|
2021-07-02 21:49:20 +03:00
|
|
|
/* Then let's place all the other traditional executable sections afterwards. */
|
|
|
|
.text : {
|
|
|
|
*(.text*)
|
|
|
|
}
|
2020-11-21 18:38:44 +02:00
|
|
|
|
2021-07-02 21:49:20 +03:00
|
|
|
.rodata : {
|
|
|
|
*(.rodata*)
|
|
|
|
}
|
2020-11-21 18:38:44 +02:00
|
|
|
|
2021-07-02 21:49:20 +03:00
|
|
|
.data : {
|
|
|
|
*(.data*)
|
|
|
|
}
|
2020-11-21 18:38:44 +02:00
|
|
|
|
2021-07-02 21:49:20 +03:00
|
|
|
.bss : {
|
|
|
|
*(COMMON)
|
|
|
|
*(.bss*)
|
|
|
|
}
|
2021-08-17 12:45:35 +03:00
|
|
|
|
|
|
|
_kernel_end = .;
|
2020-11-21 18:38:44 +02:00
|
|
|
}
|