blob: b4607155e8d0b930c98b8a913d050a08d47b9e4a [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
43 BUG_TABLE :text
44
Sam Ravnborge16af092007-10-12 16:11:49 +020045 RODATA
Linus Torvalds1da177e2005-04-16 15:20:36 -070046
47#ifdef CONFIG_SHARED_KERNEL
Sam Ravnborg52480ee2007-10-12 16:11:50 +020048 . = ALIGN(0x100000); /* VM shared segments are 1MB aligned */
Linus Torvalds1da177e2005-04-16 15:20:36 -070049#endif
50
Sam Ravnborg52480ee2007-10-12 16:11:50 +020051 . = ALIGN(PAGE_SIZE);
Sam Ravnborge16af092007-10-12 16:11:49 +020052 _eshared = .; /* End of shareable data */
Heiko Carstens162e0062007-02-05 21:18:41 +010053
Sam Ravnborge16af092007-10-12 16:11:49 +020054 . = ALIGN(16); /* Exception table */
55 __ex_table : {
56 __start___ex_table = .;
57 *(__ex_table)
58 __stop___ex_table = .;
Linus Torvalds1da177e2005-04-16 15:20:36 -070059 }
60
Sam Ravnborge16af092007-10-12 16:11:49 +020061 .data : { /* Data */
62 DATA_DATA
63 CONSTRUCTORS
64 }
Linus Torvalds1da177e2005-04-16 15:20:36 -070065
Sam Ravnborg52480ee2007-10-12 16:11:50 +020066 . = ALIGN(PAGE_SIZE);
Sam Ravnborge16af092007-10-12 16:11:49 +020067 .data_nosave : {
68 __nosave_begin = .;
69 *(.data.nosave)
70 }
Sam Ravnborg52480ee2007-10-12 16:11:50 +020071 . = ALIGN(PAGE_SIZE);
Sam Ravnborge16af092007-10-12 16:11:49 +020072 __nosave_end = .;
Linus Torvalds1da177e2005-04-16 15:20:36 -070073
Sam Ravnborg52480ee2007-10-12 16:11:50 +020074 . = ALIGN(PAGE_SIZE);
Sam Ravnborge16af092007-10-12 16:11:49 +020075 .data.page_aligned : {
76 *(.data.idt)
77 }
Linus Torvalds1da177e2005-04-16 15:20:36 -070078
Sam Ravnborg52480ee2007-10-12 16:11:50 +020079 . = ALIGN(0x100);
Sam Ravnborge16af092007-10-12 16:11:49 +020080 .data.cacheline_aligned : {
81 *(.data.cacheline_aligned)
82 }
Linus Torvalds1da177e2005-04-16 15:20:36 -070083
Sam Ravnborg52480ee2007-10-12 16:11:50 +020084 . = ALIGN(0x100);
Sam Ravnborge16af092007-10-12 16:11:49 +020085 .data.read_mostly : {
86 *(.data.read_mostly)
87 }
88 _edata = .; /* End of data section */
Heiko Carstensc0007f12007-04-27 16:01:42 +020089
Sam Ravnborg52480ee2007-10-12 16:11:50 +020090 . = ALIGN(2 * PAGE_SIZE); /* init_task */
Sam Ravnborge16af092007-10-12 16:11:49 +020091 .data.init_task : {
92 *(.data.init_task)
93 }
94
95 /* will be freed after init */
Sam Ravnborg52480ee2007-10-12 16:11:50 +020096 . = ALIGN(PAGE_SIZE); /* Init code and data */
Sam Ravnborge16af092007-10-12 16:11:49 +020097 __init_begin = .;
98 .init.text : {
99 _sinittext = .;
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +0100100 INIT_TEXT
Sam Ravnborge16af092007-10-12 16:11:49 +0200101 _einittext = .;
102 }
103 /*
104 * .exit.text is discarded at runtime, not link time,
105 * to deal with references from __bug_table
106 */
107 .exit.text : {
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +0100108 EXIT_TEXT
Sam Ravnborge16af092007-10-12 16:11:49 +0200109 }
110
111 .init.data : {
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +0100112 INIT_DATA
Sam Ravnborge16af092007-10-12 16:11:49 +0200113 }
Sam Ravnborg52480ee2007-10-12 16:11:50 +0200114 . = ALIGN(0x100);
Sam Ravnborge16af092007-10-12 16:11:49 +0200115 .init.setup : {
116 __setup_start = .;
117 *(.init.setup)
118 __setup_end = .;
119 }
120 .initcall.init : {
121 __initcall_start = .;
122 INITCALLS
123 __initcall_end = .;
124 }
125
126 .con_initcall.init : {
127 __con_initcall_start = .;
128 *(.con_initcall.init)
129 __con_initcall_end = .;
130 }
131 SECURITY_INIT
Jean-Paul Saman67d38222007-02-10 01:44:44 -0800132
133#ifdef CONFIG_BLK_DEV_INITRD
Sam Ravnborg52480ee2007-10-12 16:11:50 +0200134 . = ALIGN(0x100);
Sam Ravnborge16af092007-10-12 16:11:49 +0200135 .init.ramfs : {
136 __initramfs_start = .;
137 *(.init.ramfs)
138 . = ALIGN(2);
139 __initramfs_end = .;
140 }
Jean-Paul Saman67d38222007-02-10 01:44:44 -0800141#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700142
Sam Ravnborg52480ee2007-10-12 16:11:50 +0200143 PERCPU(PAGE_SIZE)
144 . = ALIGN(PAGE_SIZE);
Sam Ravnborge16af092007-10-12 16:11:49 +0200145 __init_end = .; /* freed after init ends here */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700146
Sam Ravnborge16af092007-10-12 16:11:49 +0200147 /* BSS */
148 .bss : {
149 __bss_start = .;
150 *(.bss)
151 . = ALIGN(2);
152 __bss_stop = .;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700153 }
154
Sam Ravnborge16af092007-10-12 16:11:49 +0200155 _end = . ;
156
157 /* Sections to be discarded */
158 /DISCARD/ : {
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +0100159 EXIT_DATA
Sam Ravnborge16af092007-10-12 16:11:49 +0200160 *(.exitcall.exit)
161 }
162
163 /* Debugging sections. */
164 STABS_DEBUG
165 DWARF_DEBUG
Linus Torvalds1da177e2005-04-16 15:20:36 -0700166}