move BUG_TABLE into RODATA
[pandora-kernel.git] / arch / parisc / kernel / vmlinux.lds.S
1 /*    Kernel link layout for various "sections"
2  *
3  *    Copyright (C) 1999-2003 Matthew Wilcox <willy at parisc-linux.org>
4  *    Copyright (C) 2000-2003 Paul Bame <bame at parisc-linux.org>
5  *    Copyright (C) 2000 John Marvin <jsm at parisc-linux.org>
6  *    Copyright (C) 2000 Michael Ang <mang with subcarrier.org>
7  *    Copyright (C) 2002 Randolph Chung <tausq with parisc-linux.org>
8  *    Copyright (C) 2003 James Bottomley <jejb with parisc-linux.org>
9  *    Copyright (C) 2006 Helge Deller <deller@gmx.de>
10  *
11  *
12  *    This program is free software; you can redistribute it and/or modify
13  *    it under the terms of the GNU General Public License as published by
14  *    the Free Software Foundation; either version 2 of the License, or
15  *    (at your option) any later version.
16  *
17  *    This program is distributed in the hope that it will be useful,
18  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
19  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20  *    GNU General Public License for more details.
21  *
22  *    You should have received a copy of the GNU General Public License
23  *    along with this program; if not, write to the Free Software
24  *    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
25  */
26 #include <asm-generic/vmlinux.lds.h>
27 /* needed for the processor specific cache alignment size */    
28 #include <asm/cache.h>
29 #include <asm/page.h>
30 #include <asm/asm-offsets.h>
31         
32 /* ld script to make hppa Linux kernel */
33 #ifndef CONFIG_64BIT
34 OUTPUT_FORMAT("elf32-hppa-linux")
35 OUTPUT_ARCH(hppa)
36 #else
37 OUTPUT_FORMAT("elf64-hppa-linux")
38 OUTPUT_ARCH(hppa:hppa2.0w)
39 #endif
40
41 ENTRY(_stext)
42 #ifndef CONFIG_64BIT
43 jiffies = jiffies_64 + 4;
44 #else
45 jiffies = jiffies_64;
46 #endif
47 SECTIONS
48 {
49         . = KERNEL_BINARY_TEXT_START;
50
51         _text = .;              /* Text and read-only data */
52         .text ALIGN(16) : {
53                 TEXT_TEXT
54                 SCHED_TEXT
55                 LOCK_TEXT
56                 *(.text.do_softirq)
57                 *(.text.sys_exit)
58                 *(.text.do_sigaltstack)
59                 *(.text.do_fork)
60                 *(.text.*)
61                 *(.fixup)
62                 *(.lock.text)           /* out-of-line lock text */
63                 *(.gnu.warning)
64         } = 0
65         /* End of text section */
66         _etext = .;
67
68         RODATA
69
70         /* writeable */
71         /* Make sure this is page aligned so
72          * that we can properly leave these
73          * as writable
74          */
75         . = ALIGN(PAGE_SIZE);
76         data_start = .;
77         . = ALIGN(16);
78         /* Exception table */
79         __ex_table : {
80                 __start___ex_table = .;
81                 *(__ex_table)
82                 __stop___ex_table = .;
83         }
84
85         NOTES
86
87         /* unwind info */
88         .PARISC.unwind : {
89                 __start___unwind = .;
90                 *(.PARISC.unwind)
91                 __stop___unwind = .;
92         }
93
94         /* rarely changed data like cpu maps */
95         . = ALIGN(16);
96         .data.read_mostly : {
97                 *(.data.read_mostly)
98         }
99
100         . = ALIGN(L1_CACHE_BYTES);
101         /* Data */
102         .data : {
103                 DATA_DATA
104                 CONSTRUCTORS
105         }
106
107         . = ALIGN(L1_CACHE_BYTES);
108         .data.cacheline_aligned : {
109                 *(.data.cacheline_aligned)
110         }
111
112         /* PA-RISC locks requires 16-byte alignment */
113         . = ALIGN(16);
114         .data.lock_aligned : {
115                 *(.data.lock_aligned)
116         }
117
118         /* nosave data is really only used for software suspend...it's here
119          * just in case we ever implement it
120          */
121         . = ALIGN(PAGE_SIZE);
122         __nosave_begin = .;
123         .data_nosave : {
124                 *(.data.nosave)
125         }
126         . = ALIGN(PAGE_SIZE);
127         __nosave_end = .;
128
129         /* End of data section */
130         _edata = .;
131
132         /* BSS */
133         __bss_start = .;
134         /* page table entries need to be PAGE_SIZE aligned */
135         . = ALIGN(PAGE_SIZE);
136         .data.vmpages : {
137                 *(.data.vm0.pmd)
138                 *(.data.vm0.pgd)
139                 *(.data.vm0.pte)
140         }
141         .bss : {
142                 *(.bss)
143                 *(COMMON)
144         }
145         __bss_stop = .;
146
147
148         /* assembler code expects init_task to be 16k aligned */
149         . = ALIGN(16384);
150         /* init_task */
151         .data.init_task : {
152                 *(.data.init_task)
153         }
154
155 #ifdef CONFIG_64BIT
156         . = ALIGN(16);
157         /* Linkage tables */
158         .opd : {
159                 *(.opd)
160         } PROVIDE (__gp = .); 
161         .plt : {
162                 *(.plt)
163         } 
164         .dlt : {
165                 *(.dlt)
166         }
167 #endif
168
169         /* reserve space for interrupt stack by aligning __init* to 16k */
170         . = ALIGN(16384);
171         __init_begin = .;
172         .init.text : { 
173                 _sinittext = .;
174                 INIT_TEXT
175                 _einittext = .;
176         }
177         .init.data : {
178                 INIT_DATA
179         }
180         . = ALIGN(16);
181         .init.setup : {
182                 __setup_start = .;
183                 *(.init.setup)
184                 __setup_end = .;
185         }
186         .initcall.init : {
187                 __initcall_start = .;
188                 INITCALLS
189                 __initcall_end = .;
190         }
191         .con_initcall.init : {
192                 __con_initcall_start = .;
193                 *(.con_initcall.init)
194                 __con_initcall_end = .;
195         }
196         SECURITY_INIT
197
198         /* alternate instruction replacement.  This is a mechanism x86 uses
199          * to detect the CPU type and replace generic instruction sequences
200          * with CPU specific ones.  We don't currently do this in PA, but
201          * it seems like a good idea...
202          */
203         . = ALIGN(4);
204         .altinstructions : {
205                 __alt_instructions = .;
206                 *(.altinstructions)
207                 __alt_instructions_end = .; 
208         } 
209         .altinstr_replacement : {
210                 *(.altinstr_replacement)
211         } 
212
213         /* .exit.text is discard at runtime, not link time, to deal with references
214          *  from .altinstructions and .eh_frame
215          */
216         .exit.text : {
217                 EXIT_TEXT
218         }
219         .exit.data : {
220                 EXIT_DATA
221         }
222 #ifdef CONFIG_BLK_DEV_INITRD
223         . = ALIGN(PAGE_SIZE);
224         .init.ramfs : {
225                 __initramfs_start = .;
226                 *(.init.ramfs)
227                 __initramfs_end = .;
228         }
229 #endif
230
231         PERCPU(PAGE_SIZE)
232         . = ALIGN(PAGE_SIZE);
233         __init_end = .;
234         /* freed after init ends here */
235         _end = . ;
236
237         /* Sections to be discarded */
238         /DISCARD/ : {
239                 *(.exitcall.exit)
240 #ifdef CONFIG_64BIT
241                 /* temporary hack until binutils is fixed to not emit these
242                  * for static binaries
243                  */
244                 *(.interp)
245                 *(.dynsym)
246                 *(.dynstr)
247                 *(.dynamic)
248                 *(.hash)
249                 *(.gnu.hash)
250 #endif
251         }
252
253         STABS_DEBUG
254         .note 0 : { *(.note) }  
255 }