vmlinux.lds.S 2.7 KB
Newer Older
L
Linus Torvalds 已提交
1 2 3 4
/* ld script to make s390 Linux kernel
 * Written by Martin Schwidefsky (schwidefsky@de.ibm.com)
 */

5
#include <asm/page.h>
L
Linus Torvalds 已提交
6 7
#include <asm-generic/vmlinux.lds.h>

8
#ifndef CONFIG_64BIT
L
Linus Torvalds 已提交
9 10 11 12 13 14 15 16 17 18 19
OUTPUT_FORMAT("elf32-s390", "elf32-s390", "elf32-s390")
OUTPUT_ARCH(s390)
ENTRY(_start)
jiffies = jiffies_64 + 4;
#else
OUTPUT_FORMAT("elf64-s390", "elf64-s390", "elf64-s390")
OUTPUT_ARCH(s390:64-bit)
ENTRY(_start)
jiffies = jiffies_64;
#endif

20 21 22 23 24 25
PHDRS {
	text PT_LOAD FLAGS(5);	/* R_E */
	data PT_LOAD FLAGS(7);	/* RWE */
	note PT_NOTE FLAGS(0);	/* ___ */
}

L
Linus Torvalds 已提交
26 27
SECTIONS
{
S
Sam Ravnborg 已提交
28 29 30 31
	. = 0x00000000;
	.text : {
	_text = .;		/* Text and read-only data */
		*(.text.head)
32
	TEXT_TEXT
S
Sam Ravnborg 已提交
33 34 35 36 37
		SCHED_TEXT
		LOCK_TEXT
		KPROBES_TEXT
		*(.fixup)
		*(.gnu.warning)
H
Heiko Carstens 已提交
38
	} :text = 0x0700
L
Linus Torvalds 已提交
39

S
Sam Ravnborg 已提交
40
	_etext = .;		/* End of text section */
L
Linus Torvalds 已提交
41

42 43
	NOTES :text :note

S
Sam Ravnborg 已提交
44
	RODATA
L
Linus Torvalds 已提交
45 46

#ifdef CONFIG_SHARED_KERNEL
47
	. = ALIGN(0x100000);	/* VM shared segments are 1MB aligned */
48
#endif
L
Linus Torvalds 已提交
49

50
	. = ALIGN(PAGE_SIZE);
S
Sam Ravnborg 已提交
51 52 53 54 55 56 57 58 59 60 61 62 63 64
	_eshared = .;		/* End of shareable data */

	. = ALIGN(16);		/* Exception table */
	__ex_table : {
		__start___ex_table = .;
		*(__ex_table)
		__stop___ex_table = .;
	}

	.data : {		/* Data */
		DATA_DATA
		CONSTRUCTORS
	}

65
	. = ALIGN(PAGE_SIZE);
S
Sam Ravnborg 已提交
66 67 68 69
	.data_nosave : {
	__nosave_begin = .;
		*(.data.nosave)
	}
70
	. = ALIGN(PAGE_SIZE);
S
Sam Ravnborg 已提交
71 72
	__nosave_end = .;

73
	. = ALIGN(PAGE_SIZE);
S
Sam Ravnborg 已提交
74 75 76 77
	.data.page_aligned : {
		*(.data.idt)
	}

78
	. = ALIGN(0x100);
S
Sam Ravnborg 已提交
79 80 81 82
	.data.cacheline_aligned : {
		*(.data.cacheline_aligned)
	}

83
	. = ALIGN(0x100);
S
Sam Ravnborg 已提交
84 85 86 87 88
	.data.read_mostly : {
		*(.data.read_mostly)
	}
	_edata = .;		/* End of data section */

89
	. = ALIGN(2 * PAGE_SIZE);	/* init_task */
S
Sam Ravnborg 已提交
90 91 92 93 94
	.data.init_task : {
		*(.data.init_task)
	}

	/* will be freed after init */
95
	. = ALIGN(PAGE_SIZE);	/* Init code and data */
S
Sam Ravnborg 已提交
96 97 98
	__init_begin = .;
	.init.text : {
		_sinittext = .;
99
		INIT_TEXT
S
Sam Ravnborg 已提交
100 101 102 103 104 105 106
		_einittext = .;
	}
	/*
	 * .exit.text is discarded at runtime, not link time,
	 * to deal with references from __bug_table
	*/
	.exit.text : {
107
		EXIT_TEXT
S
Sam Ravnborg 已提交
108 109 110
	}

	.init.data : {
111
		INIT_DATA
S
Sam Ravnborg 已提交
112
	}
113
	. = ALIGN(0x100);
S
Sam Ravnborg 已提交
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
	.init.setup : {
		__setup_start = .;
		*(.init.setup)
		__setup_end = .;
	}
	.initcall.init : {
		__initcall_start = .;
		INITCALLS
		__initcall_end = .;
	}

	.con_initcall.init : {
		__con_initcall_start = .;
		*(.con_initcall.init)
		__con_initcall_end = .;
	}
	SECURITY_INIT
131 132

#ifdef CONFIG_BLK_DEV_INITRD
133
	. = ALIGN(0x100);
S
Sam Ravnborg 已提交
134 135 136 137 138 139
	.init.ramfs : {
		__initramfs_start = .;
		*(.init.ramfs)
		. = ALIGN(2);
		__initramfs_end = .;
	}
140
#endif
S
Sam Ravnborg 已提交
141

142 143
	PERCPU(PAGE_SIZE)
	. = ALIGN(PAGE_SIZE);
S
Sam Ravnborg 已提交
144 145 146 147 148 149 150 151 152 153 154 155 156 157
	__init_end = .;		/* freed after init ends here */

	/* BSS */
	.bss : {
		__bss_start = .;
		*(.bss)
		. = ALIGN(2);
		__bss_stop = .;
	}

	_end = . ;

	/* Sections to be discarded */
	/DISCARD/ : {
158
		EXIT_DATA
S
Sam Ravnborg 已提交
159 160 161 162 163 164
		*(.exitcall.exit)
	}

	/* Debugging sections.	*/
	STABS_DEBUG
	DWARF_DEBUG
L
Linus Torvalds 已提交
165
}