diff options
| author | hachem <im@hachem.wtf> | 2026-09-10 05:49:32 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2026-09-10 05:49:32 +0200 |
| commit | d8b53a78fcb131235c1e83fe7d6600ab50560420 (patch) | |
| tree | c51c4340826f391e576e484d39d8b9b4e04a5245 /boot/linker.ld | |
| parent | 5dfeadc5e32790c34b1d413d7be41771f68a5e95 (diff) | |
setup: initialize repo + limine as a bootloader
Diffstat (limited to 'boot/linker.ld')
| -rw-r--r-- | boot/linker.ld | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/boot/linker.ld b/boot/linker.ld new file mode 100644 index 0000000..e15ed10 --- /dev/null +++ b/boot/linker.ld @@ -0,0 +1,52 @@ +/* the higher half of the kernel link maps + * at the top 2 GiB is where Limine maps us. */ + +OUTPUT_FORMAT(elf64-x86-64) +ENTRY(_start) + +PHDRS +{ + limine_requests PT_LOAD; + text PT_LOAD; + rodata PT_LOAD; + data PT_LOAD; +} + +SECTIONS +{ + . = 0xffffffff80000000; + + /* The loader hunts for the magic numbers here + * these are referenced in `boot/` */ + .limine_requests : { + KEEP(*(.limine_requests_start)) + KEEP(*(.limine_requests)) + KEEP(*(.limine_requests_end)) + } :limine_requests + + . = ALIGN(CONSTANT(MAXPAGESIZE)); + .text : { + *(.text .text.*) + } :text + + . = ALIGN(CONSTANT(MAXPAGESIZE)); + .rodata : { + *(.rodata .rodata.*) + } :rodata + + . = ALIGN(CONSTANT(MAXPAGESIZE)); + .data : { + *(.data .data.*) + } :data + + .bss : { + *(.bss .bss.*) + *(COMMON) + } :data + + /* no unwind tables or note sections. */ + /DISCARD/ : { + *(.eh_frame*) + *(.note .note.*) + } +} |
