vmlinux.lds.S 4.6 KB
Newer Older
1
#ifdef CONFIG_PPC64
2
#define PROVIDE32(x)	PROVIDE(__unused__##x)
3
#else
4
#define PROVIDE32(x)	PROVIDE(x)
5
#endif
6
#include <asm/page.h>
7
#include <asm-generic/vmlinux.lds.h>
8
#include <asm/cache.h>
9

10 11
ENTRY(_stext)

S
Stephen Rothwell 已提交
12 13 14 15
#ifdef CONFIG_PPC64
OUTPUT_ARCH(powerpc:common64)
jiffies = jiffies_64;
#else
16 17
OUTPUT_ARCH(powerpc:common)
jiffies = jiffies_64 + 4;
S
Stephen Rothwell 已提交
18
#endif
19 20
SECTIONS
{
21 22 23
	/* Sections to be discarded. */
	/DISCARD/ : {
	*(.exitcall.exit)
24
	EXIT_DATA
25
	}
26

27
	. = KERNELBASE;
28

29 30 31 32 33
/*
 * Text, read only data and other permanent read-only sections
 */

	/* Text and gots */
34
	.text : AT(ADDR(.text) - LOAD_OFFSET) {
35 36
		ALIGN_FUNCTION();
		*(.text.head)
37
		_text = .;
38
		*(.text .fixup .text.init.refok .exit.text.refok __ftr_alt_*)
39 40 41
		SCHED_TEXT
		LOCK_TEXT
		KPROBES_TEXT
42

43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
#ifdef CONFIG_PPC32
		*(.got1)
		__got2_start = .;
		*(.got2)
		__got2_end = .;
#endif /* CONFIG_PPC32 */

		. = ALIGN(PAGE_SIZE);
		_etext = .;
		PROVIDE32 (etext = .);
	}

	/* Read-only data */
	RODATA

	/* Exception & bug tables */
59
	__ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) {
60 61 62 63 64
		__start___ex_table = .;
		*(__ex_table)
		__stop___ex_table = .;
	}

65 66
	NOTES

67
	BUG_TABLE
68

69 70 71 72 73 74
/*
 * Init sections discarded at runtime
 */
	. = ALIGN(PAGE_SIZE);
	__init_begin = .;

75
	.init.text : AT(ADDR(.init.text) - LOAD_OFFSET) {
76
		_sinittext = .;
77
		INIT_TEXT
78 79 80 81 82 83
		_einittext = .;
	}

	/* .exit.text is discarded at runtime, not link time,
	 * to deal with references from __bug_table
	 */
84
	.exit.text : AT(ADDR(.exit.text) - LOAD_OFFSET) {
85 86
		EXIT_TEXT
	}
87

88
	.init.data : AT(ADDR(.init.data) - LOAD_OFFSET) {
89
		INIT_DATA
90 91 92 93 94 95
		__vtop_table_begin = .;
		*(.vtop_fixup);
		__vtop_table_end = .;
		__ptov_table_begin = .;
		*(.ptov_fixup);
		__ptov_table_end = .;
96 97 98 99 100
#ifdef CONFIG_PPC_ISERIES
		__dt_strings_start = .;
		*(.dt_strings);
		__dt_strings_end = .;
#endif
101 102 103
	}

	. = ALIGN(16);
104
	.init.setup : AT(ADDR(.init.setup) - LOAD_OFFSET) {
105 106 107 108 109
		__setup_start = .;
		*(.init.setup)
		__setup_end = .;
	}

110
	.initcall.init : AT(ADDR(.initcall.init) - LOAD_OFFSET) {
111
		__initcall_start = .;
112
		INITCALLS
113 114 115
		__initcall_end = .;
		}

116
	.con_initcall.init : AT(ADDR(.con_initcall.init) - LOAD_OFFSET) {
117 118 119 120 121 122 123 124
		__con_initcall_start = .;
		*(.con_initcall.init)
		__con_initcall_end = .;
	}

	SECURITY_INIT

	. = ALIGN(8);
125
	__ftr_fixup : AT(ADDR(__ftr_fixup) - LOAD_OFFSET) {
S
Stephen Rothwell 已提交
126 127 128 129
		__start___ftr_fixup = .;
		*(__ftr_fixup)
		__stop___ftr_fixup = .;
	}
K
Kumar Gala 已提交
130 131 132 133 134 135
	. = ALIGN(8);
	__lwsync_fixup : AT(ADDR(__lwsync_fixup) - LOAD_OFFSET) {
		__start___lwsync_fixup = .;
		*(__lwsync_fixup)
		__stop___lwsync_fixup = .;
	}
136 137
#ifdef CONFIG_PPC64
	. = ALIGN(8);
138
	__fw_ftr_fixup : AT(ADDR(__fw_ftr_fixup) - LOAD_OFFSET) {
139 140 141 142 143
		__start___fw_ftr_fixup = .;
		*(__fw_ftr_fixup)
		__stop___fw_ftr_fixup = .;
	}
#endif
144
#ifdef CONFIG_BLK_DEV_INITRD
145
	. = ALIGN(PAGE_SIZE);
146
	.init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET) {
147 148 149 150
		__initramfs_start = .;
		*(.init.ramfs)
		__initramfs_end = .;
	}
151
#endif
152
	. = ALIGN(PAGE_SIZE);
153
	.data.percpu  : AT(ADDR(.data.percpu) - LOAD_OFFSET) {
154 155
		__per_cpu_start = .;
		*(.data.percpu)
156
		*(.data.percpu.shared_aligned)
157 158
		__per_cpu_end = .;
	}
159

160
	. = ALIGN(8);
161
	.machine.desc : AT(ADDR(.machine.desc) - LOAD_OFFSET) {
162 163 164 165 166 167 168 169 170 171 172 173 174 175 176
		__machine_desc_start = . ;
		*(.machine.desc)
		__machine_desc_end = . ;
	}

	/* freed after init ends here */
	. = ALIGN(PAGE_SIZE);
	__init_end = .;

/*
 * And now the various read/write data
 */

	. = ALIGN(PAGE_SIZE);
	_sdata = .;
177

S
Stephen Rothwell 已提交
178
#ifdef CONFIG_PPC32
179
	.data : AT(ADDR(.data) - LOAD_OFFSET) {
180
		DATA_DATA
181 182 183
		*(.sdata)
		*(.got.plt) *(.got)
	}
S
Stephen Rothwell 已提交
184
#else
185
	.data : AT(ADDR(.data) - LOAD_OFFSET) {
186 187 188
		DATA_DATA
		*(.data.rel*)
		*(.toc1)
189 190
		*(.branch_lt)
	}
191

192
	.opd : AT(ADDR(.opd) - LOAD_OFFSET) {
193 194 195
		*(.opd)
	}

196
	.got : AT(ADDR(.got) - LOAD_OFFSET) {
197 198 199 200
		__toc_start = .;
		*(.got)
		*(.toc)
	}
S
Stephen Rothwell 已提交
201
#endif
202

203 204 205 206 207 208 209
	. = ALIGN(PAGE_SIZE);
	_edata  =  .;
	PROVIDE32 (edata = .);

	/* The initial task and kernel stack */
#ifdef CONFIG_PPC32
	. = ALIGN(8192);
S
Stephen Rothwell 已提交
210
#else
211 212
	. = ALIGN(16384);
#endif
213
	.data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET) {
214 215
		*(.data.init_task)
	}
216

217
	. = ALIGN(PAGE_SIZE);
218
	.data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET) {
219 220
		*(.data.page_aligned)
	}
221

222
	.data.cacheline_aligned : AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET) {
223 224
		*(.data.cacheline_aligned)
	}
225

226
	. = ALIGN(L1_CACHE_BYTES);
227
	.data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET) {
228 229 230
		*(.data.read_mostly)
	}

231
	. = ALIGN(PAGE_SIZE);
232
	.data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) {
233 234 235 236 237
		__nosave_begin = .;
		*(.data.nosave)
		. = ALIGN(PAGE_SIZE);
		__nosave_end = .;
	}
238

239 240 241 242
/*
 * And finally the bss
 */

243
	.bss : AT(ADDR(.bss) - LOAD_OFFSET) {
244 245 246 247 248 249 250
		__bss_start = .;
		*(.sbss) *(.scommon)
		*(.dynbss)
		*(.bss)
		*(COMMON)
		__bss_stop = .;
	}
251

252 253 254
	. = ALIGN(PAGE_SIZE);
	_end = . ;
	PROVIDE32 (end = .);
255
}