vmlinux.lds.S 3.2 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11
/*
 * Copyright (C) 2008-2009 Michal Simek <monstr@monstr.eu>
 * Copyright (C) 2008-2009 PetaLogix
 * Copyright (C) 2006 Atmark Techno, Inc.
 *
 * This file is subject to the terms and conditions of the GNU General Public
 * License. See the file "COPYING" in the main directory of this archive
 * for more details.
 */

OUTPUT_ARCH(microblaze)
12
ENTRY(microblaze_start)
13

14
#include <asm/page.h>
15
#include <asm-generic/vmlinux.lds.h>
16
#include <asm/thread_info.h>
17

18 19 20
#ifdef __MICROBLAZEEL__
jiffies = jiffies_64;
#else
21
jiffies = jiffies_64 + 4;
22
#endif
23 24

SECTIONS {
25
	. = CONFIG_KERNEL_START;
26
	microblaze_start = CONFIG_KERNEL_BASE_ADDR;
27
	.text : AT(ADDR(.text) - LOAD_OFFSET) {
28 29
		_text = . ;
		_stext = . ;
30 31
		HEAD_TEXT
		TEXT_TEXT
32
		*(.fixup)
33 34
		EXIT_TEXT
		EXIT_CALL
35 36 37
		SCHED_TEXT
		LOCK_TEXT
		KPROBES_TEXT
38
		IRQENTRY_TEXT
39 40 41 42 43
		. = ALIGN (4) ;
		_etext = . ;
	}

	. = ALIGN (4) ;
44 45 46 47 48 49
	__fdt_blob : AT(ADDR(__fdt_blob) - LOAD_OFFSET) {
		_fdt_start = . ;		/* place for fdt blob */
		*(__fdt_blob) ;			/* Any link-placed DTB */
	        . = _fdt_start + 0x4000;	/* Pad up to 16kbyte */
		_fdt_end = . ;
	}
50 51 52

	. = ALIGN(16);
	RODATA
53
	EXCEPTION_TABLE(16)
54 55 56 57 58

	/*
	 * sdata2 section can go anywhere, but must be word aligned
	 * and SDA2_BASE must point to the middle of it
	 */
59
	.sdata2 : AT(ADDR(.sdata2) - LOAD_OFFSET) {
60
		_ssrw = .;
61
		. = ALIGN(PAGE_SIZE); /* page aligned when MMU used */
62 63 64 65 66 67 68 69
		*(.sdata2)
	. = ALIGN(8);
	_essrw = .;
	_ssrw_size = _essrw - _ssrw;
	_KERNEL_SDA2_BASE_ = _ssrw + (_ssrw_size / 2);
	}

	_sdata = . ;
70
	RW_DATA_SECTION(32, PAGE_SIZE, THREAD_SIZE)
71 72 73 74 75
	_edata = . ;

	/* Reserve some low RAM for r0 based memory references */
	. = ALIGN(0x4) ;
	r0_ram = . ;
76
	. = . +  PAGE_SIZE;	/* a page should be enough */
77 78 79

	/* Under the microblaze ABI, .sdata and .sbss must be contiguous */
	. = ALIGN(8);
80
	.sdata : AT(ADDR(.sdata) - LOAD_OFFSET) {
81 82 83 84
		_ssro = .;
		*(.sdata)
	}

85
	.sbss :	AT(ADDR(.sbss) - LOAD_OFFSET) {
86 87 88 89 90 91 92 93
		_ssbss = .;
		*(.sbss)
		_esbss = .;
		_essro = .;
		_ssro_size = _essro - _ssro ;
		_KERNEL_SDA_BASE_ = _ssro + (_ssro_size / 2) ;
	}

94
	. = ALIGN(PAGE_SIZE);
95 96
	__init_begin = .;

97
	INIT_TEXT_SECTION(PAGE_SIZE)
98

99
	.init.data : AT(ADDR(.init.data) - LOAD_OFFSET) {
100 101
		INIT_DATA
	}
102 103

	. = ALIGN(4);
104
	.init.ivt : AT(ADDR(.init.ivt) - LOAD_OFFSET) {
105 106 107 108 109
		__ivt_start = .;
		*(.init.ivt)
		__ivt_end = .;
	}

110
	.init.setup : AT(ADDR(.init.setup) - LOAD_OFFSET) {
111
		INIT_SETUP(0)
112 113
	}

114
	.initcall.init : AT(ADDR(.initcall.init) - LOAD_OFFSET ) {
115
		INIT_CALLS
116 117
	}

118
	.con_initcall.init : AT(ADDR(.con_initcall.init) - LOAD_OFFSET) {
119
		CON_INITCALL
120 121
	}

122 123
	SECURITY_INIT

124 125
	__init_end_before_initramfs = .;

126
	.init.ramfs ALIGN(PAGE_SIZE) : AT(ADDR(.init.ramfs) - LOAD_OFFSET) {
127 128 129 130 131 132 133 134 135 136 137
		__initramfs_start = .;
		*(.init.ramfs)
		__initramfs_end = .;
		. = ALIGN(4);
		LONG(0);
/*
 * FIXME this can break initramfs for MMU.
 * Pad init.ramfs up to page boundary,
 * so that __init_end == __bss_start. This will make image.elf
 * consistent with the image.bin
 */
138
		/* . = ALIGN(PAGE_SIZE); */
139 140 141
	}
	__init_end = .;

142
	.bss ALIGN (PAGE_SIZE) : AT(ADDR(.bss) - LOAD_OFFSET) {
143
		/* page aligned when MMU used */
144 145 146 147 148 149 150
		__bss_start = . ;
			*(.bss*)
			*(COMMON)
		. = ALIGN (4) ;
		__bss_stop = . ;
		_ebss = . ;
	}
151
	. = ALIGN(PAGE_SIZE);
152
	_end = .;
153

154
	DISCARDS
155
}