vmlinux.lds.S 3.5 KB
Newer Older
1
#ifdef CONFIG_PPC64
S
Stephen Rothwell 已提交
2
#include <asm/page.h>
3
#define PROVIDE32(x)	PROVIDE(__unused__##x)
4 5 6
#else
#define PAGE_SIZE	4096
#define KERNELBASE	CONFIG_KERNEL_START
7
#define PROVIDE32(x)	PROVIDE(x)
8
#endif
9 10
#include <asm-generic/vmlinux.lds.h>

11 12
ENTRY(_stext)

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

28
	. = KERNELBASE;
29

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

	/* Text and gots */
	.text : {
36
		_text = .;
37 38 39 40 41
		*(.text .text.*)
		SCHED_TEXT
		LOCK_TEXT
		KPROBES_TEXT
		*(.fixup)
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 60 61 62 63 64
	__ex_table : {
		__start___ex_table = .;
		*(__ex_table)
		__stop___ex_table = .;
	}

65
	BUG_TABLE
66

67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
/*
 * Init sections discarded at runtime
 */
	. = ALIGN(PAGE_SIZE);
	__init_begin = .;

	.init.text : {
		_sinittext = .;
		*(.init.text)
		_einittext = .;
	}

	/* .exit.text is discarded at runtime, not link time,
	 * to deal with references from __bug_table
	 */
	.exit.text : { *(.exit.text) }

	.init.data : {
		*(.init.data);
		__vtop_table_begin = .;
		*(.vtop_fixup);
		__vtop_table_end = .;
		__ptov_table_begin = .;
		*(.ptov_fixup);
		__ptov_table_end = .;
92 93 94 95 96
#ifdef CONFIG_PPC_ISERIES
		__dt_strings_start = .;
		*(.dt_strings);
		__dt_strings_end = .;
#endif
97 98 99 100 101 102 103 104 105 106 107
	}

	. = ALIGN(16);
	.init.setup : {
		__setup_start = .;
		*(.init.setup)
		__setup_end = .;
	}

	.initcall.init : {
		__initcall_start = .;
108
		INITCALLS
109 110 111 112 113 114 115 116 117 118 119 120
		__initcall_end = .;
		}

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

	SECURITY_INIT

	. = ALIGN(8);
S
Stephen Rothwell 已提交
121 122 123 124 125
	__ftr_fixup : {
		__start___ftr_fixup = .;
		*(__ftr_fixup)
		__stop___ftr_fixup = .;
	}
126 127 128 129 130 131 132 133
#ifdef CONFIG_PPC64
	. = ALIGN(8);
	__fw_ftr_fixup : {
		__start___fw_ftr_fixup = .;
		*(__fw_ftr_fixup)
		__stop___fw_ftr_fixup = .;
	}
#endif
S
Stephen Rothwell 已提交
134

135 136 137 138 139 140
	. = ALIGN(PAGE_SIZE);
	.init.ramfs : {
		__initramfs_start = .;
		*(.init.ramfs)
		__initramfs_end = .;
	}
S
Stephen Rothwell 已提交
141 142

#ifdef CONFIG_PPC32
143 144 145
	. = ALIGN(32);
#else
	. = ALIGN(128);
146
#endif
147 148 149 150 151
	.data.percpu : {
		__per_cpu_start = .;
		*(.data.percpu)
		__per_cpu_end = .;
	}
152

153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169
	. = ALIGN(8);
	.machine.desc : {
		__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 = .;
170

S
Stephen Rothwell 已提交
171
#ifdef CONFIG_PPC32
172 173 174 175 176 177
	.data    :
	{
		*(.data)
		*(.sdata)
		*(.got.plt) *(.got)
	}
S
Stephen Rothwell 已提交
178
#else
179 180 181 182
	.data : {
		*(.data .data.rel* .toc1)
		*(.branch_lt)
	}
183

184 185 186 187 188 189 190 191 192
	.opd : {
		*(.opd)
	}

	.got : {
		__toc_start = .;
		*(.got)
		*(.toc)
	}
S
Stephen Rothwell 已提交
193
#endif
194

195 196 197 198 199 200 201
	. = ALIGN(PAGE_SIZE);
	_edata  =  .;
	PROVIDE32 (edata = .);

	/* The initial task and kernel stack */
#ifdef CONFIG_PPC32
	. = ALIGN(8192);
S
Stephen Rothwell 已提交
202
#else
203 204 205 206 207
	. = ALIGN(16384);
#endif
	.data.init_task : {
		*(.data.init_task)
	}
208

209 210 211 212
	. = ALIGN(PAGE_SIZE);
	.data.page_aligned : {
		*(.data.page_aligned)
	}
213

214 215 216
	.data.cacheline_aligned : {
		*(.data.cacheline_aligned)
	}
217

218 219 220 221 222 223 224
	. = ALIGN(PAGE_SIZE);
	__data_nosave : {
		__nosave_begin = .;
		*(.data.nosave)
		. = ALIGN(PAGE_SIZE);
		__nosave_end = .;
	}
225

226 227 228 229 230 231 232 233 234 235 236 237
/*
 * And finally the bss
 */

	.bss : {
		__bss_start = .;
		*(.sbss) *(.scommon)
		*(.dynbss)
		*(.bss)
		*(COMMON)
		__bss_stop = .;
	}
238

239 240 241
	. = ALIGN(PAGE_SIZE);
	_end = . ;
	PROVIDE32 (end = .);
242
}