xref: /linux/arch/s390/kernel/vmlinux.lds.S (revision c537b994505099b7197e7d3125b942ecbcc51eb6)
1/* 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>
6
7#ifndef CONFIG_64BIT
8OUTPUT_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 : {
24	*(.text)
25	SCHED_TEXT
26	LOCK_TEXT
27	KPROBES_TEXT
28	*(.fixup)
29	*(.gnu.warning)
30	} = 0x0700
31
32  _etext = .;			/* End of text section */
33
34  RODATA
35
36#ifdef CONFIG_SHARED_KERNEL
37  . = ALIGN(1048576);		/* VM shared segments are 1MB aligned */
38#endif
39
40  . = ALIGN(4096);
41  _eshared = .;			/* End of shareable data */
42
43  . = ALIGN(16);		/* Exception table */
44  __start___ex_table = .;
45  __ex_table : { *(__ex_table) }
46  __stop___ex_table = .;
47
48  .data : {			/* Data */
49	*(.data)
50	CONSTRUCTORS
51	}
52
53  . = ALIGN(4096);
54  __nosave_begin = .;
55  .data_nosave : { *(.data.nosave) }
56  . = ALIGN(4096);
57  __nosave_end = .;
58
59  . = ALIGN(4096);
60  .data.page_aligned : { *(.data.idt) }
61
62  . = ALIGN(256);
63  .data.cacheline_aligned : { *(.data.cacheline_aligned) }
64
65  . = ALIGN(256);
66  .data.read_mostly : { *(.data.read_mostly) }
67  _edata = .;			/* End of data section */
68
69  . = ALIGN(8192);		/* init_task */
70  .data.init_task : { *(.data.init_task) }
71
72  /* will be freed after init */
73  . = ALIGN(4096);		/* Init code and data */
74  __init_begin = .;
75  .init.text : {
76	_sinittext = .;
77	*(.init.text)
78	_einittext = .;
79  }
80  .init.data : { *(.init.data) }
81  . = ALIGN(256);
82  __setup_start = .;
83  .init.setup : { *(.init.setup) }
84  __setup_end = .;
85  __initcall_start = .;
86  .initcall.init : {
87	INITCALLS
88  }
89  __initcall_end = .;
90  __con_initcall_start = .;
91  .con_initcall.init : { *(.con_initcall.init) }
92  __con_initcall_end = .;
93  SECURITY_INIT
94
95#ifdef CONFIG_BLK_DEV_INITRD
96  . = ALIGN(256);
97  __initramfs_start = .;
98  .init.ramfs : { *(.init.initramfs) }
99  . = ALIGN(2);
100  __initramfs_end = .;
101#endif
102  . = ALIGN(256);
103  __per_cpu_start = .;
104  .data.percpu  : { *(.data.percpu) }
105  __per_cpu_end = .;
106  . = ALIGN(4096);
107  __init_end = .;
108  /* freed after init ends here */
109
110  __bss_start = .;		/* BSS */
111  .bss : { *(.bss) }
112  . = ALIGN(2);
113  __bss_stop = .;
114
115  _end = . ;
116
117  /* Sections to be discarded */
118  /DISCARD/ : {
119	*(.exit.text) *(.exit.data) *(.exitcall.exit)
120	}
121
122  /* Stabs debugging sections.  */
123  .stab 0 : { *(.stab) }
124  .stabstr 0 : { *(.stabstr) }
125  .stab.excl 0 : { *(.stab.excl) }
126  .stab.exclstr 0 : { *(.stab.exclstr) }
127  .stab.index 0 : { *(.stab.index) }
128  .stab.indexstr 0 : { *(.stab.indexstr) }
129  .comment 0 : { *(.comment) }
130}
131