x86_64: added linker script for the kernel.
* Based on the x86 one, changes made to match the default GCC x86_64 linker script and correct kernel load address added. * Not tested yet as the kernel doesn't fully compile.
This commit is contained in:
parent
2f3e39bebf
commit
0d916c34c4
55
src/system/ldscripts/x86_64/kernel.ld
Normal file
55
src/system/ldscripts/x86_64/kernel.ld
Normal file
@ -0,0 +1,55 @@
|
||||
OUTPUT_FORMAT("elf64-x86-64")
|
||||
OUTPUT_ARCH("i386:x86-64")
|
||||
|
||||
ENTRY(_start)
|
||||
SECTIONS
|
||||
{
|
||||
. = 0xFFFFFF8000000000 + SIZEOF_HEADERS;
|
||||
|
||||
.interp : { *(.interp) }
|
||||
.hash : { *(.hash) }
|
||||
.dynsym : { *(.dynsym) }
|
||||
.dynstr : { *(.dynstr) }
|
||||
.rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
|
||||
.rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
|
||||
.rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
|
||||
.rela.got : { *(.rela.got) }
|
||||
.rela.ctors : { *(.rela.ctors) }
|
||||
.rela.dtors : { *(.rela.dtors) }
|
||||
.rela.init : { *(.rela.init) }
|
||||
.rela.fini : { *(.rela.fini) }
|
||||
.rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
|
||||
.rela.plt : { *(.rela.plt) }
|
||||
.init : { *(.init) } =0x90909090
|
||||
.plt : { *(.plt) }
|
||||
|
||||
/* text/read-only data */
|
||||
.text : { *(.text .text.* .gnu.linkonce.t.*) } =0x90909090
|
||||
|
||||
.rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
|
||||
|
||||
/* writable data */
|
||||
. = ALIGN(0x1000);
|
||||
__data_start = .;
|
||||
.data : { *(.data .data.* .gnu.linkonce.d.*) }
|
||||
|
||||
. = ALIGN(0x4);
|
||||
__ctor_list = .;
|
||||
.ctors : { *(.ctors) }
|
||||
__ctor_end = .;
|
||||
__dtor_list = .;
|
||||
.dtors : { *(.dtors) }
|
||||
__dtor_end = .;
|
||||
.got : { *(.got.plt) *(.got) }
|
||||
.dynamic : { *(.dynamic) }
|
||||
|
||||
/* uninitialized data (in same segment as writable data) */
|
||||
__bss_start = .;
|
||||
.bss : { *(.bss .bss.* .gnu.linkonce.b.*) }
|
||||
|
||||
. = ALIGN(0x1000);
|
||||
_end = . ;
|
||||
|
||||
/* Strip unnecessary stuff */
|
||||
/DISCARD/ : { *(.comment .note .eh_frame) }
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user