diff options
Diffstat (limited to 'link')
-rw-r--r-- | link/x86_64-jove.ld | 52 |
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 = .; +} + |