blob: f6b16aec32e7dd71bd129ba506fe08202c62660a [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/* ld script to make s390 Linux kernel
2 * Written by Martin Schwidefsky (schwidefsky@de.ibm.com)
3 */
4
5#include <asm-generic/vmlinux.lds.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07006
Martin Schwidefsky347a8dc2006-01-06 00:19:28 -08007#ifndef CONFIG_64BIT
Linus Torvalds1da177e2005-04-16 15:20:36 -07008OUTPUT_FORMAT("elf32-s390", "elf32-s390", "elf32-s390")
9OUTPUT_ARCH(s390)
10ENTRY(_start)
11jiffies = jiffies_64 + 4;
12#else
13OUTPUT_FORMAT("elf64-s390", "elf64-s390", "elf64-s390")
14OUTPUT_ARCH(s390:64-bit)
15ENTRY(_start)
16jiffies = jiffies_64;
17#endif
18
19SECTIONS
20{
Sam Ravnborge16af092007-10-12 16:11:49 +020021 . = 0x00000000;
22 .text : {
23 _text = .; /* Text and read-only data */
24 *(.text.head)
Sam Ravnborg76647092007-05-13 00:31:33 +020025 TEXT_TEXT
Sam Ravnborge16af092007-10-12 16:11:49 +020026 SCHED_TEXT
27 LOCK_TEXT
28 KPROBES_TEXT
29 *(.fixup)
30 *(.gnu.warning)
Linus Torvalds1da177e2005-04-16 15:20:36 -070031 } = 0x0700
32
Sam Ravnborge16af092007-10-12 16:11:49 +020033 _etext = .; /* End of text section */
Linus Torvalds1da177e2005-04-16 15:20:36 -070034
Sam Ravnborge16af092007-10-12 16:11:49 +020035 RODATA
Linus Torvalds1da177e2005-04-16 15:20:36 -070036
37#ifdef CONFIG_SHARED_KERNEL
Sam Ravnborge16af092007-10-12 16:11:49 +020038 . = ALIGN(1048576); /* VM shared segments are 1MB aligned */
Linus Torvalds1da177e2005-04-16 15:20:36 -070039#endif
40
Sam Ravnborge16af092007-10-12 16:11:49 +020041 . = ALIGN(4096);
42 _eshared = .; /* End of shareable data */
Heiko Carstens162e0062007-02-05 21:18:41 +010043
Sam Ravnborge16af092007-10-12 16:11:49 +020044 . = ALIGN(16); /* Exception table */
45 __ex_table : {
46 __start___ex_table = .;
47 *(__ex_table)
48 __stop___ex_table = .;
Linus Torvalds1da177e2005-04-16 15:20:36 -070049 }
50
Sam Ravnborge16af092007-10-12 16:11:49 +020051 NOTES
52 BUG_TABLE
Linus Torvalds1da177e2005-04-16 15:20:36 -070053
Sam Ravnborge16af092007-10-12 16:11:49 +020054 .data : { /* Data */
55 DATA_DATA
56 CONSTRUCTORS
57 }
Linus Torvalds1da177e2005-04-16 15:20:36 -070058
Sam Ravnborge16af092007-10-12 16:11:49 +020059 . = ALIGN(4096);
60 .data_nosave : {
61 __nosave_begin = .;
62 *(.data.nosave)
63 }
64 . = ALIGN(4096);
65 __nosave_end = .;
Linus Torvalds1da177e2005-04-16 15:20:36 -070066
Sam Ravnborge16af092007-10-12 16:11:49 +020067 . = ALIGN(4096);
68 .data.page_aligned : {
69 *(.data.idt)
70 }
Linus Torvalds1da177e2005-04-16 15:20:36 -070071
Sam Ravnborge16af092007-10-12 16:11:49 +020072 . = ALIGN(256);
73 .data.cacheline_aligned : {
74 *(.data.cacheline_aligned)
75 }
Linus Torvalds1da177e2005-04-16 15:20:36 -070076
Sam Ravnborge16af092007-10-12 16:11:49 +020077 . = ALIGN(256);
78 .data.read_mostly : {
79 *(.data.read_mostly)
80 }
81 _edata = .; /* End of data section */
Heiko Carstensc0007f12007-04-27 16:01:42 +020082
Sam Ravnborge16af092007-10-12 16:11:49 +020083 . = ALIGN(8192); /* init_task */
84 .data.init_task : {
85 *(.data.init_task)
86 }
87
88 /* will be freed after init */
89 . = ALIGN(4096); /* Init code and data */
90 __init_begin = .;
91 .init.text : {
92 _sinittext = .;
93 *(.init.text)
94 _einittext = .;
95 }
96 /*
97 * .exit.text is discarded at runtime, not link time,
98 * to deal with references from __bug_table
99 */
100 .exit.text : {
101 *(.exit.text)
102 }
103
104 .init.data : {
105 *(.init.data)
106 }
107 . = ALIGN(256);
108 .init.setup : {
109 __setup_start = .;
110 *(.init.setup)
111 __setup_end = .;
112 }
113 .initcall.init : {
114 __initcall_start = .;
115 INITCALLS
116 __initcall_end = .;
117 }
118
119 .con_initcall.init : {
120 __con_initcall_start = .;
121 *(.con_initcall.init)
122 __con_initcall_end = .;
123 }
124 SECURITY_INIT
Jean-Paul Saman67d38222007-02-10 01:44:44 -0800125
126#ifdef CONFIG_BLK_DEV_INITRD
Sam Ravnborge16af092007-10-12 16:11:49 +0200127 . = ALIGN(256);
128 .init.ramfs : {
129 __initramfs_start = .;
130 *(.init.ramfs)
131 . = ALIGN(2);
132 __initramfs_end = .;
133 }
Jean-Paul Saman67d38222007-02-10 01:44:44 -0800134#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700135
Sam Ravnborge16af092007-10-12 16:11:49 +0200136 PERCPU(4096)
137 . = ALIGN(4096);
138 __init_end = .; /* freed after init ends here */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700139
Sam Ravnborge16af092007-10-12 16:11:49 +0200140 /* BSS */
141 .bss : {
142 __bss_start = .;
143 *(.bss)
144 . = ALIGN(2);
145 __bss_stop = .;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700146 }
147
Sam Ravnborge16af092007-10-12 16:11:49 +0200148 _end = . ;
149
150 /* Sections to be discarded */
151 /DISCARD/ : {
152 *(.exit.data)
153 *(.exitcall.exit)
154 }
155
156 /* Debugging sections. */
157 STABS_DEBUG
158 DWARF_DEBUG
Linus Torvalds1da177e2005-04-16 15:20:36 -0700159}