X-Git-Url: https://pd.if.org/git/?p=zos;a=blobdiff_plain;f=link64.ld;fp=link64.ld;h=f70d97a45848185ed2cee9f783045085710213ec;hp=0000000000000000000000000000000000000000;hb=ad37ae9264a7390aa6bbff5080ea3310f200c4d7;hpb=2591ad735d1b1c87facd251239141158f273b48c diff --git a/link64.ld b/link64.ld new file mode 100644 index 0000000..f70d97a --- /dev/null +++ b/link64.ld @@ -0,0 +1,70 @@ +KERNEL_VMA = 0xFFFFFFFF80000000 ; +KERNEL_LMA = 0x100000 ; + +ENTRY(_multiboot_entry) +SECTIONS +{ + . = KERNEL_LMA; + + .bootstrap : + { + boot32.o ( .multiboot ) + boot32.o (.text) + boot32.o (.data) + } + + . += KERNEL_VMA; /* += so that the code can just run, might be able to "org" the code */ + + .text : AT(ADDR(.text) - KERNEL_VMA) + { + _code = .; + *(EXCLUDE_FILE(*boot32.o) .text) + *(.rodata*) + . = ALIGN(4096); + } + + .data : AT(ADDR(.data) - KERNEL_VMA) + { + _data = .; + *(EXCLUDE_FILE(*boot32.o) .data) + . = ALIGN(8); + + _kernel_vma = .; + QUAD(KERNEL_VMA); + . += 8; + _kernel_end = .; + QUAD(KERNEL_END); + . += 8; + _kernel_phys_end = .; + QUAD(KERNEL_PHYS_END); + . += 8; + _kernel_size = .; + QUAD(KERNEL_SIZE); + . += 8; + + . = ALIGN(4096); + } + + .bss : AT(ADDR(.bss) - KERNEL_VMA) + { + _bss = .; + *(.bss) + + /* + * You usually need to include generated COMMON symbols + * under kernel BSS section or use gcc's -fno-common + */ + + *(COMMON) + . = ALIGN(4096); + } + + KERNEL_SIZE = . - KERNEL_VMA - KERNEL_LMA; + KERNEL_PHYS_END = . - KERNEL_VMA; + KERNEL_END = .; + + /DISCARD/ : + { + *(.comment) + } +}