vmlinux.lds.S 3.6 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 36 37 38 39 40
/*
 * Text, read only data and other permanent read-only sections
 */

	/* Text and gots */
	.text : {
		*(.text .text.*)
		SCHED_TEXT
		LOCK_TEXT
		KPROBES_TEXT
		*(.fixup)
41

42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
#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 */
58 59 60 61 62 63 64 65 66 67 68 69
	__ex_table : {
		__start___ex_table = .;
		*(__ex_table)
		__stop___ex_table = .;
	}

	__bug_table : {
		__start___bug_table = .;
		*(__bug_table)
		__stop___bug_table = .;
	}

70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
/*
 * 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 = .;
95 96 97 98 99
#ifdef CONFIG_PPC_ISERIES
		__dt_strings_start = .;
		*(.dt_strings);
		__dt_strings_end = .;
#endif
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
	}

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

	.initcall.init : {
		__initcall_start = .;
		*(.initcall1.init)
		*(.initcall2.init)
		*(.initcall3.init)
		*(.initcall4.init)
		*(.initcall5.init)
		*(.initcall6.init)
		*(.initcall7.init)
		__initcall_end = .;
		}

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

	SECURITY_INIT

	. = ALIGN(8);
S
Stephen Rothwell 已提交
130 131 132 133 134 135
	__ftr_fixup : {
		__start___ftr_fixup = .;
		*(__ftr_fixup)
		__stop___ftr_fixup = .;
	}

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

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

154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170
	. = 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 = .;
171

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

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

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

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

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

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

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

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

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

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

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