]>
Commit | Line | Data |
---|---|---|
1da177e4 LT |
1 | /* ld script to make s390 Linux kernel |
2 | * Written by Martin Schwidefsky (schwidefsky@de.ibm.com) | |
3 | */ | |
4 | ||
52480ee5 | 5 | #include <asm/page.h> |
1da177e4 | 6 | #include <asm-generic/vmlinux.lds.h> |
1da177e4 | 7 | |
347a8dc3 | 8 | #ifndef CONFIG_64BIT |
1da177e4 LT |
9 | OUTPUT_FORMAT("elf32-s390", "elf32-s390", "elf32-s390") |
10 | OUTPUT_ARCH(s390) | |
11 | ENTRY(_start) | |
12 | jiffies = jiffies_64 + 4; | |
13 | #else | |
14 | OUTPUT_FORMAT("elf64-s390", "elf64-s390", "elf64-s390") | |
15 | OUTPUT_ARCH(s390:64-bit) | |
16 | ENTRY(_start) | |
17 | jiffies = jiffies_64; | |
18 | #endif | |
19 | ||
ea29ee16 MS |
20 | PHDRS { |
21 | text PT_LOAD FLAGS(5); /* R_E */ | |
22 | data PT_LOAD FLAGS(7); /* RWE */ | |
23 | note PT_NOTE FLAGS(0); /* ___ */ | |
24 | } | |
25 | ||
1da177e4 LT |
26 | SECTIONS |
27 | { | |
e16af09d SR |
28 | . = 0x00000000; |
29 | .text : { | |
30 | _text = .; /* Text and read-only data */ | |
31 | *(.text.head) | |
7664709b | 32 | TEXT_TEXT |
e16af09d SR |
33 | SCHED_TEXT |
34 | LOCK_TEXT | |
35 | KPROBES_TEXT | |
36 | *(.fixup) | |
37 | *(.gnu.warning) | |
1da177e4 LT |
38 | } = 0x0700 |
39 | ||
e16af09d | 40 | _etext = .; /* End of text section */ |
1da177e4 | 41 | |
ea29ee16 MS |
42 | NOTES :text :note |
43 | BUG_TABLE :text | |
44 | ||
e16af09d | 45 | RODATA |
1da177e4 LT |
46 | |
47 | #ifdef CONFIG_SHARED_KERNEL | |
52480ee5 | 48 | . = ALIGN(0x100000); /* VM shared segments are 1MB aligned */ |
162e006e | 49 | #endif |
1da177e4 | 50 | |
52480ee5 | 51 | . = ALIGN(PAGE_SIZE); |
e16af09d SR |
52 | _eshared = .; /* End of shareable data */ |
53 | ||
54 | . = ALIGN(16); /* Exception table */ | |
55 | __ex_table : { | |
56 | __start___ex_table = .; | |
57 | *(__ex_table) | |
58 | __stop___ex_table = .; | |
59 | } | |
60 | ||
e16af09d SR |
61 | .data : { /* Data */ |
62 | DATA_DATA | |
63 | CONSTRUCTORS | |
64 | } | |
65 | ||
52480ee5 | 66 | . = ALIGN(PAGE_SIZE); |
e16af09d SR |
67 | .data_nosave : { |
68 | __nosave_begin = .; | |
69 | *(.data.nosave) | |
70 | } | |
52480ee5 | 71 | . = ALIGN(PAGE_SIZE); |
e16af09d SR |
72 | __nosave_end = .; |
73 | ||
52480ee5 | 74 | . = ALIGN(PAGE_SIZE); |
e16af09d SR |
75 | .data.page_aligned : { |
76 | *(.data.idt) | |
77 | } | |
78 | ||
52480ee5 | 79 | . = ALIGN(0x100); |
e16af09d SR |
80 | .data.cacheline_aligned : { |
81 | *(.data.cacheline_aligned) | |
82 | } | |
83 | ||
52480ee5 | 84 | . = ALIGN(0x100); |
e16af09d SR |
85 | .data.read_mostly : { |
86 | *(.data.read_mostly) | |
87 | } | |
88 | _edata = .; /* End of data section */ | |
89 | ||
52480ee5 | 90 | . = ALIGN(2 * PAGE_SIZE); /* init_task */ |
e16af09d SR |
91 | .data.init_task : { |
92 | *(.data.init_task) | |
93 | } | |
94 | ||
95 | /* will be freed after init */ | |
52480ee5 | 96 | . = ALIGN(PAGE_SIZE); /* Init code and data */ |
e16af09d SR |
97 | __init_begin = .; |
98 | .init.text : { | |
99 | _sinittext = .; | |
100 | *(.init.text) | |
101 | _einittext = .; | |
102 | } | |
103 | /* | |
104 | * .exit.text is discarded at runtime, not link time, | |
105 | * to deal with references from __bug_table | |
106 | */ | |
107 | .exit.text : { | |
108 | *(.exit.text) | |
109 | } | |
110 | ||
111 | .init.data : { | |
112 | *(.init.data) | |
113 | } | |
52480ee5 | 114 | . = ALIGN(0x100); |
e16af09d SR |
115 | .init.setup : { |
116 | __setup_start = .; | |
117 | *(.init.setup) | |
118 | __setup_end = .; | |
119 | } | |
120 | .initcall.init : { | |
121 | __initcall_start = .; | |
122 | INITCALLS | |
123 | __initcall_end = .; | |
124 | } | |
125 | ||
126 | .con_initcall.init : { | |
127 | __con_initcall_start = .; | |
128 | *(.con_initcall.init) | |
129 | __con_initcall_end = .; | |
130 | } | |
131 | SECURITY_INIT | |
67d38229 JPS |
132 | |
133 | #ifdef CONFIG_BLK_DEV_INITRD | |
52480ee5 | 134 | . = ALIGN(0x100); |
e16af09d SR |
135 | .init.ramfs : { |
136 | __initramfs_start = .; | |
137 | *(.init.ramfs) | |
138 | . = ALIGN(2); | |
139 | __initramfs_end = .; | |
140 | } | |
67d38229 | 141 | #endif |
e16af09d | 142 | |
52480ee5 SR |
143 | PERCPU(PAGE_SIZE) |
144 | . = ALIGN(PAGE_SIZE); | |
e16af09d SR |
145 | __init_end = .; /* freed after init ends here */ |
146 | ||
147 | /* BSS */ | |
148 | .bss : { | |
149 | __bss_start = .; | |
150 | *(.bss) | |
151 | . = ALIGN(2); | |
152 | __bss_stop = .; | |
153 | } | |
154 | ||
155 | _end = . ; | |
156 | ||
157 | /* Sections to be discarded */ | |
158 | /DISCARD/ : { | |
159 | *(.exit.data) | |
160 | *(.exitcall.exit) | |
161 | } | |
162 | ||
163 | /* Debugging sections. */ | |
164 | STABS_DEBUG | |
165 | DWARF_DEBUG | |
1da177e4 | 166 | } |