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