summaryrefslogtreecommitdiffstats
path: root/link
diff options
context:
space:
mode:
authorJon Santmyer <jon@jonsantmyer.com>2024-03-11 21:30:31 -0400
committerJon Santmyer <jon@jonsantmyer.com>2024-03-11 21:30:31 -0400
commitd1ff7bcc91886626dc9060ec5fb67ee102ab7c1d (patch)
tree8f0b5cd8aad31089131785dc6e37b659490f9955 /link
downloadjove-kernel-d1ff7bcc91886626dc9060ec5fb67ee102ab7c1d.tar.gz
jove-kernel-d1ff7bcc91886626dc9060ec5fb67ee102ab7c1d.tar.bz2
jove-kernel-d1ff7bcc91886626dc9060ec5fb67ee102ab7c1d.zip
usermode capable kernel with logging syscall
Diffstat (limited to 'link')
-rw-r--r--link/x86_64-jove.ld52
1 files changed, 52 insertions, 0 deletions
diff --git a/link/x86_64-jove.ld b/link/x86_64-jove.ld
new file mode 100644
index 0000000..0686617
--- /dev/null
+++ b/link/x86_64-jove.ld
@@ -0,0 +1,52 @@
+OUTPUT_FORMAT(elf64-x86-64)
+OUTPUT_ARCH(i386:x86-64)
+
+ENTRY(_start)
+
+PAGESIZE = CONSTANT(MAXPAGESIZE);
+
+PHDRS
+{
+ text PT_LOAD FLAGS((1 << 0) | (1 << 2)) ; /* RO EX*/
+ rodata PT_LOAD FLAGS((1 << 2)) ; /* RO*/
+ data PT_LOAD FLAGS((1 << 1) | (1 << 2)); /* RW*/
+ bss PT_LOAD FLAGS((1 << 1) | (1 << 2)); /* RW*/
+}
+
+SECTIONS
+{
+ . = 0xFFFFFFFF80000000;
+ _kernel_start = .;
+
+ .text BLOCK(PAGESIZE) : ALIGN(PAGESIZE) {
+ *(.init)
+ *(.text .text.*)
+
+ . = ALIGN(8);
+ _kernel_ctors_start = .;
+ *(.ctors)
+ _kernel_ctors_end = .;
+
+ *(.fini)
+ } :text
+
+ .rodata BLOCK(PAGESIZE) : ALIGN(PAGESIZE) {
+ *(.rodata .rodata.*)
+ } :rodata
+
+ .data BLOCK(PAGESIZE) : ALIGN(PAGESIZE) {
+ *(.data .data.*)
+ } :data
+
+ .bss BLOCK(PAGESIZE) : ALIGN(PAGESIZE) {
+ *(COMMON)
+ *(.bss .bss.*)
+ } :bss
+
+ /DISCARD/ : {
+ *(.note .note.*)
+ }
+
+ _kernel_end = .;
+}
+