Merge branches 'release', 'bugzilla-6217', 'bugzilla-6629', 'bugzilla-6933', 'bugzill...
[pandora-kernel.git] / arch / sh / kernel / vmlinux_32.lds.S
1 /*
2  * ld script to make SuperH Linux kernel
3  * Written by Niibe Yutaka
4  */
5 #include <asm/thread_info.h>
6 #include <asm/cache.h>
7 #include <asm-generic/vmlinux.lds.h>
8
9 #ifdef CONFIG_CPU_LITTLE_ENDIAN
10 OUTPUT_FORMAT("elf32-sh-linux", "elf32-sh-linux", "elf32-sh-linux")
11 #else
12 OUTPUT_FORMAT("elf32-shbig-linux", "elf32-shbig-linux", "elf32-shbig-linux")
13 #endif
14 OUTPUT_ARCH(sh)
15 ENTRY(_start)
16 SECTIONS
17 {
18 #ifdef CONFIG_32BIT
19         . = CONFIG_PAGE_OFFSET + CONFIG_ZERO_PAGE_OFFSET;
20 #else
21         . = CONFIG_PAGE_OFFSET + CONFIG_MEMORY_START + CONFIG_ZERO_PAGE_OFFSET;
22 #endif
23
24         _text = .;                      /* Text and read-only data */
25
26         .empty_zero_page : {
27                 *(.empty_zero_page)
28         } = 0
29
30         .text : {
31                 *(.text.head)
32                 TEXT_TEXT
33                 SCHED_TEXT
34                 LOCK_TEXT
35                 KPROBES_TEXT
36                 *(.fixup)
37                 *(.gnu.warning)
38         } = 0x0009
39
40         . = ALIGN(16);          /* Exception table */
41         __start___ex_table = .;
42         __ex_table : { *(__ex_table) }
43         __stop___ex_table = .;
44
45         _etext = .;                     /* End of text section */
46
47         BUG_TABLE
48         NOTES
49         RO_DATA(PAGE_SIZE)
50
51         /*
52          * Code which must be executed uncached and the associated data
53          */
54         . = ALIGN(PAGE_SIZE);
55         __uncached_start = .;
56         .uncached.text : { *(.uncached.text) }
57         .uncached.data : { *(.uncached.data) }
58         __uncached_end = .;
59
60         . = ALIGN(THREAD_SIZE);
61         .data : {                       /* Data */
62                 *(.data.init_task)
63
64                 . = ALIGN(L1_CACHE_BYTES);
65                 *(.data.cacheline_aligned)
66
67                 . = ALIGN(L1_CACHE_BYTES);
68                 *(.data.read_mostly)
69
70                 . = ALIGN(PAGE_SIZE);
71                 *(.data.page_aligned)
72
73                 __nosave_begin = .;
74                 *(.data.nosave)
75                 . = ALIGN(PAGE_SIZE);
76                 __nosave_end = .;
77
78                 DATA_DATA
79                 CONSTRUCTORS
80         }
81
82         _edata = .;                     /* End of data section */
83
84         . = ALIGN(PAGE_SIZE);           /* Init code and data */
85         __init_begin = .;
86         _sinittext = .;
87         .init.text : { INIT_TEXT }
88         _einittext = .;
89         .init.data : { INIT_DATA }
90
91         . = ALIGN(16);
92         __setup_start = .;
93         .init.setup : { *(.init.setup) }
94         __setup_end = .;
95
96         __initcall_start = .;
97         .initcall.init : {
98                 INITCALLS
99         }
100         __initcall_end = .;
101         __con_initcall_start = .;
102         .con_initcall.init : { *(.con_initcall.init) }
103         __con_initcall_end = .;
104
105         SECURITY_INIT
106
107 #ifdef CONFIG_BLK_DEV_INITRD
108         . = ALIGN(PAGE_SIZE);
109         __initramfs_start = .;
110         .init.ramfs : { *(.init.ramfs) }
111         __initramfs_end = .;
112 #endif
113
114         . = ALIGN(4);
115         __machvec_start = .;
116         .machvec.init : { *(.machvec.init) }
117         __machvec_end = .;
118
119         PERCPU(PAGE_SIZE)
120
121         /*
122          * .exit.text is discarded at runtime, not link time, to deal with
123          * references from __bug_table
124          */
125         .exit.text : { EXIT_TEXT }
126         .exit.data : { EXIT_DATA }
127
128         . = ALIGN(PAGE_SIZE);
129         .bss : {
130                 __init_end = .;
131                 __bss_start = .;                /* BSS */
132                 *(.bss.page_aligned)
133                 *(.bss)
134                 *(COMMON)
135                 . = ALIGN(4);
136                 _ebss = .;                      /* uClinux MTD sucks */
137                 _end = . ;
138         }
139
140         /*
141          * When something in the kernel is NOT compiled as a module, the
142          * module cleanup code and data are put into these segments. Both
143          * can then be thrown away, as cleanup code is never called unless
144          * it's a module.
145          */
146         /DISCARD/ : {
147                 *(.exitcall.exit)
148         }
149
150         STABS_DEBUG
151         DWARF_DEBUG
152 }