blob: 6ab7d4ee13a47365f7454c85f019af64056fb4e9 [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{
21 . = 0x00000000;
22 _text = .; /* Text and read-only data */
23 .text : {
Sam Ravnborg76647092007-05-13 00:31:33 +020024 TEXT_TEXT
Linus Torvalds1da177e2005-04-16 15:20:36 -070025 SCHED_TEXT
26 LOCK_TEXT
Michael Grundy4ba069b2006-09-20 15:58:39 +020027 KPROBES_TEXT
Linus Torvalds1da177e2005-04-16 15:20:36 -070028 *(.fixup)
29 *(.gnu.warning)
30 } = 0x0700
31
32 _etext = .; /* End of text section */
33
Linus Torvalds1da177e2005-04-16 15:20:36 -070034 RODATA
35
36#ifdef CONFIG_SHARED_KERNEL
37 . = ALIGN(1048576); /* VM shared segments are 1MB aligned */
Linus Torvalds1da177e2005-04-16 15:20:36 -070038#endif
39
Heiko Carstens162e0062007-02-05 21:18:41 +010040 . = ALIGN(4096);
41 _eshared = .; /* End of shareable data */
42
Hongjie Yangfe355b72007-02-05 21:18:24 +010043 . = ALIGN(16); /* Exception table */
44 __start___ex_table = .;
45 __ex_table : { *(__ex_table) }
46 __stop___ex_table = .;
47
Roland McGrath86ead9c2007-07-19 01:48:39 -070048 NOTES
49
Heiko Carstensc0007f12007-04-27 16:01:42 +020050 BUG_TABLE
51
Linus Torvalds1da177e2005-04-16 15:20:36 -070052 .data : { /* Data */
Sam Ravnborgca967252007-05-17 13:38:44 +020053 DATA_DATA
Linus Torvalds1da177e2005-04-16 15:20:36 -070054 CONSTRUCTORS
55 }
56
57 . = ALIGN(4096);
58 __nosave_begin = .;
59 .data_nosave : { *(.data.nosave) }
60 . = ALIGN(4096);
61 __nosave_end = .;
62
63 . = ALIGN(4096);
64 .data.page_aligned : { *(.data.idt) }
65
Christian Borntraeger58268b92006-04-27 18:40:24 -070066 . = ALIGN(256);
Linus Torvalds1da177e2005-04-16 15:20:36 -070067 .data.cacheline_aligned : { *(.data.cacheline_aligned) }
68
Christian Borntraeger58268b92006-04-27 18:40:24 -070069 . = ALIGN(256);
70 .data.read_mostly : { *(.data.read_mostly) }
Linus Torvalds1da177e2005-04-16 15:20:36 -070071 _edata = .; /* End of data section */
72
73 . = ALIGN(8192); /* init_task */
74 .data.init_task : { *(.data.init_task) }
75
76 /* will be freed after init */
77 . = ALIGN(4096); /* Init code and data */
78 __init_begin = .;
79 .init.text : {
80 _sinittext = .;
81 *(.init.text)
82 _einittext = .;
83 }
Heiko Carstensc0007f12007-04-27 16:01:42 +020084 /*
85 * .exit.text is discarded at runtime, not link time,
86 * to deal with references from __bug_table
87 */
88 .exit.text : { *(.exit.text) }
89
Linus Torvalds1da177e2005-04-16 15:20:36 -070090 .init.data : { *(.init.data) }
91 . = ALIGN(256);
92 __setup_start = .;
93 .init.setup : { *(.init.setup) }
94 __setup_end = .;
95 __initcall_start = .;
96 .initcall.init : {
Andrew Morton61ce1ef2006-10-27 11:41:44 -070097 INITCALLS
Linus Torvalds1da177e2005-04-16 15:20:36 -070098 }
99 __initcall_end = .;
100 __con_initcall_start = .;
101 .con_initcall.init : { *(.con_initcall.init) }
102 __con_initcall_end = .;
103 SECURITY_INIT
Jean-Paul Saman67d38222007-02-10 01:44:44 -0800104
105#ifdef CONFIG_BLK_DEV_INITRD
Linus Torvalds1da177e2005-04-16 15:20:36 -0700106 . = ALIGN(256);
107 __initramfs_start = .;
108 .init.ramfs : { *(.init.initramfs) }
109 . = ALIGN(2);
110 __initramfs_end = .;
Jean-Paul Saman67d38222007-02-10 01:44:44 -0800111#endif
Fenghua Yu5fb7dc32007-07-19 01:48:12 -0700112 PERCPU(4096)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700113 . = ALIGN(4096);
114 __init_end = .;
115 /* freed after init ends here */
116
117 __bss_start = .; /* BSS */
118 .bss : { *(.bss) }
119 . = ALIGN(2);
120 __bss_stop = .;
121
122 _end = . ;
123
124 /* Sections to be discarded */
125 /DISCARD/ : {
Heiko Carstensc0007f12007-04-27 16:01:42 +0200126 *(.exit.data) *(.exitcall.exit)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700127 }
128
129 /* Stabs debugging sections. */
130 .stab 0 : { *(.stab) }
131 .stabstr 0 : { *(.stabstr) }
132 .stab.excl 0 : { *(.stab.excl) }
133 .stab.exclstr 0 : { *(.stab.exclstr) }
134 .stab.index 0 : { *(.stab.index) }
135 .stab.indexstr 0 : { *(.stab.indexstr) }
136 .comment 0 : { *(.comment) }
137}