diff options
| author | Aleksa Vuckovic <aleksa@vuckovic.cc> | 2023-12-13 01:38:14 +0100 |
|---|---|---|
| committer | Aleksa Vuckovic <aleksa@vuckovic.cc> | 2024-04-02 23:17:31 +0200 |
| commit | 36137438446c1754a522c5b3cc3aff92c43ac1ee (patch) | |
| tree | f7358ef0aec7023321e52e116f94fba95e52611f /arch/x86_64.ld | |
X86/X86_64 debug/release WORKING
riscv64 WORKING uart
idk
Diffstat (limited to 'arch/x86_64.ld')
| -rw-r--r-- | arch/x86_64.ld | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/arch/x86_64.ld b/arch/x86_64.ld new file mode 100644 index 0000000..da6663e --- /dev/null +++ b/arch/x86_64.ld @@ -0,0 +1,81 @@ +ENTRY(_start) + +KERNEL_AP_PMA = 0x0000000000008000; +KERNEL_PMA = 0x0000000000100000; +KERNEL_VMA = 0xffffffff80000000; + +SECTIONS +{ + /* + . = KERNEL_AP_PMA; + + .apinit BLOCK(4K) : ALIGN(4K) + { + *(.apinit) + } + */ + + . = KERNEL_PMA; + + .boot BLOCK(4K) : ALIGN(4K) + { + KEEP(*(.multiboot2.header)) + *(.boot32.text) + *(.boot32.rodata) + *(.boot32.bss) + *(.boot64.text) + } + + . += KERNEL_VMA; + + .text ALIGN(4K) : AT (ADDR (.text) - KERNEL_VMA) + { + *(.text) + } + + .rodata ALIGN(4K) : AT (ADDR (.rodata) - KERNEL_VMA) + { + *(.rodata) + } + + .rodata. ALIGN(4K) : AT (ADDR (.rodata.) - KERNEL_VMA) + { + *(.rodata.*) + } + + .data ALIGN(4K) : AT (ADDR (.data) - KERNEL_VMA) + { + *(.data) + } + + .bss ALIGN(4K) : AT (ADDR (.bss) - KERNEL_VMA) + { + *(.bss) + } + + .bss. ALIGN(4K) : AT (ADDR (.bss.) - KERNEL_VMA) + { + *(.bss.*) + } + + /DISCARD/ : + { + *(.debug_abbrev) + *(.debug_aranges) + *(.debug_frame) + *(.debug_gdb_scripts) + *(.debug_info) + *(.debug_line) + *(.debug_line_str) + *(.debug_loc) + *(.debug_pubnames) + *(.debug_pubtypes) + *(.debug_ranges) + *(.debug_str) + + *(.comment) + *(.note.*) + } + + _kernel_end = .; +} |
