]>
Commit | Line | Data |
---|---|---|
49e6c3e7 PM |
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 | { | |
2f47f447 YS |
18 | #ifdef CONFIG_PMB_FIXED |
19 | . = CONFIG_PAGE_OFFSET + (CONFIG_MEMORY_START & 0x1fffffff) + | |
20 | CONFIG_ZERO_PAGE_OFFSET; | |
21 | #elif defined(CONFIG_32BIT) | |
d02b08f6 SM |
22 | . = CONFIG_PAGE_OFFSET + CONFIG_ZERO_PAGE_OFFSET; |
23 | #else | |
49e6c3e7 | 24 | . = CONFIG_PAGE_OFFSET + CONFIG_MEMORY_START + CONFIG_ZERO_PAGE_OFFSET; |
d02b08f6 SM |
25 | #endif |
26 | ||
49e6c3e7 PM |
27 | _text = .; /* Text and read-only data */ |
28 | ||
29 | .empty_zero_page : { | |
30 | *(.empty_zero_page) | |
31 | } = 0 | |
32 | ||
33 | .text : { | |
bbe215c2 | 34 | HEAD_TEXT |
49e6c3e7 PM |
35 | TEXT_TEXT |
36 | SCHED_TEXT | |
37 | LOCK_TEXT | |
38 | KPROBES_TEXT | |
39 | *(.fixup) | |
40 | *(.gnu.warning) | |
41 | } = 0x0009 | |
42 | ||
43 | . = ALIGN(16); /* Exception table */ | |
44 | __start___ex_table = .; | |
45 | __ex_table : { *(__ex_table) } | |
46 | __stop___ex_table = .; | |
47 | ||
48 | _etext = .; /* End of text section */ | |
49 | ||
49e6c3e7 PM |
50 | NOTES |
51 | RO_DATA(PAGE_SIZE) | |
52 | ||
cbaa118e SM |
53 | /* |
54 | * Code which must be executed uncached and the associated data | |
55 | */ | |
56 | . = ALIGN(PAGE_SIZE); | |
57 | __uncached_start = .; | |
58 | .uncached.text : { *(.uncached.text) } | |
59 | .uncached.data : { *(.uncached.data) } | |
60 | __uncached_end = .; | |
61 | ||
49e6c3e7 PM |
62 | . = ALIGN(THREAD_SIZE); |
63 | .data : { /* Data */ | |
64 | *(.data.init_task) | |
65 | ||
66 | . = ALIGN(L1_CACHE_BYTES); | |
67 | *(.data.cacheline_aligned) | |
68 | ||
69 | . = ALIGN(L1_CACHE_BYTES); | |
70 | *(.data.read_mostly) | |
71 | ||
72 | . = ALIGN(PAGE_SIZE); | |
73 | *(.data.page_aligned) | |
74 | ||
75 | __nosave_begin = .; | |
76 | *(.data.nosave) | |
77 | . = ALIGN(PAGE_SIZE); | |
78 | __nosave_end = .; | |
79 | ||
80 | DATA_DATA | |
81 | CONSTRUCTORS | |
82 | } | |
83 | ||
84 | _edata = .; /* End of data section */ | |
85 | ||
86 | . = ALIGN(PAGE_SIZE); /* Init code and data */ | |
87 | __init_begin = .; | |
88 | _sinittext = .; | |
01ba2bdc | 89 | .init.text : { INIT_TEXT } |
49e6c3e7 | 90 | _einittext = .; |
01ba2bdc | 91 | .init.data : { INIT_DATA } |
49e6c3e7 PM |
92 | |
93 | . = ALIGN(16); | |
94 | __setup_start = .; | |
95 | .init.setup : { *(.init.setup) } | |
96 | __setup_end = .; | |
97 | ||
98 | __initcall_start = .; | |
99 | .initcall.init : { | |
100 | INITCALLS | |
101 | } | |
102 | __initcall_end = .; | |
103 | __con_initcall_start = .; | |
104 | .con_initcall.init : { *(.con_initcall.init) } | |
105 | __con_initcall_end = .; | |
106 | ||
107 | SECURITY_INIT | |
108 | ||
109 | #ifdef CONFIG_BLK_DEV_INITRD | |
110 | . = ALIGN(PAGE_SIZE); | |
111 | __initramfs_start = .; | |
112 | .init.ramfs : { *(.init.ramfs) } | |
113 | __initramfs_end = .; | |
114 | #endif | |
115 | ||
116 | . = ALIGN(4); | |
117 | __machvec_start = .; | |
118 | .machvec.init : { *(.machvec.init) } | |
119 | __machvec_end = .; | |
120 | ||
121 | PERCPU(PAGE_SIZE) | |
122 | ||
123 | /* | |
124 | * .exit.text is discarded at runtime, not link time, to deal with | |
125 | * references from __bug_table | |
126 | */ | |
01ba2bdc SR |
127 | .exit.text : { EXIT_TEXT } |
128 | .exit.data : { EXIT_DATA } | |
49e6c3e7 PM |
129 | |
130 | . = ALIGN(PAGE_SIZE); | |
131 | .bss : { | |
132 | __init_end = .; | |
133 | __bss_start = .; /* BSS */ | |
134 | *(.bss.page_aligned) | |
135 | *(.bss) | |
136 | *(COMMON) | |
137 | . = ALIGN(4); | |
138 | _ebss = .; /* uClinux MTD sucks */ | |
139 | _end = . ; | |
140 | } | |
141 | ||
142 | /* | |
143 | * When something in the kernel is NOT compiled as a module, the | |
144 | * module cleanup code and data are put into these segments. Both | |
145 | * can then be thrown away, as cleanup code is never called unless | |
146 | * it's a module. | |
147 | */ | |
148 | /DISCARD/ : { | |
149 | *(.exitcall.exit) | |
150 | } | |
151 | ||
152 | STABS_DEBUG | |
153 | DWARF_DEBUG | |
154 | } |