Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #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 Ravnborg | 6d30e3a | 2005-07-14 20:15:44 +0000 | [diff] [blame] | 9 | /* Align . to a 8 byte boundary equals to maximum function alignment. */ |
| 10 | #define ALIGN_FUNCTION() . = ALIGN(8) |
| 11 | |
Sam Ravnborg | ca96725 | 2007-05-17 13:38:44 +0200 | [diff] [blame] | 12 | /* .data section */ |
| 13 | #define DATA_DATA \ |
Sam Ravnborg | 0e0d314 | 2007-05-17 20:14:48 +0200 | [diff] [blame] | 14 | *(.data) \ |
Mathieu Desnoyers | 8256e47 | 2007-10-18 23:41:06 -0700 | [diff] [blame] | 15 | *(.data.init.refok) \ |
| 16 | . = ALIGN(8); \ |
| 17 | VMLINUX_SYMBOL(__start___markers) = .; \ |
| 18 | *(__markers) \ |
| 19 | VMLINUX_SYMBOL(__stop___markers) = .; |
Sam Ravnborg | ca96725 | 2007-05-17 13:38:44 +0200 | [diff] [blame] | 20 | |
Sam Ravnborg | 4096b46 | 2007-05-29 21:29:00 +0200 | [diff] [blame] | 21 | #define RO_DATA(align) \ |
| 22 | . = ALIGN((align)); \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 23 | .rodata : AT(ADDR(.rodata) - LOAD_OFFSET) { \ |
Vivek Goyal | 6569580 | 2006-12-07 02:14:03 +0100 | [diff] [blame] | 24 | VMLINUX_SYMBOL(__start_rodata) = .; \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 25 | *(.rodata) *(.rodata.*) \ |
| 26 | *(__vermagic) /* Kernel version magic */ \ |
Mathieu Desnoyers | 8256e47 | 2007-10-18 23:41:06 -0700 | [diff] [blame] | 27 | *(__markers_strings) /* Markers: strings */ \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 28 | } \ |
| 29 | \ |
| 30 | .rodata1 : AT(ADDR(.rodata1) - LOAD_OFFSET) { \ |
| 31 | *(.rodata1) \ |
| 32 | } \ |
| 33 | \ |
| 34 | /* PCI quirks */ \ |
| 35 | .pci_fixup : AT(ADDR(.pci_fixup) - LOAD_OFFSET) { \ |
| 36 | VMLINUX_SYMBOL(__start_pci_fixups_early) = .; \ |
| 37 | *(.pci_fixup_early) \ |
| 38 | VMLINUX_SYMBOL(__end_pci_fixups_early) = .; \ |
| 39 | VMLINUX_SYMBOL(__start_pci_fixups_header) = .; \ |
| 40 | *(.pci_fixup_header) \ |
| 41 | VMLINUX_SYMBOL(__end_pci_fixups_header) = .; \ |
| 42 | VMLINUX_SYMBOL(__start_pci_fixups_final) = .; \ |
| 43 | *(.pci_fixup_final) \ |
| 44 | VMLINUX_SYMBOL(__end_pci_fixups_final) = .; \ |
| 45 | VMLINUX_SYMBOL(__start_pci_fixups_enable) = .; \ |
| 46 | *(.pci_fixup_enable) \ |
| 47 | VMLINUX_SYMBOL(__end_pci_fixups_enable) = .; \ |
Alan Cox | 1597cac | 2006-12-04 15:14:45 -0800 | [diff] [blame] | 48 | VMLINUX_SYMBOL(__start_pci_fixups_resume) = .; \ |
| 49 | *(.pci_fixup_resume) \ |
| 50 | VMLINUX_SYMBOL(__end_pci_fixups_resume) = .; \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 51 | } \ |
| 52 | \ |
Matt Porter | 394b701 | 2005-11-07 01:00:15 -0800 | [diff] [blame] | 53 | /* RapidIO route ops */ \ |
| 54 | .rio_route : AT(ADDR(.rio_route) - LOAD_OFFSET) { \ |
| 55 | VMLINUX_SYMBOL(__start_rio_route_ops) = .; \ |
| 56 | *(.rio_route_ops) \ |
| 57 | VMLINUX_SYMBOL(__end_rio_route_ops) = .; \ |
| 58 | } \ |
| 59 | \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 60 | /* Kernel symbol table: Normal symbols */ \ |
| 61 | __ksymtab : AT(ADDR(__ksymtab) - LOAD_OFFSET) { \ |
| 62 | VMLINUX_SYMBOL(__start___ksymtab) = .; \ |
| 63 | *(__ksymtab) \ |
| 64 | VMLINUX_SYMBOL(__stop___ksymtab) = .; \ |
| 65 | } \ |
| 66 | \ |
| 67 | /* Kernel symbol table: GPL-only symbols */ \ |
| 68 | __ksymtab_gpl : AT(ADDR(__ksymtab_gpl) - LOAD_OFFSET) { \ |
| 69 | VMLINUX_SYMBOL(__start___ksymtab_gpl) = .; \ |
| 70 | *(__ksymtab_gpl) \ |
| 71 | VMLINUX_SYMBOL(__stop___ksymtab_gpl) = .; \ |
| 72 | } \ |
| 73 | \ |
Arjan van de Ven | f71d20e | 2006-06-28 04:26:45 -0700 | [diff] [blame] | 74 | /* Kernel symbol table: Normal unused symbols */ \ |
| 75 | __ksymtab_unused : AT(ADDR(__ksymtab_unused) - LOAD_OFFSET) { \ |
| 76 | VMLINUX_SYMBOL(__start___ksymtab_unused) = .; \ |
| 77 | *(__ksymtab_unused) \ |
| 78 | VMLINUX_SYMBOL(__stop___ksymtab_unused) = .; \ |
| 79 | } \ |
| 80 | \ |
| 81 | /* Kernel symbol table: GPL-only unused symbols */ \ |
| 82 | __ksymtab_unused_gpl : AT(ADDR(__ksymtab_unused_gpl) - LOAD_OFFSET) { \ |
| 83 | VMLINUX_SYMBOL(__start___ksymtab_unused_gpl) = .; \ |
| 84 | *(__ksymtab_unused_gpl) \ |
| 85 | VMLINUX_SYMBOL(__stop___ksymtab_unused_gpl) = .; \ |
| 86 | } \ |
| 87 | \ |
Greg Kroah-Hartman | 9f28bb7 | 2006-03-20 13:17:13 -0800 | [diff] [blame] | 88 | /* Kernel symbol table: GPL-future-only symbols */ \ |
| 89 | __ksymtab_gpl_future : AT(ADDR(__ksymtab_gpl_future) - LOAD_OFFSET) { \ |
| 90 | VMLINUX_SYMBOL(__start___ksymtab_gpl_future) = .; \ |
| 91 | *(__ksymtab_gpl_future) \ |
| 92 | VMLINUX_SYMBOL(__stop___ksymtab_gpl_future) = .; \ |
| 93 | } \ |
| 94 | \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 95 | /* Kernel symbol table: Normal symbols */ \ |
| 96 | __kcrctab : AT(ADDR(__kcrctab) - LOAD_OFFSET) { \ |
| 97 | VMLINUX_SYMBOL(__start___kcrctab) = .; \ |
| 98 | *(__kcrctab) \ |
| 99 | VMLINUX_SYMBOL(__stop___kcrctab) = .; \ |
| 100 | } \ |
| 101 | \ |
| 102 | /* Kernel symbol table: GPL-only symbols */ \ |
| 103 | __kcrctab_gpl : AT(ADDR(__kcrctab_gpl) - LOAD_OFFSET) { \ |
| 104 | VMLINUX_SYMBOL(__start___kcrctab_gpl) = .; \ |
| 105 | *(__kcrctab_gpl) \ |
| 106 | VMLINUX_SYMBOL(__stop___kcrctab_gpl) = .; \ |
| 107 | } \ |
| 108 | \ |
Arjan van de Ven | f71d20e | 2006-06-28 04:26:45 -0700 | [diff] [blame] | 109 | /* Kernel symbol table: Normal unused symbols */ \ |
| 110 | __kcrctab_unused : AT(ADDR(__kcrctab_unused) - LOAD_OFFSET) { \ |
| 111 | VMLINUX_SYMBOL(__start___kcrctab_unused) = .; \ |
| 112 | *(__kcrctab_unused) \ |
| 113 | VMLINUX_SYMBOL(__stop___kcrctab_unused) = .; \ |
| 114 | } \ |
| 115 | \ |
| 116 | /* Kernel symbol table: GPL-only unused symbols */ \ |
| 117 | __kcrctab_unused_gpl : AT(ADDR(__kcrctab_unused_gpl) - LOAD_OFFSET) { \ |
| 118 | VMLINUX_SYMBOL(__start___kcrctab_unused_gpl) = .; \ |
| 119 | *(__kcrctab_unused_gpl) \ |
| 120 | VMLINUX_SYMBOL(__stop___kcrctab_unused_gpl) = .; \ |
| 121 | } \ |
| 122 | \ |
Greg Kroah-Hartman | 9f28bb7 | 2006-03-20 13:17:13 -0800 | [diff] [blame] | 123 | /* Kernel symbol table: GPL-future-only symbols */ \ |
| 124 | __kcrctab_gpl_future : AT(ADDR(__kcrctab_gpl_future) - LOAD_OFFSET) { \ |
| 125 | VMLINUX_SYMBOL(__start___kcrctab_gpl_future) = .; \ |
| 126 | *(__kcrctab_gpl_future) \ |
| 127 | VMLINUX_SYMBOL(__stop___kcrctab_gpl_future) = .; \ |
| 128 | } \ |
| 129 | \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 130 | /* Kernel symbol table: strings */ \ |
| 131 | __ksymtab_strings : AT(ADDR(__ksymtab_strings) - LOAD_OFFSET) { \ |
| 132 | *(__ksymtab_strings) \ |
| 133 | } \ |
| 134 | \ |
| 135 | /* Built-in module parameters. */ \ |
| 136 | __param : AT(ADDR(__param) - LOAD_OFFSET) { \ |
| 137 | VMLINUX_SYMBOL(__start___param) = .; \ |
| 138 | *(__param) \ |
| 139 | VMLINUX_SYMBOL(__stop___param) = .; \ |
Vivek Goyal | 6569580 | 2006-12-07 02:14:03 +0100 | [diff] [blame] | 140 | VMLINUX_SYMBOL(__end_rodata) = .; \ |
Marcelo Tosatti | 7583ddf | 2006-09-27 01:51:02 -0700 | [diff] [blame] | 141 | } \ |
Jan Beulich | 690a973 | 2006-10-21 18:37:01 +0200 | [diff] [blame] | 142 | \ |
Sam Ravnborg | 4096b46 | 2007-05-29 21:29:00 +0200 | [diff] [blame] | 143 | . = ALIGN((align)); |
| 144 | |
| 145 | /* RODATA provided for backward compatibility. |
| 146 | * All archs are supposed to use RO_DATA() */ |
| 147 | #define RODATA RO_DATA(4096) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 148 | |
| 149 | #define SECURITY_INIT \ |
Eric W. Biederman | 60bad7f | 2005-06-25 14:57:46 -0700 | [diff] [blame] | 150 | .security_initcall.init : AT(ADDR(.security_initcall.init) - LOAD_OFFSET) { \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 151 | VMLINUX_SYMBOL(__security_initcall_start) = .; \ |
| 152 | *(.security_initcall.init) \ |
| 153 | VMLINUX_SYMBOL(__security_initcall_end) = .; \ |
| 154 | } |
| 155 | |
Sam Ravnborg | 7664709 | 2007-05-13 00:31:33 +0200 | [diff] [blame] | 156 | /* .text section. Map to function alignment to avoid address changes |
| 157 | * during second ld run in second ld pass when generating System.map */ |
| 158 | #define TEXT_TEXT \ |
| 159 | ALIGN_FUNCTION(); \ |
Sam Ravnborg | 0e0d314 | 2007-05-17 20:14:48 +0200 | [diff] [blame] | 160 | *(.text) \ |
Al Viro | 23ec23c | 2007-10-13 08:40:24 +0100 | [diff] [blame] | 161 | *(.text.init.refok) \ |
| 162 | *(.exit.text.refok) |
Sam Ravnborg | 7664709 | 2007-05-13 00:31:33 +0200 | [diff] [blame] | 163 | |
Sam Ravnborg | 6d30e3a | 2005-07-14 20:15:44 +0000 | [diff] [blame] | 164 | /* sched.text is aling to function alignment to secure we have same |
| 165 | * address even at second ld pass when generating System.map */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 166 | #define SCHED_TEXT \ |
Sam Ravnborg | 6d30e3a | 2005-07-14 20:15:44 +0000 | [diff] [blame] | 167 | ALIGN_FUNCTION(); \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 168 | VMLINUX_SYMBOL(__sched_text_start) = .; \ |
| 169 | *(.sched.text) \ |
| 170 | VMLINUX_SYMBOL(__sched_text_end) = .; |
| 171 | |
Sam Ravnborg | 6d30e3a | 2005-07-14 20:15:44 +0000 | [diff] [blame] | 172 | /* spinlock.text is aling to function alignment to secure we have same |
| 173 | * address even at second ld pass when generating System.map */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 174 | #define LOCK_TEXT \ |
Sam Ravnborg | 6d30e3a | 2005-07-14 20:15:44 +0000 | [diff] [blame] | 175 | ALIGN_FUNCTION(); \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 176 | VMLINUX_SYMBOL(__lock_text_start) = .; \ |
| 177 | *(.spinlock.text) \ |
| 178 | VMLINUX_SYMBOL(__lock_text_end) = .; |
Prasanna S Panchamukhi | d0aaff9 | 2005-09-06 15:19:26 -0700 | [diff] [blame] | 179 | |
| 180 | #define KPROBES_TEXT \ |
| 181 | ALIGN_FUNCTION(); \ |
| 182 | VMLINUX_SYMBOL(__kprobes_text_start) = .; \ |
| 183 | *(.kprobes.text) \ |
| 184 | VMLINUX_SYMBOL(__kprobes_text_end) = .; |
Paolo 'Blaisorblade' Giarrusso | a7d0c21 | 2005-09-10 19:44:54 +0200 | [diff] [blame] | 185 | |
Sam Ravnborg | 01ba2bd | 2008-01-20 14:15:03 +0100 | [diff] [blame] | 186 | /* init and exit section handling */ |
| 187 | #define INIT_TEXT *(.init.text) |
| 188 | #define INIT_DATA *(.init.data) |
| 189 | #define EXIT_TEXT *(.exit.text) |
| 190 | #define EXIT_DATA *(.exit.data) |
| 191 | |
| 192 | |
Paolo 'Blaisorblade' Giarrusso | a7d0c21 | 2005-09-10 19:44:54 +0200 | [diff] [blame] | 193 | /* DWARF debug sections. |
| 194 | Symbols in the DWARF debugging sections are relative to |
| 195 | the beginning of the section so we begin them at 0. */ |
| 196 | #define DWARF_DEBUG \ |
| 197 | /* DWARF 1 */ \ |
| 198 | .debug 0 : { *(.debug) } \ |
| 199 | .line 0 : { *(.line) } \ |
| 200 | /* GNU DWARF 1 extensions */ \ |
| 201 | .debug_srcinfo 0 : { *(.debug_srcinfo) } \ |
| 202 | .debug_sfnames 0 : { *(.debug_sfnames) } \ |
| 203 | /* DWARF 1.1 and DWARF 2 */ \ |
| 204 | .debug_aranges 0 : { *(.debug_aranges) } \ |
| 205 | .debug_pubnames 0 : { *(.debug_pubnames) } \ |
| 206 | /* DWARF 2 */ \ |
| 207 | .debug_info 0 : { *(.debug_info \ |
| 208 | .gnu.linkonce.wi.*) } \ |
| 209 | .debug_abbrev 0 : { *(.debug_abbrev) } \ |
| 210 | .debug_line 0 : { *(.debug_line) } \ |
| 211 | .debug_frame 0 : { *(.debug_frame) } \ |
| 212 | .debug_str 0 : { *(.debug_str) } \ |
| 213 | .debug_loc 0 : { *(.debug_loc) } \ |
| 214 | .debug_macinfo 0 : { *(.debug_macinfo) } \ |
| 215 | /* SGI/MIPS DWARF 2 extensions */ \ |
| 216 | .debug_weaknames 0 : { *(.debug_weaknames) } \ |
| 217 | .debug_funcnames 0 : { *(.debug_funcnames) } \ |
| 218 | .debug_typenames 0 : { *(.debug_typenames) } \ |
| 219 | .debug_varnames 0 : { *(.debug_varnames) } \ |
| 220 | |
| 221 | /* Stabs debugging sections. */ |
| 222 | #define STABS_DEBUG \ |
| 223 | .stab 0 : { *(.stab) } \ |
| 224 | .stabstr 0 : { *(.stabstr) } \ |
| 225 | .stab.excl 0 : { *(.stab.excl) } \ |
| 226 | .stab.exclstr 0 : { *(.stab.exclstr) } \ |
| 227 | .stab.index 0 : { *(.stab.index) } \ |
| 228 | .stab.indexstr 0 : { *(.stab.indexstr) } \ |
| 229 | .comment 0 : { *(.comment) } |
Jeremy Fitzhardinge | 9c9b8b3 | 2006-09-25 23:32:26 -0700 | [diff] [blame] | 230 | |
Jeremy Fitzhardinge | 7664c5a | 2006-12-08 02:36:19 -0800 | [diff] [blame] | 231 | #define BUG_TABLE \ |
| 232 | . = ALIGN(8); \ |
| 233 | __bug_table : AT(ADDR(__bug_table) - LOAD_OFFSET) { \ |
| 234 | __start___bug_table = .; \ |
| 235 | *(__bug_table) \ |
| 236 | __stop___bug_table = .; \ |
| 237 | } |
| 238 | |
Jeremy Fitzhardinge | 9c9b8b3 | 2006-09-25 23:32:26 -0700 | [diff] [blame] | 239 | #define NOTES \ |
Roland McGrath | cbe8712 | 2007-07-19 01:48:36 -0700 | [diff] [blame] | 240 | .notes : AT(ADDR(.notes) - LOAD_OFFSET) { \ |
| 241 | VMLINUX_SYMBOL(__start_notes) = .; \ |
| 242 | *(.note.*) \ |
| 243 | VMLINUX_SYMBOL(__stop_notes) = .; \ |
| 244 | } |
Andrew Morton | 61ce1ef | 2006-10-27 11:41:44 -0700 | [diff] [blame] | 245 | |
| 246 | #define INITCALLS \ |
Linus Torvalds | b3438f8 | 2006-11-20 11:47:18 -0800 | [diff] [blame] | 247 | *(.initcall0.init) \ |
| 248 | *(.initcall0s.init) \ |
Andrew Morton | 61ce1ef | 2006-10-27 11:41:44 -0700 | [diff] [blame] | 249 | *(.initcall1.init) \ |
Andrew Morton | 735a7ff | 2006-10-27 11:42:37 -0700 | [diff] [blame] | 250 | *(.initcall1s.init) \ |
Andrew Morton | 61ce1ef | 2006-10-27 11:41:44 -0700 | [diff] [blame] | 251 | *(.initcall2.init) \ |
Andrew Morton | 735a7ff | 2006-10-27 11:42:37 -0700 | [diff] [blame] | 252 | *(.initcall2s.init) \ |
Andrew Morton | 61ce1ef | 2006-10-27 11:41:44 -0700 | [diff] [blame] | 253 | *(.initcall3.init) \ |
Andrew Morton | 735a7ff | 2006-10-27 11:42:37 -0700 | [diff] [blame] | 254 | *(.initcall3s.init) \ |
Andrew Morton | 61ce1ef | 2006-10-27 11:41:44 -0700 | [diff] [blame] | 255 | *(.initcall4.init) \ |
Andrew Morton | 735a7ff | 2006-10-27 11:42:37 -0700 | [diff] [blame] | 256 | *(.initcall4s.init) \ |
Andrew Morton | 61ce1ef | 2006-10-27 11:41:44 -0700 | [diff] [blame] | 257 | *(.initcall5.init) \ |
Andrew Morton | 735a7ff | 2006-10-27 11:42:37 -0700 | [diff] [blame] | 258 | *(.initcall5s.init) \ |
Linus Torvalds | 8d610dd | 2006-12-11 12:12:04 -0800 | [diff] [blame] | 259 | *(.initcallrootfs.init) \ |
Andrew Morton | 61ce1ef | 2006-10-27 11:41:44 -0700 | [diff] [blame] | 260 | *(.initcall6.init) \ |
Andrew Morton | 735a7ff | 2006-10-27 11:42:37 -0700 | [diff] [blame] | 261 | *(.initcall6s.init) \ |
| 262 | *(.initcall7.init) \ |
| 263 | *(.initcall7s.init) |
Andrew Morton | 61ce1ef | 2006-10-27 11:41:44 -0700 | [diff] [blame] | 264 | |
Fenghua Yu | 5fb7dc3 | 2007-07-19 01:48:12 -0700 | [diff] [blame] | 265 | #define PERCPU(align) \ |
| 266 | . = ALIGN(align); \ |
| 267 | __per_cpu_start = .; \ |
| 268 | .data.percpu : AT(ADDR(.data.percpu) - LOAD_OFFSET) { \ |
| 269 | *(.data.percpu) \ |
| 270 | *(.data.percpu.shared_aligned) \ |
| 271 | } \ |
| 272 | __per_cpu_end = .; |