blob: b76c17c9ae411c0081372e7ff4ba1246b3e26c3c [file] [log] [blame]
Michal Simek16bfeaf2009-03-27 14:25:20 +01001/*
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>
Tim Abbott8cc11f52009-09-06 23:10:10 -040016#include <asm/page.h>
17#include <asm/thread_info.h>
Michal Simek16bfeaf2009-03-27 14:25:20 +010018
19jiffies = jiffies_64 + 4;
20
21SECTIONS {
Michal Simekd4c12852009-05-26 16:30:24 +020022 . = CONFIG_KERNEL_START;
Michal Simek16bfeaf2009-03-27 14:25:20 +010023 .text : {
24 _text = . ;
25 _stext = . ;
26 *(.text .text.*)
27 *(.fixup)
Michal Simek1dcdd092009-07-09 11:27:40 +090028 EXIT_TEXT
29 EXIT_CALL
Michal Simek16bfeaf2009-03-27 14:25:20 +010030 SCHED_TEXT
31 LOCK_TEXT
32 KPROBES_TEXT
33 . = ALIGN (4) ;
34 _etext = . ;
35 }
36
37 . = ALIGN (4) ;
38 _fdt_start = . ; /* place for fdt blob */
39 . = . + 0x4000;
40 _fdt_end = . ;
41
42 . = ALIGN(16);
43 RODATA
Tim Abbott8cc11f52009-09-06 23:10:10 -040044 EXCEPTION_TABLE(16)
Michal Simek16bfeaf2009-03-27 14:25:20 +010045
46 /*
47 * sdata2 section can go anywhere, but must be word aligned
48 * and SDA2_BASE must point to the middle of it
49 */
50 .sdata2 : {
51 _ssrw = .;
52 . = ALIGN(4096); /* page aligned when MMU used - origin 0x8 */
53 *(.sdata2)
54 . = ALIGN(8);
55 _essrw = .;
56 _ssrw_size = _essrw - _ssrw;
57 _KERNEL_SDA2_BASE_ = _ssrw + (_ssrw_size / 2);
58 }
59
60 _sdata = . ;
Tim Abbott8cc11f52009-09-06 23:10:10 -040061 RW_DATA_SECTION(32, PAGE_SIZE, THREAD_SIZE)
Michal Simek16bfeaf2009-03-27 14:25:20 +010062 _edata = . ;
63
64 /* Reserve some low RAM for r0 based memory references */
65 . = ALIGN(0x4) ;
66 r0_ram = . ;
67 . = . + 4096; /* a page should be enough */
68
Michal Simek16bfeaf2009-03-27 14:25:20 +010069 /* Under the microblaze ABI, .sdata and .sbss must be contiguous */
70 . = ALIGN(8);
71 .sdata : {
72 _ssro = .;
73 *(.sdata)
74 }
75
76 .sbss : {
77 _ssbss = .;
78 *(.sbss)
79 _esbss = .;
80 _essro = .;
81 _ssro_size = _essro - _ssro ;
82 _KERNEL_SDA_BASE_ = _ssro + (_ssro_size / 2) ;
83 }
84
85 __init_begin = .;
86
Tim Abbott8cc11f52009-09-06 23:10:10 -040087 INIT_TEXT_SECTION(PAGE_SIZE)
Michal Simek16bfeaf2009-03-27 14:25:20 +010088
Michal Simek05bf7d42009-06-20 14:24:01 +020089 .init.data : {
90 INIT_DATA
91 }
Michal Simek16bfeaf2009-03-27 14:25:20 +010092
93 . = ALIGN(4);
94 .init.ivt : {
95 __ivt_start = .;
96 *(.init.ivt)
97 __ivt_end = .;
98 }
99
100 .init.setup : {
Tim Abbott8cc11f52009-09-06 23:10:10 -0400101 INIT_SETUP(0)
Michal Simek16bfeaf2009-03-27 14:25:20 +0100102 }
103
104 .initcall.init : {
Tim Abbott8cc11f52009-09-06 23:10:10 -0400105 INIT_CALLS
Michal Simek16bfeaf2009-03-27 14:25:20 +0100106 }
107
108 .con_initcall.init : {
Tim Abbott8cc11f52009-09-06 23:10:10 -0400109 CON_INITCALL
Michal Simek16bfeaf2009-03-27 14:25:20 +0100110 }
111
Arnd Bergmann6b437422009-05-01 21:36:44 +0000112 SECURITY_INIT
113
Michal Simek16bfeaf2009-03-27 14:25:20 +0100114 __init_end_before_initramfs = .;
115
116 .init.ramfs ALIGN(4096) : {
117 __initramfs_start = .;
118 *(.init.ramfs)
119 __initramfs_end = .;
120 . = ALIGN(4);
121 LONG(0);
122/*
123 * FIXME this can break initramfs for MMU.
124 * Pad init.ramfs up to page boundary,
125 * so that __init_end == __bss_start. This will make image.elf
126 * consistent with the image.bin
127 */
128 /* . = ALIGN(4096); */
129 }
130 __init_end = .;
131
132 .bss ALIGN (4096) : { /* page aligned when MMU used */
133 __bss_start = . ;
134 *(.bss*)
135 *(COMMON)
136 . = ALIGN (4) ;
137 __bss_stop = . ;
138 _ebss = . ;
139 }
140 . = ALIGN(4096);
141 _end = .;
Tejun Heo405d9672009-06-24 15:13:38 +0900142
Tejun Heo023bf6f2009-07-09 11:27:40 +0900143 DISCARDS
Michal Simek16bfeaf2009-03-27 14:25:20 +0100144}