blob: 849120e3e28a0b6e7c2dddaa16c82e09dc086bc9 [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
Sam Ravnborg52480ee2007-10-12 16:11:50 +02005#include <asm/page.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07006#include <asm-generic/vmlinux.lds.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07007
Martin Schwidefsky347a8dc2006-01-06 00:19:28 -08008#ifndef CONFIG_64BIT
Linus Torvalds1da177e2005-04-16 15:20:36 -07009OUTPUT_FORMAT("elf32-s390", "elf32-s390", "elf32-s390")
10OUTPUT_ARCH(s390)
11ENTRY(_start)
12jiffies = jiffies_64 + 4;
13#else
14OUTPUT_FORMAT("elf64-s390", "elf64-s390", "elf64-s390")
15OUTPUT_ARCH(s390:64-bit)
16ENTRY(_start)
17jiffies = jiffies_64;
18#endif
19
20SECTIONS
21{
Sam Ravnborge16af092007-10-12 16:11:49 +020022 . = 0x00000000;
23 .text : {
24 _text = .; /* Text and read-only data */
25 *(.text.head)
Sam Ravnborg76647092007-05-13 00:31:33 +020026 TEXT_TEXT
Sam Ravnborge16af092007-10-12 16:11:49 +020027 SCHED_TEXT
28 LOCK_TEXT
29 KPROBES_TEXT
30 *(.fixup)
31 *(.gnu.warning)
Linus Torvalds1da177e2005-04-16 15:20:36 -070032 } = 0x0700
33
Sam Ravnborge16af092007-10-12 16:11:49 +020034 _etext = .; /* End of text section */
Linus Torvalds1da177e2005-04-16 15:20:36 -070035
Sam Ravnborge16af092007-10-12 16:11:49 +020036 RODATA
Linus Torvalds1da177e2005-04-16 15:20:36 -070037
38#ifdef CONFIG_SHARED_KERNEL
Sam Ravnborg52480ee2007-10-12 16:11:50 +020039 . = ALIGN(0x100000); /* VM shared segments are 1MB aligned */
Linus Torvalds1da177e2005-04-16 15:20:36 -070040#endif
41
Sam Ravnborg52480ee2007-10-12 16:11:50 +020042 . = ALIGN(PAGE_SIZE);
Sam Ravnborge16af092007-10-12 16:11:49 +020043 _eshared = .; /* End of shareable data */
Heiko Carstens162e0062007-02-05 21:18:41 +010044
Sam Ravnborge16af092007-10-12 16:11:49 +020045 . = ALIGN(16); /* Exception table */
46 __ex_table : {
47 __start___ex_table = .;
48 *(__ex_table)
49 __stop___ex_table = .;
Linus Torvalds1da177e2005-04-16 15:20:36 -070050 }
51
Sam Ravnborge16af092007-10-12 16:11:49 +020052 NOTES
53 BUG_TABLE
Linus Torvalds1da177e2005-04-16 15:20:36 -070054
Sam Ravnborge16af092007-10-12 16:11:49 +020055 .data : { /* Data */
56 DATA_DATA
57 CONSTRUCTORS
58 }
Linus Torvalds1da177e2005-04-16 15:20:36 -070059
Sam Ravnborg52480ee2007-10-12 16:11:50 +020060 . = ALIGN(PAGE_SIZE);
Sam Ravnborge16af092007-10-12 16:11:49 +020061 .data_nosave : {
62 __nosave_begin = .;
63 *(.data.nosave)
64 }
Sam Ravnborg52480ee2007-10-12 16:11:50 +020065 . = ALIGN(PAGE_SIZE);
Sam Ravnborge16af092007-10-12 16:11:49 +020066 __nosave_end = .;
Linus Torvalds1da177e2005-04-16 15:20:36 -070067
Sam Ravnborg52480ee2007-10-12 16:11:50 +020068 . = ALIGN(PAGE_SIZE);
Sam Ravnborge16af092007-10-12 16:11:49 +020069 .data.page_aligned : {
70 *(.data.idt)
71 }
Linus Torvalds1da177e2005-04-16 15:20:36 -070072
Sam Ravnborg52480ee2007-10-12 16:11:50 +020073 . = ALIGN(0x100);
Sam Ravnborge16af092007-10-12 16:11:49 +020074 .data.cacheline_aligned : {
75 *(.data.cacheline_aligned)
76 }
Linus Torvalds1da177e2005-04-16 15:20:36 -070077
Sam Ravnborg52480ee2007-10-12 16:11:50 +020078 . = ALIGN(0x100);
Sam Ravnborge16af092007-10-12 16:11:49 +020079 .data.read_mostly : {
80 *(.data.read_mostly)
81 }
82 _edata = .; /* End of data section */
Heiko Carstensc0007f12007-04-27 16:01:42 +020083
Sam Ravnborg52480ee2007-10-12 16:11:50 +020084 . = ALIGN(2 * PAGE_SIZE); /* init_task */
Sam Ravnborge16af092007-10-12 16:11:49 +020085 .data.init_task : {
86 *(.data.init_task)
87 }
88
89 /* will be freed after init */
Sam Ravnborg52480ee2007-10-12 16:11:50 +020090 . = ALIGN(PAGE_SIZE); /* Init code and data */
Sam Ravnborge16af092007-10-12 16:11:49 +020091 __init_begin = .;
92 .init.text : {
93 _sinittext = .;
94 *(.init.text)
95 _einittext = .;
96 }
97 /*
98 * .exit.text is discarded at runtime, not link time,
99 * to deal with references from __bug_table
100 */
101 .exit.text : {
102 *(.exit.text)
103 }
104
105 .init.data : {
106 *(.init.data)
107 }
Sam Ravnborg52480ee2007-10-12 16:11:50 +0200108 . = ALIGN(0x100);
Sam Ravnborge16af092007-10-12 16:11:49 +0200109 .init.setup : {
110 __setup_start = .;
111 *(.init.setup)
112 __setup_end = .;
113 }
114 .initcall.init : {
115 __initcall_start = .;
116 INITCALLS
117 __initcall_end = .;
118 }
119
120 .con_initcall.init : {
121 __con_initcall_start = .;
122 *(.con_initcall.init)
123 __con_initcall_end = .;
124 }
125 SECURITY_INIT
Jean-Paul Saman67d38222007-02-10 01:44:44 -0800126
127#ifdef CONFIG_BLK_DEV_INITRD
Sam Ravnborg52480ee2007-10-12 16:11:50 +0200128 . = ALIGN(0x100);
Sam Ravnborge16af092007-10-12 16:11:49 +0200129 .init.ramfs : {
130 __initramfs_start = .;
131 *(.init.ramfs)
132 . = ALIGN(2);
133 __initramfs_end = .;
134 }
Jean-Paul Saman67d38222007-02-10 01:44:44 -0800135#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700136
Sam Ravnborg52480ee2007-10-12 16:11:50 +0200137 PERCPU(PAGE_SIZE)
138 . = ALIGN(PAGE_SIZE);
Sam Ravnborge16af092007-10-12 16:11:49 +0200139 __init_end = .; /* freed after init ends here */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700140
Sam Ravnborge16af092007-10-12 16:11:49 +0200141 /* BSS */
142 .bss : {
143 __bss_start = .;
144 *(.bss)
145 . = ALIGN(2);
146 __bss_stop = .;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700147 }
148
Sam Ravnborge16af092007-10-12 16:11:49 +0200149 _end = . ;
150
151 /* Sections to be discarded */
152 /DISCARD/ : {
153 *(.exit.data)
154 *(.exitcall.exit)
155 }
156
157 /* Debugging sections. */
158 STABS_DEBUG
159 DWARF_DEBUG
Linus Torvalds1da177e2005-04-16 15:20:36 -0700160}