xref: /openbmc/linux/arch/s390/kernel/vmlinux.lds.S (revision 9cfc5c90)
1/* ld script to make s390 Linux kernel
2 * Written by Martin Schwidefsky (schwidefsky@de.ibm.com)
3 */
4
5#include <asm/thread_info.h>
6#include <asm/page.h>
7#include <asm-generic/vmlinux.lds.h>
8
9OUTPUT_FORMAT("elf64-s390", "elf64-s390", "elf64-s390")
10OUTPUT_ARCH(s390:64-bit)
11ENTRY(startup)
12jiffies = jiffies_64;
13
14PHDRS {
15	text PT_LOAD FLAGS(5);	/* R_E */
16	data PT_LOAD FLAGS(7);	/* RWE */
17	note PT_NOTE FLAGS(0);	/* ___ */
18}
19
20SECTIONS
21{
22	. = 0x00000000;
23	.text : {
24	_text = .;		/* Text and read-only data */
25		HEAD_TEXT
26		TEXT_TEXT
27		SCHED_TEXT
28		LOCK_TEXT
29		KPROBES_TEXT
30		IRQENTRY_TEXT
31		*(.fixup)
32		*(.gnu.warning)
33	} :text = 0x0700
34
35	_etext = .;		/* End of text section */
36
37	NOTES :text :note
38
39	.dummy : { *(.dummy) } :data
40
41	RO_DATA_SECTION(PAGE_SIZE)
42
43#ifdef CONFIG_SHARED_KERNEL
44	. = ALIGN(0x100000);	/* VM shared segments are 1MB aligned */
45#endif
46
47	. = ALIGN(PAGE_SIZE);
48	_eshared = .;		/* End of shareable data */
49	_sdata = .;		/* Start of data section */
50
51	EXCEPTION_TABLE(16) :data
52
53	RW_DATA_SECTION(0x100, PAGE_SIZE, THREAD_SIZE)
54
55	_edata = .;		/* End of data section */
56
57	/* will be freed after init */
58	. = ALIGN(PAGE_SIZE);	/* Init code and data */
59	__init_begin = .;
60
61	INIT_TEXT_SECTION(PAGE_SIZE)
62
63	/*
64	 * .exit.text is discarded at runtime, not link time,
65	 * to deal with references from __bug_table
66	*/
67	.exit.text : {
68		EXIT_TEXT
69	}
70
71	.exit.data : {
72		EXIT_DATA
73	}
74
75	/* early.c uses stsi, which requires page aligned data. */
76	. = ALIGN(PAGE_SIZE);
77	INIT_DATA_SECTION(0x100)
78
79	PERCPU_SECTION(0x100)
80	. = ALIGN(PAGE_SIZE);
81	__init_end = .;		/* freed after init ends here */
82
83	BSS_SECTION(0, 2, 0)
84
85	_end = . ;
86
87	/* Debugging sections.	*/
88	STABS_DEBUG
89	DWARF_DEBUG
90
91	/* Sections to be discarded */
92	DISCARDS
93}
94