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