Merge branch 'upstream-fixes' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik...
[pandora-kernel.git] / arch / mips / kernel / vmlinux.lds.S
1 #include <asm/asm-offsets.h>
2 #include <asm-generic/vmlinux.lds.h>
3
4 #undef mips
5 #define mips mips
6 OUTPUT_ARCH(mips)
7 ENTRY(kernel_entry)
8 jiffies = JIFFIES;
9
10 SECTIONS
11 {
12 #ifdef CONFIG_BOOT_ELF64
13         /* Read-only sections, merged into text segment: */
14         /* . = 0xc000000000000000; */
15
16         /* This is the value for an Origin kernel, taken from an IRIX kernel.  */
17         /* . = 0xc00000000001c000; */
18
19         /* Set the vaddr for the text segment to a value
20          *   >= 0xa800 0000 0001 9000 if no symmon is going to configured
21          *   >= 0xa800 0000 0030 0000 otherwise
22          */
23
24         /* . = 0xa800000000300000; */
25         /* . = 0xa800000000300000; */
26         . = 0xffffffff80300000;
27 #endif
28         . = LOADADDR;
29         /* read-only */
30         _text = .;      /* Text and read-only data */
31         .text : {
32                 TEXT_TEXT
33                 SCHED_TEXT
34                 LOCK_TEXT
35                 *(.fixup)
36                 *(.gnu.warning)
37         } =0
38         _etext = .;     /* End of text section */
39
40         /* Exception table */
41         . = ALIGN(16);
42         __ex_table : {
43                 __start___ex_table = .;
44                 *(__ex_table)
45                 __stop___ex_table = .;
46         }
47
48         /* Exception table for data bus errors */
49         __dbe_table : {
50                 __start___dbe_table = .;
51                 *(__dbe_table)
52                 __stop___dbe_table = .;
53         }
54         RODATA
55
56         /* writeable */
57         .data : {       /* Data */
58           . = . + DATAOFFSET;           /* for CONFIG_MAPPED_KERNEL */
59           /*
60            * This ALIGN is needed as a workaround for a bug a gcc bug upto 4.1 which
61            * limits the maximum alignment to at most 32kB and results in the following
62            * warning:
63            *
64            *  CC      arch/mips/kernel/init_task.o
65            * arch/mips/kernel/init_task.c:30: warning: alignment of ‘init_thread_union’
66            * is greater than maximum object file alignment.  Using 32768
67            */
68           . = ALIGN(_PAGE_SIZE);
69           *(.data.init_task)
70
71           DATA_DATA
72           CONSTRUCTORS
73         }
74         _gp = . + 0x8000;
75         .lit8 : {
76                 *(.lit8)
77         }
78         .lit4 : {
79                 *(.lit4)
80         }
81         /* We want the small data sections together, so single-instruction offsets
82            can access them all, and initialized data all before uninitialized, so
83            we can shorten the on-disk segment size.  */
84         .sdata : {
85                 *(.sdata)
86         }
87
88         . = ALIGN(_PAGE_SIZE);
89         .data_nosave : {
90                 __nosave_begin = .;
91                 *(.data.nosave)
92         }
93         . = ALIGN(_PAGE_SIZE);
94         __nosave_end = .;
95
96         . = ALIGN(32);
97         .data.cacheline_aligned : {
98                 *(.data.cacheline_aligned)
99         }
100         _edata =  .;                    /* End of data section */
101
102         /* will be freed after init */
103         . = ALIGN(_PAGE_SIZE);          /* Init code and data */
104         __init_begin = .;
105         .init.text : {
106                 _sinittext = .;
107                 *(.init.text)
108                 _einittext = .;
109         }
110         .init.data : {
111                 *(.init.data)
112         }
113         . = ALIGN(16);
114         .init.setup : {
115                 __setup_start = .;
116                 *(.init.setup)
117                 __setup_end = .;
118         }
119
120         .initcall.init : {
121                 __initcall_start = .;
122                 INITCALLS
123                 __initcall_end = .;
124         }
125
126         .con_initcall.init : {
127                 __con_initcall_start = .;
128                 *(.con_initcall.init)
129                 __con_initcall_end = .;
130         }
131         SECURITY_INIT
132
133         /* .exit.text is discarded at runtime, not link time, to deal with
134          * references from .rodata
135          */
136         .exit.text : {
137                 *(.exit.text)
138         }
139         .exit.data : {
140                 *(.exit.data)
141         }
142 #if defined(CONFIG_BLK_DEV_INITRD)
143         . = ALIGN(_PAGE_SIZE);
144         .init.ramfs : {
145                 __initramfs_start = .;
146                 *(.init.ramfs)
147                 __initramfs_end = .;
148         }
149 #endif
150         PERCPU(_PAGE_SIZE)
151         . = ALIGN(_PAGE_SIZE);
152         __init_end = .;
153         /* freed after init ends here */
154
155         __bss_start = .;        /* BSS */
156         .sbss  : {
157                 *(.sbss)
158                 *(.scommon)
159         }
160         .bss : {
161                 *(.bss)
162                 *(COMMON)
163         }
164         __bss_stop = .;
165
166         _end = . ;
167
168         /* Sections to be discarded */
169         /DISCARD/ : {
170                 *(.exitcall.exit)
171
172                 /* ABI crap starts here */
173                 *(.MIPS.options)
174                 *(.options)
175                 *(.pdr)
176                 *(.reginfo)
177         }
178
179         /* These mark the ABI of the kernel for debuggers.  */
180         .mdebug.abi32 : {
181                 KEEP(*(.mdebug.abi32))
182         }
183         .mdebug.abi64 : {
184                 KEEP(*(.mdebug.abi64))
185         }
186
187         /* This is the MIPS specific mdebug section.  */
188         .mdebug : {
189                 *(.mdebug)
190         }
191
192         STABS_DEBUG
193         DWARF_DEBUG
194
195         /* These must appear regardless of  .  */
196         .gptab.sdata : {
197                 *(.gptab.data)
198                 *(.gptab.sdata)
199         }
200         .gptab.sbss : {
201                 *(.gptab.bss)
202                 *(.gptab.sbss)
203         }
204         .note : {
205                 *(.note)
206         }
207 }