blob: 52e2d69ee535ec664ffe5422e58b9af0281ad1b6 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef LOAD_OFFSET
2#define LOAD_OFFSET 0
3#endif
4
5#ifndef VMLINUX_SYMBOL
6#define VMLINUX_SYMBOL(_sym_) _sym_
7#endif
8
Sam Ravnborg6d30e3a2005-07-14 20:15:44 +00009/* Align . to a 8 byte boundary equals to maximum function alignment. */
10#define ALIGN_FUNCTION() . = ALIGN(8)
11
Sam Ravnborgca967252007-05-17 13:38:44 +020012/* .data section */
13#define DATA_DATA \
14 *(.data)
15
Linus Torvalds1da177e2005-04-16 15:20:36 -070016#define RODATA \
Arjan van de Ven37b73c82006-01-06 00:12:01 -080017 . = ALIGN(4096); \
Linus Torvalds1da177e2005-04-16 15:20:36 -070018 .rodata : AT(ADDR(.rodata) - LOAD_OFFSET) { \
Vivek Goyal65695802006-12-07 02:14:03 +010019 VMLINUX_SYMBOL(__start_rodata) = .; \
Linus Torvalds1da177e2005-04-16 15:20:36 -070020 *(.rodata) *(.rodata.*) \
21 *(__vermagic) /* Kernel version magic */ \
22 } \
23 \
24 .rodata1 : AT(ADDR(.rodata1) - LOAD_OFFSET) { \
25 *(.rodata1) \
26 } \
27 \
28 /* PCI quirks */ \
29 .pci_fixup : AT(ADDR(.pci_fixup) - LOAD_OFFSET) { \
30 VMLINUX_SYMBOL(__start_pci_fixups_early) = .; \
31 *(.pci_fixup_early) \
32 VMLINUX_SYMBOL(__end_pci_fixups_early) = .; \
33 VMLINUX_SYMBOL(__start_pci_fixups_header) = .; \
34 *(.pci_fixup_header) \
35 VMLINUX_SYMBOL(__end_pci_fixups_header) = .; \
36 VMLINUX_SYMBOL(__start_pci_fixups_final) = .; \
37 *(.pci_fixup_final) \
38 VMLINUX_SYMBOL(__end_pci_fixups_final) = .; \
39 VMLINUX_SYMBOL(__start_pci_fixups_enable) = .; \
40 *(.pci_fixup_enable) \
41 VMLINUX_SYMBOL(__end_pci_fixups_enable) = .; \
Alan Cox1597cac2006-12-04 15:14:45 -080042 VMLINUX_SYMBOL(__start_pci_fixups_resume) = .; \
43 *(.pci_fixup_resume) \
44 VMLINUX_SYMBOL(__end_pci_fixups_resume) = .; \
Linus Torvalds1da177e2005-04-16 15:20:36 -070045 } \
46 \
Matt Porter394b7012005-11-07 01:00:15 -080047 /* RapidIO route ops */ \
48 .rio_route : AT(ADDR(.rio_route) - LOAD_OFFSET) { \
49 VMLINUX_SYMBOL(__start_rio_route_ops) = .; \
50 *(.rio_route_ops) \
51 VMLINUX_SYMBOL(__end_rio_route_ops) = .; \
52 } \
53 \
Linus Torvalds1da177e2005-04-16 15:20:36 -070054 /* Kernel symbol table: Normal symbols */ \
55 __ksymtab : AT(ADDR(__ksymtab) - LOAD_OFFSET) { \
56 VMLINUX_SYMBOL(__start___ksymtab) = .; \
57 *(__ksymtab) \
58 VMLINUX_SYMBOL(__stop___ksymtab) = .; \
59 } \
60 \
61 /* Kernel symbol table: GPL-only symbols */ \
62 __ksymtab_gpl : AT(ADDR(__ksymtab_gpl) - LOAD_OFFSET) { \
63 VMLINUX_SYMBOL(__start___ksymtab_gpl) = .; \
64 *(__ksymtab_gpl) \
65 VMLINUX_SYMBOL(__stop___ksymtab_gpl) = .; \
66 } \
67 \
Arjan van de Venf71d20e2006-06-28 04:26:45 -070068 /* Kernel symbol table: Normal unused symbols */ \
69 __ksymtab_unused : AT(ADDR(__ksymtab_unused) - LOAD_OFFSET) { \
70 VMLINUX_SYMBOL(__start___ksymtab_unused) = .; \
71 *(__ksymtab_unused) \
72 VMLINUX_SYMBOL(__stop___ksymtab_unused) = .; \
73 } \
74 \
75 /* Kernel symbol table: GPL-only unused symbols */ \
76 __ksymtab_unused_gpl : AT(ADDR(__ksymtab_unused_gpl) - LOAD_OFFSET) { \
77 VMLINUX_SYMBOL(__start___ksymtab_unused_gpl) = .; \
78 *(__ksymtab_unused_gpl) \
79 VMLINUX_SYMBOL(__stop___ksymtab_unused_gpl) = .; \
80 } \
81 \
Greg Kroah-Hartman9f28bb72006-03-20 13:17:13 -080082 /* Kernel symbol table: GPL-future-only symbols */ \
83 __ksymtab_gpl_future : AT(ADDR(__ksymtab_gpl_future) - LOAD_OFFSET) { \
84 VMLINUX_SYMBOL(__start___ksymtab_gpl_future) = .; \
85 *(__ksymtab_gpl_future) \
86 VMLINUX_SYMBOL(__stop___ksymtab_gpl_future) = .; \
87 } \
88 \
Linus Torvalds1da177e2005-04-16 15:20:36 -070089 /* Kernel symbol table: Normal symbols */ \
90 __kcrctab : AT(ADDR(__kcrctab) - LOAD_OFFSET) { \
91 VMLINUX_SYMBOL(__start___kcrctab) = .; \
92 *(__kcrctab) \
93 VMLINUX_SYMBOL(__stop___kcrctab) = .; \
94 } \
95 \
96 /* Kernel symbol table: GPL-only symbols */ \
97 __kcrctab_gpl : AT(ADDR(__kcrctab_gpl) - LOAD_OFFSET) { \
98 VMLINUX_SYMBOL(__start___kcrctab_gpl) = .; \
99 *(__kcrctab_gpl) \
100 VMLINUX_SYMBOL(__stop___kcrctab_gpl) = .; \
101 } \
102 \
Arjan van de Venf71d20e2006-06-28 04:26:45 -0700103 /* Kernel symbol table: Normal unused symbols */ \
104 __kcrctab_unused : AT(ADDR(__kcrctab_unused) - LOAD_OFFSET) { \
105 VMLINUX_SYMBOL(__start___kcrctab_unused) = .; \
106 *(__kcrctab_unused) \
107 VMLINUX_SYMBOL(__stop___kcrctab_unused) = .; \
108 } \
109 \
110 /* Kernel symbol table: GPL-only unused symbols */ \
111 __kcrctab_unused_gpl : AT(ADDR(__kcrctab_unused_gpl) - LOAD_OFFSET) { \
112 VMLINUX_SYMBOL(__start___kcrctab_unused_gpl) = .; \
113 *(__kcrctab_unused_gpl) \
114 VMLINUX_SYMBOL(__stop___kcrctab_unused_gpl) = .; \
115 } \
116 \
Greg Kroah-Hartman9f28bb72006-03-20 13:17:13 -0800117 /* Kernel symbol table: GPL-future-only symbols */ \
118 __kcrctab_gpl_future : AT(ADDR(__kcrctab_gpl_future) - LOAD_OFFSET) { \
119 VMLINUX_SYMBOL(__start___kcrctab_gpl_future) = .; \
120 *(__kcrctab_gpl_future) \
121 VMLINUX_SYMBOL(__stop___kcrctab_gpl_future) = .; \
122 } \
123 \
Linus Torvalds1da177e2005-04-16 15:20:36 -0700124 /* Kernel symbol table: strings */ \
125 __ksymtab_strings : AT(ADDR(__ksymtab_strings) - LOAD_OFFSET) { \
126 *(__ksymtab_strings) \
127 } \
128 \
129 /* Built-in module parameters. */ \
130 __param : AT(ADDR(__param) - LOAD_OFFSET) { \
131 VMLINUX_SYMBOL(__start___param) = .; \
132 *(__param) \
133 VMLINUX_SYMBOL(__stop___param) = .; \
Vivek Goyal65695802006-12-07 02:14:03 +0100134 VMLINUX_SYMBOL(__end_rodata) = .; \
Marcelo Tosatti7583ddf2006-09-27 01:51:02 -0700135 } \
Jan Beulich690a9732006-10-21 18:37:01 +0200136 \
Marcelo Tosatti7583ddf2006-09-27 01:51:02 -0700137 . = ALIGN(4096);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700138
139#define SECURITY_INIT \
Eric W. Biederman60bad7f2005-06-25 14:57:46 -0700140 .security_initcall.init : AT(ADDR(.security_initcall.init) - LOAD_OFFSET) { \
Linus Torvalds1da177e2005-04-16 15:20:36 -0700141 VMLINUX_SYMBOL(__security_initcall_start) = .; \
142 *(.security_initcall.init) \
143 VMLINUX_SYMBOL(__security_initcall_end) = .; \
144 }
145
Sam Ravnborg76647092007-05-13 00:31:33 +0200146/* .text section. Map to function alignment to avoid address changes
147 * during second ld run in second ld pass when generating System.map */
148#define TEXT_TEXT \
149 ALIGN_FUNCTION(); \
150 *(.text)
151
Sam Ravnborg6d30e3a2005-07-14 20:15:44 +0000152/* sched.text is aling to function alignment to secure we have same
153 * address even at second ld pass when generating System.map */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700154#define SCHED_TEXT \
Sam Ravnborg6d30e3a2005-07-14 20:15:44 +0000155 ALIGN_FUNCTION(); \
Linus Torvalds1da177e2005-04-16 15:20:36 -0700156 VMLINUX_SYMBOL(__sched_text_start) = .; \
157 *(.sched.text) \
158 VMLINUX_SYMBOL(__sched_text_end) = .;
159
Sam Ravnborg6d30e3a2005-07-14 20:15:44 +0000160/* spinlock.text is aling to function alignment to secure we have same
161 * address even at second ld pass when generating System.map */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700162#define LOCK_TEXT \
Sam Ravnborg6d30e3a2005-07-14 20:15:44 +0000163 ALIGN_FUNCTION(); \
Linus Torvalds1da177e2005-04-16 15:20:36 -0700164 VMLINUX_SYMBOL(__lock_text_start) = .; \
165 *(.spinlock.text) \
166 VMLINUX_SYMBOL(__lock_text_end) = .;
Prasanna S Panchamukhid0aaff92005-09-06 15:19:26 -0700167
168#define KPROBES_TEXT \
169 ALIGN_FUNCTION(); \
170 VMLINUX_SYMBOL(__kprobes_text_start) = .; \
171 *(.kprobes.text) \
172 VMLINUX_SYMBOL(__kprobes_text_end) = .;
Paolo 'Blaisorblade' Giarrussoa7d0c212005-09-10 19:44:54 +0200173
174 /* DWARF debug sections.
175 Symbols in the DWARF debugging sections are relative to
176 the beginning of the section so we begin them at 0. */
177#define DWARF_DEBUG \
178 /* DWARF 1 */ \
179 .debug 0 : { *(.debug) } \
180 .line 0 : { *(.line) } \
181 /* GNU DWARF 1 extensions */ \
182 .debug_srcinfo 0 : { *(.debug_srcinfo) } \
183 .debug_sfnames 0 : { *(.debug_sfnames) } \
184 /* DWARF 1.1 and DWARF 2 */ \
185 .debug_aranges 0 : { *(.debug_aranges) } \
186 .debug_pubnames 0 : { *(.debug_pubnames) } \
187 /* DWARF 2 */ \
188 .debug_info 0 : { *(.debug_info \
189 .gnu.linkonce.wi.*) } \
190 .debug_abbrev 0 : { *(.debug_abbrev) } \
191 .debug_line 0 : { *(.debug_line) } \
192 .debug_frame 0 : { *(.debug_frame) } \
193 .debug_str 0 : { *(.debug_str) } \
194 .debug_loc 0 : { *(.debug_loc) } \
195 .debug_macinfo 0 : { *(.debug_macinfo) } \
196 /* SGI/MIPS DWARF 2 extensions */ \
197 .debug_weaknames 0 : { *(.debug_weaknames) } \
198 .debug_funcnames 0 : { *(.debug_funcnames) } \
199 .debug_typenames 0 : { *(.debug_typenames) } \
200 .debug_varnames 0 : { *(.debug_varnames) } \
201
202 /* Stabs debugging sections. */
203#define STABS_DEBUG \
204 .stab 0 : { *(.stab) } \
205 .stabstr 0 : { *(.stabstr) } \
206 .stab.excl 0 : { *(.stab.excl) } \
207 .stab.exclstr 0 : { *(.stab.exclstr) } \
208 .stab.index 0 : { *(.stab.index) } \
209 .stab.indexstr 0 : { *(.stab.indexstr) } \
210 .comment 0 : { *(.comment) }
Jeremy Fitzhardinge9c9b8b32006-09-25 23:32:26 -0700211
Jeremy Fitzhardinge7664c5a2006-12-08 02:36:19 -0800212#define BUG_TABLE \
213 . = ALIGN(8); \
214 __bug_table : AT(ADDR(__bug_table) - LOAD_OFFSET) { \
215 __start___bug_table = .; \
216 *(__bug_table) \
217 __stop___bug_table = .; \
218 }
219
Jeremy Fitzhardinge9c9b8b32006-09-25 23:32:26 -0700220#define NOTES \
Jeremy Fitzhardinge03df4f62007-05-02 19:27:17 +0200221 .notes : { *(.note.*) } :note
Andrew Morton61ce1ef2006-10-27 11:41:44 -0700222
223#define INITCALLS \
Linus Torvaldsb3438f82006-11-20 11:47:18 -0800224 *(.initcall0.init) \
225 *(.initcall0s.init) \
Andrew Morton61ce1ef2006-10-27 11:41:44 -0700226 *(.initcall1.init) \
Andrew Morton735a7ff2006-10-27 11:42:37 -0700227 *(.initcall1s.init) \
Andrew Morton61ce1ef2006-10-27 11:41:44 -0700228 *(.initcall2.init) \
Andrew Morton735a7ff2006-10-27 11:42:37 -0700229 *(.initcall2s.init) \
Andrew Morton61ce1ef2006-10-27 11:41:44 -0700230 *(.initcall3.init) \
Andrew Morton735a7ff2006-10-27 11:42:37 -0700231 *(.initcall3s.init) \
Andrew Morton61ce1ef2006-10-27 11:41:44 -0700232 *(.initcall4.init) \
Andrew Morton735a7ff2006-10-27 11:42:37 -0700233 *(.initcall4s.init) \
Andrew Morton61ce1ef2006-10-27 11:41:44 -0700234 *(.initcall5.init) \
Andrew Morton735a7ff2006-10-27 11:42:37 -0700235 *(.initcall5s.init) \
Linus Torvalds8d610dd2006-12-11 12:12:04 -0800236 *(.initcallrootfs.init) \
Andrew Morton61ce1ef2006-10-27 11:41:44 -0700237 *(.initcall6.init) \
Andrew Morton735a7ff2006-10-27 11:42:37 -0700238 *(.initcall6s.init) \
239 *(.initcall7.init) \
240 *(.initcall7s.init)
Andrew Morton61ce1ef2006-10-27 11:41:44 -0700241