6 #define VMLINUX_SYMBOL(_sym_) _sym_
9 /* Align . to a 8 byte boundary equals to maximum function alignment. */
10 #define ALIGN_FUNCTION() . = ALIGN(8)
12 /* The actual configuration determine if the init/exit sections
13 * are handled as text/data or they can be discarded (which
14 * often happens at runtime)
17 #define DEV_KEEP(sec) *(.dev##sec)
18 #define DEV_DISCARD(sec)
21 #define DEV_DISCARD(sec) *(.dev##sec)
24 #ifdef CONFIG_HOTPLUG_CPU
25 #define CPU_KEEP(sec) *(.cpu##sec)
26 #define CPU_DISCARD(sec)
29 #define CPU_DISCARD(sec) *(.cpu##sec)
32 #if defined(CONFIG_MEMORY_HOTPLUG)
33 #define MEM_KEEP(sec) *(.mem##sec)
34 #define MEM_DISCARD(sec)
37 #define MEM_DISCARD(sec) *(.mem##sec)
40 #ifdef CONFIG_FTRACE_MCOUNT_RECORD
41 #define MCOUNT_REC() VMLINUX_SYMBOL(__start_mcount_loc) = .; \
43 VMLINUX_SYMBOL(__stop_mcount_loc) = .;
48 #ifdef CONFIG_TRACE_UNLIKELY_PROFILE
49 #define LIKELY_PROFILE() VMLINUX_SYMBOL(__start_likely_profile) = .; \
51 VMLINUX_SYMBOL(__stop_likely_profile) = .; \
52 VMLINUX_SYMBOL(__start_unlikely_profile) = .; \
54 VMLINUX_SYMBOL(__stop_unlikely_profile) = .;
56 #define LIKELY_PROFILE()
71 VMLINUX_SYMBOL(__start___markers) = .; \
73 VMLINUX_SYMBOL(__stop___markers) = .; \
74 VMLINUX_SYMBOL(__start___tracepoints) = .; \
76 VMLINUX_SYMBOL(__stop___tracepoints) = .; \
79 #define RO_DATA(align) \
81 .rodata : AT(ADDR(.rodata) - LOAD_OFFSET) { \
82 VMLINUX_SYMBOL(__start_rodata) = .; \
83 *(.rodata) *(.rodata.*) \
84 *(__vermagic) /* Kernel version magic */ \
85 *(__markers_strings) /* Markers: strings */ \
86 *(__tracepoints_strings)/* Tracepoints: strings */ \
89 .rodata1 : AT(ADDR(.rodata1) - LOAD_OFFSET) { \
96 .pci_fixup : AT(ADDR(.pci_fixup) - LOAD_OFFSET) { \
97 VMLINUX_SYMBOL(__start_pci_fixups_early) = .; \
99 VMLINUX_SYMBOL(__end_pci_fixups_early) = .; \
100 VMLINUX_SYMBOL(__start_pci_fixups_header) = .; \
101 *(.pci_fixup_header) \
102 VMLINUX_SYMBOL(__end_pci_fixups_header) = .; \
103 VMLINUX_SYMBOL(__start_pci_fixups_final) = .; \
104 *(.pci_fixup_final) \
105 VMLINUX_SYMBOL(__end_pci_fixups_final) = .; \
106 VMLINUX_SYMBOL(__start_pci_fixups_enable) = .; \
107 *(.pci_fixup_enable) \
108 VMLINUX_SYMBOL(__end_pci_fixups_enable) = .; \
109 VMLINUX_SYMBOL(__start_pci_fixups_resume) = .; \
110 *(.pci_fixup_resume) \
111 VMLINUX_SYMBOL(__end_pci_fixups_resume) = .; \
112 VMLINUX_SYMBOL(__start_pci_fixups_resume_early) = .; \
113 *(.pci_fixup_resume_early) \
114 VMLINUX_SYMBOL(__end_pci_fixups_resume_early) = .; \
115 VMLINUX_SYMBOL(__start_pci_fixups_suspend) = .; \
116 *(.pci_fixup_suspend) \
117 VMLINUX_SYMBOL(__end_pci_fixups_suspend) = .; \
120 /* Built-in firmware blobs */ \
121 .builtin_fw : AT(ADDR(.builtin_fw) - LOAD_OFFSET) { \
122 VMLINUX_SYMBOL(__start_builtin_fw) = .; \
124 VMLINUX_SYMBOL(__end_builtin_fw) = .; \
127 /* RapidIO route ops */ \
128 .rio_route : AT(ADDR(.rio_route) - LOAD_OFFSET) { \
129 VMLINUX_SYMBOL(__start_rio_route_ops) = .; \
131 VMLINUX_SYMBOL(__end_rio_route_ops) = .; \
136 /* Kernel symbol table: Normal symbols */ \
137 __ksymtab : AT(ADDR(__ksymtab) - LOAD_OFFSET) { \
138 VMLINUX_SYMBOL(__start___ksymtab) = .; \
140 VMLINUX_SYMBOL(__stop___ksymtab) = .; \
143 /* Kernel symbol table: GPL-only symbols */ \
144 __ksymtab_gpl : AT(ADDR(__ksymtab_gpl) - LOAD_OFFSET) { \
145 VMLINUX_SYMBOL(__start___ksymtab_gpl) = .; \
147 VMLINUX_SYMBOL(__stop___ksymtab_gpl) = .; \
150 /* Kernel symbol table: Normal unused symbols */ \
151 __ksymtab_unused : AT(ADDR(__ksymtab_unused) - LOAD_OFFSET) { \
152 VMLINUX_SYMBOL(__start___ksymtab_unused) = .; \
153 *(__ksymtab_unused) \
154 VMLINUX_SYMBOL(__stop___ksymtab_unused) = .; \
157 /* Kernel symbol table: GPL-only unused symbols */ \
158 __ksymtab_unused_gpl : AT(ADDR(__ksymtab_unused_gpl) - LOAD_OFFSET) { \
159 VMLINUX_SYMBOL(__start___ksymtab_unused_gpl) = .; \
160 *(__ksymtab_unused_gpl) \
161 VMLINUX_SYMBOL(__stop___ksymtab_unused_gpl) = .; \
164 /* Kernel symbol table: GPL-future-only symbols */ \
165 __ksymtab_gpl_future : AT(ADDR(__ksymtab_gpl_future) - LOAD_OFFSET) { \
166 VMLINUX_SYMBOL(__start___ksymtab_gpl_future) = .; \
167 *(__ksymtab_gpl_future) \
168 VMLINUX_SYMBOL(__stop___ksymtab_gpl_future) = .; \
171 /* Kernel symbol table: Normal symbols */ \
172 __kcrctab : AT(ADDR(__kcrctab) - LOAD_OFFSET) { \
173 VMLINUX_SYMBOL(__start___kcrctab) = .; \
175 VMLINUX_SYMBOL(__stop___kcrctab) = .; \
178 /* Kernel symbol table: GPL-only symbols */ \
179 __kcrctab_gpl : AT(ADDR(__kcrctab_gpl) - LOAD_OFFSET) { \
180 VMLINUX_SYMBOL(__start___kcrctab_gpl) = .; \
182 VMLINUX_SYMBOL(__stop___kcrctab_gpl) = .; \
185 /* Kernel symbol table: Normal unused symbols */ \
186 __kcrctab_unused : AT(ADDR(__kcrctab_unused) - LOAD_OFFSET) { \
187 VMLINUX_SYMBOL(__start___kcrctab_unused) = .; \
188 *(__kcrctab_unused) \
189 VMLINUX_SYMBOL(__stop___kcrctab_unused) = .; \
192 /* Kernel symbol table: GPL-only unused symbols */ \
193 __kcrctab_unused_gpl : AT(ADDR(__kcrctab_unused_gpl) - LOAD_OFFSET) { \
194 VMLINUX_SYMBOL(__start___kcrctab_unused_gpl) = .; \
195 *(__kcrctab_unused_gpl) \
196 VMLINUX_SYMBOL(__stop___kcrctab_unused_gpl) = .; \
199 /* Kernel symbol table: GPL-future-only symbols */ \
200 __kcrctab_gpl_future : AT(ADDR(__kcrctab_gpl_future) - LOAD_OFFSET) { \
201 VMLINUX_SYMBOL(__start___kcrctab_gpl_future) = .; \
202 *(__kcrctab_gpl_future) \
203 VMLINUX_SYMBOL(__stop___kcrctab_gpl_future) = .; \
206 /* Kernel symbol table: strings */ \
207 __ksymtab_strings : AT(ADDR(__ksymtab_strings) - LOAD_OFFSET) { \
208 *(__ksymtab_strings) \
211 /* __*init sections */ \
212 __init_rodata : AT(ADDR(__init_rodata) - LOAD_OFFSET) { \
215 DEV_KEEP(init.rodata) \
216 DEV_KEEP(exit.rodata) \
217 CPU_KEEP(init.rodata) \
218 CPU_KEEP(exit.rodata) \
219 MEM_KEEP(init.rodata) \
220 MEM_KEEP(exit.rodata) \
223 /* Built-in module parameters. */ \
224 __param : AT(ADDR(__param) - LOAD_OFFSET) { \
225 VMLINUX_SYMBOL(__start___param) = .; \
227 VMLINUX_SYMBOL(__stop___param) = .; \
228 . = ALIGN((align)); \
229 VMLINUX_SYMBOL(__end_rodata) = .; \
233 /* RODATA provided for backward compatibility.
234 * All archs are supposed to use RO_DATA() */
235 #define RODATA RO_DATA(4096)
237 #define SECURITY_INIT \
238 .security_initcall.init : AT(ADDR(.security_initcall.init) - LOAD_OFFSET) { \
239 VMLINUX_SYMBOL(__security_initcall_start) = .; \
240 *(.security_initcall.init) \
241 VMLINUX_SYMBOL(__security_initcall_end) = .; \
244 /* .text section. Map to function alignment to avoid address changes
245 * during second ld run in second ld pass when generating System.map */
251 *(.text.init.refok) \
252 *(.exit.text.refok) \
253 DEV_KEEP(init.text) \
254 DEV_KEEP(exit.text) \
255 CPU_KEEP(init.text) \
256 CPU_KEEP(exit.text) \
257 MEM_KEEP(init.text) \
258 MEM_KEEP(exit.text) \
262 /* sched.text is aling to function alignment to secure we have same
263 * address even at second ld pass when generating System.map */
266 VMLINUX_SYMBOL(__sched_text_start) = .; \
268 VMLINUX_SYMBOL(__sched_text_end) = .;
270 /* spinlock.text is aling to function alignment to secure we have same
271 * address even at second ld pass when generating System.map */
274 VMLINUX_SYMBOL(__lock_text_start) = .; \
276 VMLINUX_SYMBOL(__lock_text_end) = .;
278 #define KPROBES_TEXT \
280 VMLINUX_SYMBOL(__kprobes_text_start) = .; \
282 VMLINUX_SYMBOL(__kprobes_text_end) = .;
284 /* Section used for early init (in .S files) */
285 #define HEAD_TEXT *(.head.text)
287 /* init and exit section handling */
290 DEV_DISCARD(init.data) \
291 DEV_DISCARD(init.rodata) \
292 CPU_DISCARD(init.data) \
293 CPU_DISCARD(init.rodata) \
294 MEM_DISCARD(init.data) \
295 MEM_DISCARD(init.rodata) \
296 /* implement dynamic printk debug */ \
297 VMLINUX_SYMBOL(__start___verbose_strings) = .; \
298 *(__verbose_strings) \
299 VMLINUX_SYMBOL(__stop___verbose_strings) = .; \
301 VMLINUX_SYMBOL(__start___verbose) = .; \
303 VMLINUX_SYMBOL(__stop___verbose) = .;
307 DEV_DISCARD(init.text) \
308 CPU_DISCARD(init.text) \
309 MEM_DISCARD(init.text)
313 DEV_DISCARD(exit.data) \
314 DEV_DISCARD(exit.rodata) \
315 CPU_DISCARD(exit.data) \
316 CPU_DISCARD(exit.rodata) \
317 MEM_DISCARD(exit.data) \
318 MEM_DISCARD(exit.rodata)
322 DEV_DISCARD(exit.text) \
323 CPU_DISCARD(exit.text) \
324 MEM_DISCARD(exit.text)
326 /* DWARF debug sections.
327 Symbols in the DWARF debugging sections are relative to
328 the beginning of the section so we begin them at 0. */
329 #define DWARF_DEBUG \
331 .debug 0 : { *(.debug) } \
332 .line 0 : { *(.line) } \
333 /* GNU DWARF 1 extensions */ \
334 .debug_srcinfo 0 : { *(.debug_srcinfo) } \
335 .debug_sfnames 0 : { *(.debug_sfnames) } \
336 /* DWARF 1.1 and DWARF 2 */ \
337 .debug_aranges 0 : { *(.debug_aranges) } \
338 .debug_pubnames 0 : { *(.debug_pubnames) } \
340 .debug_info 0 : { *(.debug_info \
341 .gnu.linkonce.wi.*) } \
342 .debug_abbrev 0 : { *(.debug_abbrev) } \
343 .debug_line 0 : { *(.debug_line) } \
344 .debug_frame 0 : { *(.debug_frame) } \
345 .debug_str 0 : { *(.debug_str) } \
346 .debug_loc 0 : { *(.debug_loc) } \
347 .debug_macinfo 0 : { *(.debug_macinfo) } \
348 /* SGI/MIPS DWARF 2 extensions */ \
349 .debug_weaknames 0 : { *(.debug_weaknames) } \
350 .debug_funcnames 0 : { *(.debug_funcnames) } \
351 .debug_typenames 0 : { *(.debug_typenames) } \
352 .debug_varnames 0 : { *(.debug_varnames) } \
354 /* Stabs debugging sections. */
355 #define STABS_DEBUG \
356 .stab 0 : { *(.stab) } \
357 .stabstr 0 : { *(.stabstr) } \
358 .stab.excl 0 : { *(.stab.excl) } \
359 .stab.exclstr 0 : { *(.stab.exclstr) } \
360 .stab.index 0 : { *(.stab.index) } \
361 .stab.indexstr 0 : { *(.stab.indexstr) } \
362 .comment 0 : { *(.comment) }
364 #ifdef CONFIG_GENERIC_BUG
367 __bug_table : AT(ADDR(__bug_table) - LOAD_OFFSET) { \
368 VMLINUX_SYMBOL(__start___bug_table) = .; \
370 VMLINUX_SYMBOL(__stop___bug_table) = .; \
376 #ifdef CONFIG_PM_TRACE
379 .tracedata : AT(ADDR(.tracedata) - LOAD_OFFSET) { \
380 VMLINUX_SYMBOL(__tracedata_start) = .; \
382 VMLINUX_SYMBOL(__tracedata_end) = .; \
389 .notes : AT(ADDR(.notes) - LOAD_OFFSET) { \
390 VMLINUX_SYMBOL(__start_notes) = .; \
392 VMLINUX_SYMBOL(__stop_notes) = .; \
396 *(.initcallearly.init) \
397 VMLINUX_SYMBOL(__early_initcall_end) = .; \
399 *(.initcall0s.init) \
401 *(.initcall1s.init) \
403 *(.initcall2s.init) \
405 *(.initcall3s.init) \
407 *(.initcall4s.init) \
409 *(.initcall5s.init) \
410 *(.initcallrootfs.init) \
412 *(.initcall6s.init) \
416 #define PERCPU(align) \
418 VMLINUX_SYMBOL(__per_cpu_start) = .; \
419 .data.percpu : AT(ADDR(.data.percpu) - LOAD_OFFSET) { \
420 *(.data.percpu.page_aligned) \
422 *(.data.percpu.shared_aligned) \
424 VMLINUX_SYMBOL(__per_cpu_end) = .;