blob: 607bd67a18ce782f21051e4e306f8feced721719 [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
Martin Schwidefskyea29ee12008-01-26 14:11:21 +010020PHDRS {
21 text PT_LOAD FLAGS(5); /* R_E */
22 data PT_LOAD FLAGS(7); /* RWE */
23 note PT_NOTE FLAGS(0); /* ___ */
24}
25
Linus Torvalds1da177e2005-04-16 15:20:36 -070026SECTIONS
27{
Sam Ravnborge16af092007-10-12 16:11:49 +020028 . = 0x00000000;
29 .text : {
30 _text = .; /* Text and read-only data */
31 *(.text.head)
Sam Ravnborg76647092007-05-13 00:31:33 +020032 TEXT_TEXT
Sam Ravnborge16af092007-10-12 16:11:49 +020033 SCHED_TEXT
34 LOCK_TEXT
35 KPROBES_TEXT
36 *(.fixup)
37 *(.gnu.warning)
Heiko Carstensa817a612008-02-05 16:50:38 +010038 } :text = 0x0700
Linus Torvalds1da177e2005-04-16 15:20:36 -070039
Sam Ravnborge16af092007-10-12 16:11:49 +020040 _etext = .; /* End of text section */
Linus Torvalds1da177e2005-04-16 15:20:36 -070041
Martin Schwidefskyea29ee12008-01-26 14:11:21 +010042 NOTES :text :note
Martin Schwidefskyea29ee12008-01-26 14:11:21 +010043
Sam Ravnborge16af092007-10-12 16:11:49 +020044 RODATA
Linus Torvalds1da177e2005-04-16 15:20:36 -070045
46#ifdef CONFIG_SHARED_KERNEL
Sam Ravnborg52480ee2007-10-12 16:11:50 +020047 . = ALIGN(0x100000); /* VM shared segments are 1MB aligned */
Linus Torvalds1da177e2005-04-16 15:20:36 -070048#endif
49
Sam Ravnborg52480ee2007-10-12 16:11:50 +020050 . = ALIGN(PAGE_SIZE);
Sam Ravnborge16af092007-10-12 16:11:49 +020051 _eshared = .; /* End of shareable data */
Heiko Carstens162e0062007-02-05 21:18:41 +010052
Sam Ravnborge16af092007-10-12 16:11:49 +020053 . = ALIGN(16); /* Exception table */
54 __ex_table : {
55 __start___ex_table = .;
56 *(__ex_table)
57 __stop___ex_table = .;
Heiko Carstens5453c1a2008-08-25 18:13:26 +020058 } :data
Linus Torvalds1da177e2005-04-16 15:20:36 -070059
Sam Ravnborge16af092007-10-12 16:11:49 +020060 .data : { /* Data */
61 DATA_DATA
62 CONSTRUCTORS
63 }
Linus Torvalds1da177e2005-04-16 15:20:36 -070064
Sam Ravnborg52480ee2007-10-12 16:11:50 +020065 . = ALIGN(PAGE_SIZE);
Sam Ravnborge16af092007-10-12 16:11:49 +020066 .data_nosave : {
67 __nosave_begin = .;
68 *(.data.nosave)
69 }
Sam Ravnborg52480ee2007-10-12 16:11:50 +020070 . = ALIGN(PAGE_SIZE);
Sam Ravnborge16af092007-10-12 16:11:49 +020071 __nosave_end = .;
Linus Torvalds1da177e2005-04-16 15:20:36 -070072
Sam Ravnborg52480ee2007-10-12 16:11:50 +020073 . = ALIGN(PAGE_SIZE);
Sam Ravnborge16af092007-10-12 16:11:49 +020074 .data.page_aligned : {
75 *(.data.idt)
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.cacheline_aligned : {
80 *(.data.cacheline_aligned)
81 }
Linus Torvalds1da177e2005-04-16 15:20:36 -070082
Sam Ravnborg52480ee2007-10-12 16:11:50 +020083 . = ALIGN(0x100);
Sam Ravnborge16af092007-10-12 16:11:49 +020084 .data.read_mostly : {
85 *(.data.read_mostly)
86 }
87 _edata = .; /* End of data section */
Heiko Carstensc0007f12007-04-27 16:01:42 +020088
Sam Ravnborg52480ee2007-10-12 16:11:50 +020089 . = ALIGN(2 * PAGE_SIZE); /* init_task */
Sam Ravnborge16af092007-10-12 16:11:49 +020090 .data.init_task : {
91 *(.data.init_task)
92 }
93
94 /* will be freed after init */
Sam Ravnborg52480ee2007-10-12 16:11:50 +020095 . = ALIGN(PAGE_SIZE); /* Init code and data */
Sam Ravnborge16af092007-10-12 16:11:49 +020096 __init_begin = .;
97 .init.text : {
98 _sinittext = .;
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +010099 INIT_TEXT
Sam Ravnborge16af092007-10-12 16:11:49 +0200100 _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 Ravnborg01ba2bd2008-01-20 14:15:03 +0100107 EXIT_TEXT
Sam Ravnborge16af092007-10-12 16:11:49 +0200108 }
109
110 .init.data : {
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +0100111 INIT_DATA
Sam Ravnborge16af092007-10-12 16:11:49 +0200112 }
Sam Ravnborg52480ee2007-10-12 16:11:50 +0200113 . = ALIGN(0x100);
Sam Ravnborge16af092007-10-12 16:11:49 +0200114 .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 Saman67d38222007-02-10 01:44:44 -0800131
132#ifdef CONFIG_BLK_DEV_INITRD
Sam Ravnborg52480ee2007-10-12 16:11:50 +0200133 . = ALIGN(0x100);
Sam Ravnborge16af092007-10-12 16:11:49 +0200134 .init.ramfs : {
135 __initramfs_start = .;
136 *(.init.ramfs)
137 . = ALIGN(2);
138 __initramfs_end = .;
139 }
Jean-Paul Saman67d38222007-02-10 01:44:44 -0800140#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700141
Sam Ravnborg52480ee2007-10-12 16:11:50 +0200142 PERCPU(PAGE_SIZE)
143 . = ALIGN(PAGE_SIZE);
Sam Ravnborge16af092007-10-12 16:11:49 +0200144 __init_end = .; /* freed after init ends here */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700145
Sam Ravnborge16af092007-10-12 16:11:49 +0200146 /* BSS */
147 .bss : {
148 __bss_start = .;
149 *(.bss)
150 . = ALIGN(2);
151 __bss_stop = .;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700152 }
153
Sam Ravnborge16af092007-10-12 16:11:49 +0200154 _end = . ;
155
156 /* Sections to be discarded */
157 /DISCARD/ : {
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +0100158 EXIT_DATA
Sam Ravnborge16af092007-10-12 16:11:49 +0200159 *(.exitcall.exit)
160 }
161
162 /* Debugging sections. */
163 STABS_DEBUG
164 DWARF_DEBUG
Linus Torvalds1da177e2005-04-16 15:20:36 -0700165}