xref: /linux/arch/microblaze/kernel/vmlinux.lds.S (revision e27ecdd94d81e5bc3d1f68591701db5adb342f0d)
1/*
2 * Copyright (C) 2008-2009 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2008-2009 PetaLogix
4 * Copyright (C) 2006 Atmark Techno, Inc.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10
11OUTPUT_FORMAT("elf32-microblaze", "elf32-microblaze", "elf32-microblaze")
12OUTPUT_ARCH(microblaze)
13ENTRY(_start)
14
15#include <asm-generic/vmlinux.lds.h>
16
17jiffies = jiffies_64 + 4;
18
19SECTIONS {
20	. = CONFIG_KERNEL_START;
21	.text : {
22		_text = . ;
23		_stext = . ;
24		*(.text .text.*)
25		*(.fixup)
26
27		*(.exitcall.exit)
28		SCHED_TEXT
29		LOCK_TEXT
30		KPROBES_TEXT
31		. = ALIGN (4) ;
32		_etext = . ;
33	}
34
35	. = ALIGN (4) ;
36	_fdt_start = . ; /* place for fdt blob */
37	. = . + 0x4000;
38	_fdt_end = . ;
39
40	. = ALIGN(16);
41	RODATA
42	. = ALIGN(16);
43	__ex_table : {
44		__start___ex_table = .;
45		*(__ex_table)
46		__stop___ex_table = .;
47	}
48
49	/*
50	 * sdata2 section can go anywhere, but must be word aligned
51	 * and SDA2_BASE must point to the middle of it
52	 */
53	.sdata2 : {
54		_ssrw = .;
55		. = ALIGN(4096); /* page aligned when MMU used - origin 0x8 */
56		*(.sdata2)
57	. = ALIGN(8);
58	_essrw = .;
59	_ssrw_size = _essrw - _ssrw;
60	_KERNEL_SDA2_BASE_ = _ssrw + (_ssrw_size / 2);
61	}
62
63	_sdata = . ;
64	.data ALIGN (4096) : { /* page aligned when MMU used - origin 0x4 */
65		*(.data)
66	}
67	. = ALIGN(32);
68	.data.cacheline_aligned : { *(.data.cacheline_aligned) }
69	_edata = . ;
70
71	/* Reserve some low RAM for r0 based memory references */
72	. = ALIGN(0x4) ;
73	r0_ram = . ;
74	. = . +  4096;	/* a page should be enough */
75
76	/* The initial task */
77	. = ALIGN(8192);
78	.data.init_task : { *(.data.init_task) }
79
80	/* Under the microblaze ABI, .sdata and .sbss must be contiguous */
81	. = ALIGN(8);
82	.sdata : {
83		_ssro = .;
84		*(.sdata)
85	}
86
87	.sbss :	{
88		_ssbss = .;
89		*(.sbss)
90		_esbss = .;
91		_essro = .;
92		_ssro_size = _essro - _ssro ;
93		_KERNEL_SDA_BASE_ = _ssro + (_ssro_size / 2) ;
94	}
95
96	__init_begin = .;
97
98	. = ALIGN(4096);
99	.init.text : {
100		_sinittext = . ;
101		*(.init.text)
102		*(.exit.text)
103		*(.exit.data)
104		_einittext = .;
105	}
106
107	.init.data : { *(.init.data) }
108
109	. = ALIGN(4);
110	.init.ivt : {
111		__ivt_start = .;
112		*(.init.ivt)
113		__ivt_end = .;
114	}
115
116	.init.setup : {
117		__setup_start = .;
118		*(.init.setup)
119		__setup_end = .;
120	}
121
122	.initcall.init : {
123		__initcall_start = .;
124		INITCALLS
125		__initcall_end = .;
126	}
127
128	.con_initcall.init : {
129		__con_initcall_start = .;
130		*(.con_initcall.init)
131		__con_initcall_end = .;
132	}
133
134	SECURITY_INIT
135
136	__init_end_before_initramfs = .;
137
138	.init.ramfs ALIGN(4096) : {
139		__initramfs_start = .;
140		*(.init.ramfs)
141		__initramfs_end = .;
142		. = ALIGN(4);
143		LONG(0);
144/*
145 * FIXME this can break initramfs for MMU.
146 * Pad init.ramfs up to page boundary,
147 * so that __init_end == __bss_start. This will make image.elf
148 * consistent with the image.bin
149 */
150		/* . = ALIGN(4096); */
151	}
152	__init_end = .;
153
154	.bss ALIGN (4096) : { /* page aligned when MMU used */
155		__bss_start = . ;
156			*(.bss*)
157			*(COMMON)
158		. = ALIGN (4) ;
159		__bss_stop = . ;
160		_ebss = . ;
161	}
162	. = ALIGN(4096);
163	_end = .;
164}
165