summaryrefslogtreecommitdiffstats
path: root/link/x86_64-elf.ld
diff options
context:
space:
mode:
authorJon Santmyer <jon@jonsantmyer.com>2026-09-04 11:31:40 -0400
committerJon Santmyer <jon@jonsantmyer.com>2026-09-04 11:31:40 -0400
commit8251da342161767fe203627223ccd4a7026701c6 (patch)
treeaf2db0f11b0ea8ad35f88663a855bab39a80f679 /link/x86_64-elf.ld
downloadjove-kernel-8251da342161767fe203627223ccd4a7026701c6.tar.gz
jove-kernel-8251da342161767fe203627223ccd4a7026701c6.tar.bz2
jove-kernel-8251da342161767fe203627223ccd4a7026701c6.zip
initial commit. working on tasking
Diffstat (limited to 'link/x86_64-elf.ld')
-rw-r--r--link/x86_64-elf.ld60
1 files changed, 60 insertions, 0 deletions
diff --git a/link/x86_64-elf.ld b/link/x86_64-elf.ld
new file mode 100644
index 0000000..6c38b47
--- /dev/null
+++ b/link/x86_64-elf.ld
@@ -0,0 +1,60 @@
+OUTPUT_FORMAT(elf64-x86-64)
+OUTPUT_ARCH(i386:x86-64)
+
+ENTRY(_start)
+
+PAGESIZE = CONSTANT(MAXPAGESIZE);
+
+PHDRS
+{
+ limine_requests PT_LOAD;
+ text PT_LOAD;
+ rodata PT_LOAD;
+ data PT_LOAD;
+ bss PT_LOAD;
+}
+
+SECTIONS
+{
+ . = 0xFFFFFFFF80000000;
+ _kernel_start = .;
+
+ _kernel_text_start = .;
+ .text : {
+ *(.init)
+ *(.text .text.*)
+ *(.fini)
+ } :text
+ _kernel_text_end = .;
+ . = ALIGN(PAGESIZE);
+
+ _kernel_rodata_start = .;
+ .rodata : {
+ *(.rodata .rodata.*)
+ } :rodata
+ _kernel_rodata_end = .;
+ . = ALIGN(PAGESIZE);
+
+ _kernel_data_start = .;
+ .data : {
+ *(.data .data.*)
+ *(.limine_requests)
+ } :data
+ _kernel_data_end = .;
+ . = ALIGN(PAGESIZE);
+
+ _kernel_bss_start = .;
+ .bss : {
+ *(COMMON)
+ *(.bss .bss.*)
+ } :bss
+ _kernel_bss_end = .;
+
+ /DISCARD/ : {
+ *(.eh_frame*)
+ *(.note .note.*)
+ }
+
+ _kernel_end = .;
+}
+