vmlinux.lds.S 2.11 KB
Newer Older
Linus Torvalds's avatar
Linus Torvalds committed
1
2
3
4
/* ld script to make s390 Linux kernel
 * Written by Martin Schwidefsky (schwidefsky@de.ibm.com)
 */

5
#include <asm/thread_info.h>
6
#include <asm/page.h>
7
8
9
10
11
12
13

/*
 * Put .bss..swapper_pg_dir as the first thing in .bss. This will
 * make sure it has 16k alignment.
 */
#define BSS_FIRST_SECTIONS *(.bss..swapper_pg_dir)

14
15
16
/* Handle ro_after_init data on our own. */
#define RO_AFTER_INIT_DATA

Linus Torvalds's avatar
Linus Torvalds committed
17
18
19
20
#include <asm-generic/vmlinux.lds.h>

OUTPUT_FORMAT("elf64-s390", "elf64-s390", "elf64-s390")
OUTPUT_ARCH(s390:64-bit)
21
ENTRY(startup)
Linus Torvalds's avatar
Linus Torvalds committed
22
23
jiffies = jiffies_64;

24
25
26
27
28
29
PHDRS {
	text PT_LOAD FLAGS(5);	/* R_E */
	data PT_LOAD FLAGS(7);	/* RWE */
	note PT_NOTE FLAGS(0);	/* ___ */
}

Linus Torvalds's avatar
Linus Torvalds committed
30
31
SECTIONS
{
32
33
34
	. = 0x00000000;
	.text : {
	_text = .;		/* Text and read-only data */
35
36
		HEAD_TEXT
		TEXT_TEXT
37
38
39
		SCHED_TEXT
		LOCK_TEXT
		KPROBES_TEXT
40
		IRQENTRY_TEXT
41
		SOFTIRQENTRY_TEXT
42
43
		*(.fixup)
		*(.gnu.warning)
Heiko Carstens's avatar
Heiko Carstens committed
44
	} :text = 0x0700
Linus Torvalds's avatar
Linus Torvalds committed
45

46
	_etext = .;		/* End of text section */
Linus Torvalds's avatar
Linus Torvalds committed
47

48
49
	NOTES :text :note

50
51
	.dummy : { *(.dummy) } :data

52
	RO_DATA_SECTION(PAGE_SIZE)
Linus Torvalds's avatar
Linus Torvalds committed
53
54

#ifdef CONFIG_SHARED_KERNEL
55
	. = ALIGN(0x100000);	/* VM shared segments are 1MB aligned */
56
#endif
Linus Torvalds's avatar
Linus Torvalds committed
57

58
	. = ALIGN(PAGE_SIZE);
59
	_eshared = .;		/* End of shareable data */
60
	_sdata = .;		/* Start of data section */
61

62
63
64
65
66
67
68
69
	. = ALIGN(PAGE_SIZE);
	__start_ro_after_init = .;
	.data..ro_after_init : {
		 *(.data..ro_after_init)
	}
	EXCEPTION_TABLE(16)
	. = ALIGN(PAGE_SIZE);
	__end_ro_after_init = .;
70

71
	RW_DATA_SECTION(0x100, PAGE_SIZE, THREAD_SIZE)
72
73
74
75

	_edata = .;		/* End of data section */

	/* will be freed after init */
76
	. = ALIGN(PAGE_SIZE);	/* Init code and data */
77
	__init_begin = .;
78
79
80

	INIT_TEXT_SECTION(PAGE_SIZE)

81
82
83
84
85
	/*
	 * .exit.text is discarded at runtime, not link time,
	 * to deal with references from __bug_table
	*/
	.exit.text : {
86
		EXIT_TEXT
87
88
	}

89
90
91
92
	.exit.data : {
		EXIT_DATA
	}

93
94
	/* early.c uses stsi, which requires page aligned data. */
	. = ALIGN(PAGE_SIZE);
95
	INIT_DATA_SECTION(0x100)
96

97
	PERCPU_SECTION(0x100)
98
	. = ALIGN(PAGE_SIZE);
99
100
	__init_end = .;		/* freed after init ends here */

101
	BSS_SECTION(PAGE_SIZE, 4 * PAGE_SIZE, PAGE_SIZE)
102
103
104
105
106
107

	_end = . ;

	/* Debugging sections.	*/
	STABS_DEBUG
	DWARF_DEBUG
108
109
110

	/* Sections to be discarded */
	DISCARDS
Linus Torvalds's avatar
Linus Torvalds committed
111
}