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