Merge branch 'x86-hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[sfrench/cifs-2.6.git] / arch / microblaze / kernel / vmlinux.lds.S
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
11 OUTPUT_FORMAT("elf32-microblaze", "elf32-microblaze", "elf32-microblaze")
12 OUTPUT_ARCH(microblaze)
13 ENTRY(microblaze_start)
14
15 #include <asm/page.h>
16 #include <asm-generic/vmlinux.lds.h>
17 #include <asm/thread_info.h>
18
19 jiffies = jiffies_64 + 4;
20
21 SECTIONS {
22         . = CONFIG_KERNEL_START;
23         microblaze_start = CONFIG_KERNEL_BASE_ADDR;
24         .text : AT(ADDR(.text) - LOAD_OFFSET) {
25                 _text = . ;
26                 _stext = . ;
27                 HEAD_TEXT
28                 TEXT_TEXT
29                 *(.fixup)
30                 EXIT_TEXT
31                 EXIT_CALL
32                 SCHED_TEXT
33                 LOCK_TEXT
34                 KPROBES_TEXT
35                 IRQENTRY_TEXT
36                 . = ALIGN (4) ;
37                 _etext = . ;
38         }
39
40         . = ALIGN (4) ;
41         __fdt_blob : AT(ADDR(__fdt_blob) - LOAD_OFFSET) {
42                 _fdt_start = . ;                /* place for fdt blob */
43                 *(__fdt_blob) ;                 /* Any link-placed DTB */
44                 . = _fdt_start + 0x4000;        /* Pad up to 16kbyte */
45                 _fdt_end = . ;
46         }
47
48         . = ALIGN(16);
49         RODATA
50         EXCEPTION_TABLE(16)
51
52         /*
53          * sdata2 section can go anywhere, but must be word aligned
54          * and SDA2_BASE must point to the middle of it
55          */
56         .sdata2 : AT(ADDR(.sdata2) - LOAD_OFFSET) {
57                 _ssrw = .;
58                 . = ALIGN(PAGE_SIZE); /* page aligned when MMU used */
59                 *(.sdata2)
60         . = ALIGN(8);
61         _essrw = .;
62         _ssrw_size = _essrw - _ssrw;
63         _KERNEL_SDA2_BASE_ = _ssrw + (_ssrw_size / 2);
64         }
65
66         _sdata = . ;
67         RW_DATA_SECTION(32, PAGE_SIZE, THREAD_SIZE)
68         _edata = . ;
69
70         /* Reserve some low RAM for r0 based memory references */
71         . = ALIGN(0x4) ;
72         r0_ram = . ;
73         . = . +  PAGE_SIZE;     /* a page should be enough */
74
75         /* Under the microblaze ABI, .sdata and .sbss must be contiguous */
76         . = ALIGN(8);
77         .sdata : AT(ADDR(.sdata) - LOAD_OFFSET) {
78                 _ssro = .;
79                 *(.sdata)
80         }
81
82         .sbss : AT(ADDR(.sbss) - LOAD_OFFSET) {
83                 _ssbss = .;
84                 *(.sbss)
85                 _esbss = .;
86                 _essro = .;
87                 _ssro_size = _essro - _ssro ;
88                 _KERNEL_SDA_BASE_ = _ssro + (_ssro_size / 2) ;
89         }
90
91         . = ALIGN(PAGE_SIZE);
92         __init_begin = .;
93
94         INIT_TEXT_SECTION(PAGE_SIZE)
95
96         .init.data : AT(ADDR(.init.data) - LOAD_OFFSET) {
97                 INIT_DATA
98         }
99
100         . = ALIGN(4);
101         .init.ivt : AT(ADDR(.init.ivt) - LOAD_OFFSET) {
102                 __ivt_start = .;
103                 *(.init.ivt)
104                 __ivt_end = .;
105         }
106
107         .init.setup : AT(ADDR(.init.setup) - LOAD_OFFSET) {
108                 INIT_SETUP(0)
109         }
110
111         .initcall.init : AT(ADDR(.initcall.init) - LOAD_OFFSET ) {
112                 INIT_CALLS
113         }
114
115         .con_initcall.init : AT(ADDR(.con_initcall.init) - LOAD_OFFSET) {
116                 CON_INITCALL
117         }
118
119         SECURITY_INIT
120
121         __init_end_before_initramfs = .;
122
123         .init.ramfs ALIGN(PAGE_SIZE) : AT(ADDR(.init.ramfs) - LOAD_OFFSET) {
124                 __initramfs_start = .;
125                 *(.init.ramfs)
126                 __initramfs_end = .;
127                 . = ALIGN(4);
128                 LONG(0);
129 /*
130  * FIXME this can break initramfs for MMU.
131  * Pad init.ramfs up to page boundary,
132  * so that __init_end == __bss_start. This will make image.elf
133  * consistent with the image.bin
134  */
135                 /* . = ALIGN(PAGE_SIZE); */
136         }
137         __init_end = .;
138
139         .bss ALIGN (PAGE_SIZE) : AT(ADDR(.bss) - LOAD_OFFSET) {
140                 /* page aligned when MMU used */
141                 __bss_start = . ;
142                         *(.bss*)
143                         *(COMMON)
144                 . = ALIGN (4) ;
145                 __bss_stop = . ;
146                 _ebss = . ;
147         }
148         . = ALIGN(PAGE_SIZE);
149         _end = .;
150
151         DISCARDS
152 }