]> pd.if.org Git - zos/blob - link64.ld
add a readme with a public domain note
[zos] / link64.ld
1 KERNEL_VMA = 0xFFFFFFFF80000000 ;
2 KERNEL_LMA = 0x100000 ;
3
4 ENTRY(_multiboot_entry)
5 SECTIONS
6 {
7         . = KERNEL_LMA;
8
9         .bootstrap :
10         {
11                 boot32.o ( .multiboot )
12                 boot32.o (.text)
13                 boot32.o (.data)
14         }
15
16         . += KERNEL_VMA; /* += so that the code can just run, might be able to "org" the code */
17
18         .text : AT(ADDR(.text) - KERNEL_VMA)
19         {
20                 _code = .;
21                 *(EXCLUDE_FILE(*boot32.o) .text)
22                 *(.rodata*)
23                 . = ALIGN(4096);
24         }
25
26         .data : AT(ADDR(.data) - KERNEL_VMA)
27         {
28                 _data = .;
29                 *(EXCLUDE_FILE(*boot32.o) .data)
30                 . = ALIGN(8);
31
32                 _kernel_vma = .;
33                 QUAD(KERNEL_VMA);
34                 . += 8;
35                 _kernel_end = .;
36                 QUAD(KERNEL_END);
37                 . += 8;
38                 _kernel_phys_end = .;
39                 QUAD(KERNEL_PHYS_END);
40                 . += 8;
41                 _kernel_size = .;
42                 QUAD(KERNEL_SIZE);
43                 . += 8;
44
45                 . = ALIGN(4096);
46         }
47
48         .bss : AT(ADDR(.bss) - KERNEL_VMA)
49         {
50                 _bss = .;
51                 *(.bss)
52
53                 /*
54                 * You usually need to include generated COMMON symbols
55                 * under kernel BSS section or use gcc's -fno-common
56                 */
57
58                 *(COMMON)
59                 . = ALIGN(4096);
60         }
61
62         KERNEL_SIZE = . - KERNEL_VMA - KERNEL_LMA;
63         KERNEL_PHYS_END = . - KERNEL_VMA;
64         KERNEL_END = .;
65
66         /DISCARD/ :
67         {
68                 *(.comment)
69         }
70 }