Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* ld script to make s390 Linux kernel |
2 | * Written by Martin Schwidefsky (schwidefsky@de.ibm.com) | ||||
3 | */ | ||||
4 | |||||
Sam Ravnborg | 52480ee | 2007-10-12 16:11:50 +0200 | [diff] [blame] | 5 | #include <asm/page.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 6 | #include <asm-generic/vmlinux.lds.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 7 | |
Martin Schwidefsky | 347a8dc | 2006-01-06 00:19:28 -0800 | [diff] [blame] | 8 | #ifndef CONFIG_64BIT |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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 | |||||
Martin Schwidefsky | ea29ee1 | 2008-01-26 14:11:21 +0100 | [diff] [blame] | 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 | |||||
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 26 | SECTIONS |
27 | { | ||||
Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 28 | . = 0x00000000; |
29 | .text : { | ||||
30 | _text = .; /* Text and read-only data */ | ||||
31 | *(.text.head) | ||||
Sam Ravnborg | 7664709 | 2007-05-13 00:31:33 +0200 | [diff] [blame] | 32 | TEXT_TEXT |
Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 33 | SCHED_TEXT |
34 | LOCK_TEXT | ||||
35 | KPROBES_TEXT | ||||
36 | *(.fixup) | ||||
37 | *(.gnu.warning) | ||||
Heiko Carstens | a817a61 | 2008-02-05 16:50:38 +0100 | [diff] [blame] | 38 | } :text = 0x0700 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 39 | |
Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 40 | _etext = .; /* End of text section */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 41 | |
Martin Schwidefsky | ea29ee1 | 2008-01-26 14:11:21 +0100 | [diff] [blame] | 42 | NOTES :text :note |
Martin Schwidefsky | ea29ee1 | 2008-01-26 14:11:21 +0100 | [diff] [blame] | 43 | |
Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 44 | RODATA |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 45 | |
46 | #ifdef CONFIG_SHARED_KERNEL | ||||
Sam Ravnborg | 52480ee | 2007-10-12 16:11:50 +0200 | [diff] [blame] | 47 | . = ALIGN(0x100000); /* VM shared segments are 1MB aligned */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 48 | #endif |
49 | |||||
Sam Ravnborg | 52480ee | 2007-10-12 16:11:50 +0200 | [diff] [blame] | 50 | . = ALIGN(PAGE_SIZE); |
Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 51 | _eshared = .; /* End of shareable data */ |
Heiko Carstens | 162e006 | 2007-02-05 21:18:41 +0100 | [diff] [blame] | 52 | |
Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 53 | . = ALIGN(16); /* Exception table */ |
54 | __ex_table : { | ||||
55 | __start___ex_table = .; | ||||
56 | *(__ex_table) | ||||
57 | __stop___ex_table = .; | ||||
Heiko Carstens | 5453c1a | 2008-08-25 18:13:26 +0200 | [diff] [blame] | 58 | } :data |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 59 | |
Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 60 | .data : { /* Data */ |
61 | DATA_DATA | ||||
62 | CONSTRUCTORS | ||||
63 | } | ||||
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 64 | |
Sam Ravnborg | 52480ee | 2007-10-12 16:11:50 +0200 | [diff] [blame] | 65 | . = ALIGN(PAGE_SIZE); |
Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 66 | .data_nosave : { |
67 | __nosave_begin = .; | ||||
68 | *(.data.nosave) | ||||
69 | } | ||||
Sam Ravnborg | 52480ee | 2007-10-12 16:11:50 +0200 | [diff] [blame] | 70 | . = ALIGN(PAGE_SIZE); |
Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 71 | __nosave_end = .; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 72 | |
Sam Ravnborg | 52480ee | 2007-10-12 16:11:50 +0200 | [diff] [blame] | 73 | . = ALIGN(PAGE_SIZE); |
Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 74 | .data.page_aligned : { |
75 | *(.data.idt) | ||||
76 | } | ||||
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 77 | |
Sam Ravnborg | 52480ee | 2007-10-12 16:11:50 +0200 | [diff] [blame] | 78 | . = ALIGN(0x100); |
Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 79 | .data.cacheline_aligned : { |
80 | *(.data.cacheline_aligned) | ||||
81 | } | ||||
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 82 | |
Sam Ravnborg | 52480ee | 2007-10-12 16:11:50 +0200 | [diff] [blame] | 83 | . = ALIGN(0x100); |
Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 84 | .data.read_mostly : { |
85 | *(.data.read_mostly) | ||||
86 | } | ||||
87 | _edata = .; /* End of data section */ | ||||
Heiko Carstens | c0007f1 | 2007-04-27 16:01:42 +0200 | [diff] [blame] | 88 | |
Sam Ravnborg | 52480ee | 2007-10-12 16:11:50 +0200 | [diff] [blame] | 89 | . = ALIGN(2 * PAGE_SIZE); /* init_task */ |
Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 90 | .data.init_task : { |
91 | *(.data.init_task) | ||||
92 | } | ||||
93 | |||||
94 | /* will be freed after init */ | ||||
Sam Ravnborg | 52480ee | 2007-10-12 16:11:50 +0200 | [diff] [blame] | 95 | . = ALIGN(PAGE_SIZE); /* Init code and data */ |
Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 96 | __init_begin = .; |
97 | .init.text : { | ||||
98 | _sinittext = .; | ||||
Sam Ravnborg | 01ba2bd | 2008-01-20 14:15:03 +0100 | [diff] [blame] | 99 | INIT_TEXT |
Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 100 | _einittext = .; |
101 | } | ||||
102 | /* | ||||
103 | * .exit.text is discarded at runtime, not link time, | ||||
104 | * to deal with references from __bug_table | ||||
105 | */ | ||||
106 | .exit.text : { | ||||
Sam Ravnborg | 01ba2bd | 2008-01-20 14:15:03 +0100 | [diff] [blame] | 107 | EXIT_TEXT |
Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 108 | } |
109 | |||||
110 | .init.data : { | ||||
Sam Ravnborg | 01ba2bd | 2008-01-20 14:15:03 +0100 | [diff] [blame] | 111 | INIT_DATA |
Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 112 | } |
Sam Ravnborg | 52480ee | 2007-10-12 16:11:50 +0200 | [diff] [blame] | 113 | . = ALIGN(0x100); |
Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 114 | .init.setup : { |
115 | __setup_start = .; | ||||
116 | *(.init.setup) | ||||
117 | __setup_end = .; | ||||
118 | } | ||||
119 | .initcall.init : { | ||||
120 | __initcall_start = .; | ||||
121 | INITCALLS | ||||
122 | __initcall_end = .; | ||||
123 | } | ||||
124 | |||||
125 | .con_initcall.init : { | ||||
126 | __con_initcall_start = .; | ||||
127 | *(.con_initcall.init) | ||||
128 | __con_initcall_end = .; | ||||
129 | } | ||||
130 | SECURITY_INIT | ||||
Jean-Paul Saman | 67d3822 | 2007-02-10 01:44:44 -0800 | [diff] [blame] | 131 | |
132 | #ifdef CONFIG_BLK_DEV_INITRD | ||||
Sam Ravnborg | 52480ee | 2007-10-12 16:11:50 +0200 | [diff] [blame] | 133 | . = ALIGN(0x100); |
Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 134 | .init.ramfs : { |
135 | __initramfs_start = .; | ||||
136 | *(.init.ramfs) | ||||
137 | . = ALIGN(2); | ||||
138 | __initramfs_end = .; | ||||
139 | } | ||||
Jean-Paul Saman | 67d3822 | 2007-02-10 01:44:44 -0800 | [diff] [blame] | 140 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 141 | |
Sam Ravnborg | 52480ee | 2007-10-12 16:11:50 +0200 | [diff] [blame] | 142 | PERCPU(PAGE_SIZE) |
143 | . = ALIGN(PAGE_SIZE); | ||||
Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 144 | __init_end = .; /* freed after init ends here */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 145 | |
Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 146 | /* BSS */ |
147 | .bss : { | ||||
148 | __bss_start = .; | ||||
149 | *(.bss) | ||||
150 | . = ALIGN(2); | ||||
151 | __bss_stop = .; | ||||
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 152 | } |
153 | |||||
Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 154 | _end = . ; |
155 | |||||
156 | /* Sections to be discarded */ | ||||
157 | /DISCARD/ : { | ||||
Sam Ravnborg | 01ba2bd | 2008-01-20 14:15:03 +0100 | [diff] [blame] | 158 | EXIT_DATA |
Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 159 | *(.exitcall.exit) |
160 | } | ||||
161 | |||||
162 | /* Debugging sections. */ | ||||
163 | STABS_DEBUG | ||||
164 | DWARF_DEBUG | ||||
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 165 | } |