blob: 61ffd50fac40866470b59d12bfbb2c4f39571918 [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
Heiko Carstensc0007f12007-04-27 16:01:42 +020048 BUG_TABLE
49
Linus Torvalds1da177e2005-04-16 15:20:36 -070050 .data : { /* Data */
Sam Ravnborgca967252007-05-17 13:38:44 +020051 DATA_DATA
Linus Torvalds1da177e2005-04-16 15:20:36 -070052 CONSTRUCTORS
53 }
54
55 . = ALIGN(4096);
56 __nosave_begin = .;
57 .data_nosave : { *(.data.nosave) }
58 . = ALIGN(4096);
59 __nosave_end = .;
60
61 . = ALIGN(4096);
62 .data.page_aligned : { *(.data.idt) }
63
Christian Borntraeger58268b92006-04-27 18:40:24 -070064 . = ALIGN(256);
Linus Torvalds1da177e2005-04-16 15:20:36 -070065 .data.cacheline_aligned : { *(.data.cacheline_aligned) }
66
Christian Borntraeger58268b92006-04-27 18:40:24 -070067 . = ALIGN(256);
68 .data.read_mostly : { *(.data.read_mostly) }
Linus Torvalds1da177e2005-04-16 15:20:36 -070069 _edata = .; /* End of data section */
70
71 . = ALIGN(8192); /* init_task */
72 .data.init_task : { *(.data.init_task) }
73
74 /* will be freed after init */
75 . = ALIGN(4096); /* Init code and data */
76 __init_begin = .;
77 .init.text : {
78 _sinittext = .;
79 *(.init.text)
80 _einittext = .;
81 }
Heiko Carstensc0007f12007-04-27 16:01:42 +020082 /*
83 * .exit.text is discarded at runtime, not link time,
84 * to deal with references from __bug_table
85 */
86 .exit.text : { *(.exit.text) }
87
Linus Torvalds1da177e2005-04-16 15:20:36 -070088 .init.data : { *(.init.data) }
89 . = ALIGN(256);
90 __setup_start = .;
91 .init.setup : { *(.init.setup) }
92 __setup_end = .;
93 __initcall_start = .;
94 .initcall.init : {
Andrew Morton61ce1ef2006-10-27 11:41:44 -070095 INITCALLS
Linus Torvalds1da177e2005-04-16 15:20:36 -070096 }
97 __initcall_end = .;
98 __con_initcall_start = .;
99 .con_initcall.init : { *(.con_initcall.init) }
100 __con_initcall_end = .;
101 SECURITY_INIT
Jean-Paul Saman67d38222007-02-10 01:44:44 -0800102
103#ifdef CONFIG_BLK_DEV_INITRD
Linus Torvalds1da177e2005-04-16 15:20:36 -0700104 . = ALIGN(256);
105 __initramfs_start = .;
106 .init.ramfs : { *(.init.initramfs) }
107 . = ALIGN(2);
108 __initramfs_end = .;
Jean-Paul Saman67d38222007-02-10 01:44:44 -0800109#endif
Fenghua Yu5fb7dc32007-07-19 01:48:12 -0700110 PERCPU(4096)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700111 . = ALIGN(4096);
112 __init_end = .;
113 /* freed after init ends here */
114
115 __bss_start = .; /* BSS */
116 .bss : { *(.bss) }
117 . = ALIGN(2);
118 __bss_stop = .;
119
120 _end = . ;
121
122 /* Sections to be discarded */
123 /DISCARD/ : {
Heiko Carstensc0007f12007-04-27 16:01:42 +0200124 *(.exit.data) *(.exitcall.exit)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700125 }
126
127 /* Stabs debugging sections. */
128 .stab 0 : { *(.stab) }
129 .stabstr 0 : { *(.stabstr) }
130 .stab.excl 0 : { *(.stab.excl) }
131 .stab.exclstr 0 : { *(.stab.exclstr) }
132 .stab.index 0 : { *(.stab.index) }
133 .stab.indexstr 0 : { *(.stab.indexstr) }
134 .comment 0 : { *(.comment) }
135}