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 | |
| 186 | /* DWARF debug sections. |
| 187 | Symbols in the DWARF debugging sections are relative to |
| 188 | the beginning of the section so we begin them at 0. */ |
| 189 | #define DWARF_DEBUG \ |
| 190 | /* DWARF 1 */ \ |
| 191 | .debug 0 : { *(.debug) } \ |
| 192 | .line 0 : { *(.line) } \ |
| 193 | /* GNU DWARF 1 extensions */ \ |
| 194 | .debug_srcinfo 0 : { *(.debug_srcinfo) } \ |
| 195 | .debug_sfnames 0 : { *(.debug_sfnames) } \ |
| 196 | /* DWARF 1.1 and DWARF 2 */ \ |
| 197 | .debug_aranges 0 : { *(.debug_aranges) } \ |
| 198 | .debug_pubnames 0 : { *(.debug_pubnames) } \ |
| 199 | /* DWARF 2 */ \ |
| 200 | .debug_info 0 : { *(.debug_info \ |
| 201 | .gnu.linkonce.wi.*) } \ |
| 202 | .debug_abbrev 0 : { *(.debug_abbrev) } \ |
| 203 | .debug_line 0 : { *(.debug_line) } \ |
| 204 | .debug_frame 0 : { *(.debug_frame) } \ |
| 205 | .debug_str 0 : { *(.debug_str) } \ |
| 206 | .debug_loc 0 : { *(.debug_loc) } \ |
| 207 | .debug_macinfo 0 : { *(.debug_macinfo) } \ |
| 208 | /* SGI/MIPS DWARF 2 extensions */ \ |
| 209 | .debug_weaknames 0 : { *(.debug_weaknames) } \ |
| 210 | .debug_funcnames 0 : { *(.debug_funcnames) } \ |
| 211 | .debug_typenames 0 : { *(.debug_typenames) } \ |
| 212 | .debug_varnames 0 : { *(.debug_varnames) } \ |
| 213 | |
| 214 | /* Stabs debugging sections. */ |
| 215 | #define STABS_DEBUG \ |
| 216 | .stab 0 : { *(.stab) } \ |
| 217 | .stabstr 0 : { *(.stabstr) } \ |
| 218 | .stab.excl 0 : { *(.stab.excl) } \ |
| 219 | .stab.exclstr 0 : { *(.stab.exclstr) } \ |
| 220 | .stab.index 0 : { *(.stab.index) } \ |
| 221 | .stab.indexstr 0 : { *(.stab.indexstr) } \ |
| 222 | .comment 0 : { *(.comment) } |
Jeremy Fitzhardinge | 9c9b8b3 | 2006-09-25 23:32:26 -0700 | [diff] [blame] | 223 | |
Jeremy Fitzhardinge | 7664c5a | 2006-12-08 02:36:19 -0800 | [diff] [blame] | 224 | #define BUG_TABLE \ |
| 225 | . = ALIGN(8); \ |
| 226 | __bug_table : AT(ADDR(__bug_table) - LOAD_OFFSET) { \ |
| 227 | __start___bug_table = .; \ |
| 228 | *(__bug_table) \ |
| 229 | __stop___bug_table = .; \ |
| 230 | } |
| 231 | |
Jeremy Fitzhardinge | 9c9b8b3 | 2006-09-25 23:32:26 -0700 | [diff] [blame] | 232 | #define NOTES \ |
Roland McGrath | cbe8712 | 2007-07-19 01:48:36 -0700 | [diff] [blame] | 233 | .notes : AT(ADDR(.notes) - LOAD_OFFSET) { \ |
| 234 | VMLINUX_SYMBOL(__start_notes) = .; \ |
| 235 | *(.note.*) \ |
| 236 | VMLINUX_SYMBOL(__stop_notes) = .; \ |
| 237 | } |
Andrew Morton | 61ce1ef | 2006-10-27 11:41:44 -0700 | [diff] [blame] | 238 | |
| 239 | #define INITCALLS \ |
Linus Torvalds | b3438f8 | 2006-11-20 11:47:18 -0800 | [diff] [blame] | 240 | *(.initcall0.init) \ |
| 241 | *(.initcall0s.init) \ |
Andrew Morton | 61ce1ef | 2006-10-27 11:41:44 -0700 | [diff] [blame] | 242 | *(.initcall1.init) \ |
Andrew Morton | 735a7ff | 2006-10-27 11:42:37 -0700 | [diff] [blame] | 243 | *(.initcall1s.init) \ |
Andrew Morton | 61ce1ef | 2006-10-27 11:41:44 -0700 | [diff] [blame] | 244 | *(.initcall2.init) \ |
Andrew Morton | 735a7ff | 2006-10-27 11:42:37 -0700 | [diff] [blame] | 245 | *(.initcall2s.init) \ |
Andrew Morton | 61ce1ef | 2006-10-27 11:41:44 -0700 | [diff] [blame] | 246 | *(.initcall3.init) \ |
Andrew Morton | 735a7ff | 2006-10-27 11:42:37 -0700 | [diff] [blame] | 247 | *(.initcall3s.init) \ |
Andrew Morton | 61ce1ef | 2006-10-27 11:41:44 -0700 | [diff] [blame] | 248 | *(.initcall4.init) \ |
Andrew Morton | 735a7ff | 2006-10-27 11:42:37 -0700 | [diff] [blame] | 249 | *(.initcall4s.init) \ |
Andrew Morton | 61ce1ef | 2006-10-27 11:41:44 -0700 | [diff] [blame] | 250 | *(.initcall5.init) \ |
Andrew Morton | 735a7ff | 2006-10-27 11:42:37 -0700 | [diff] [blame] | 251 | *(.initcall5s.init) \ |
Linus Torvalds | 8d610dd | 2006-12-11 12:12:04 -0800 | [diff] [blame] | 252 | *(.initcallrootfs.init) \ |
Andrew Morton | 61ce1ef | 2006-10-27 11:41:44 -0700 | [diff] [blame] | 253 | *(.initcall6.init) \ |
Andrew Morton | 735a7ff | 2006-10-27 11:42:37 -0700 | [diff] [blame] | 254 | *(.initcall6s.init) \ |
| 255 | *(.initcall7.init) \ |
| 256 | *(.initcall7s.init) |
Andrew Morton | 61ce1ef | 2006-10-27 11:41:44 -0700 | [diff] [blame] | 257 | |
Fenghua Yu | 5fb7dc3 | 2007-07-19 01:48:12 -0700 | [diff] [blame] | 258 | #define PERCPU(align) \ |
| 259 | . = ALIGN(align); \ |
| 260 | __per_cpu_start = .; \ |
| 261 | .data.percpu : AT(ADDR(.data.percpu) - LOAD_OFFSET) { \ |
| 262 | *(.data.percpu) \ |
| 263 | *(.data.percpu.shared_aligned) \ |
| 264 | } \ |
| 265 | __per_cpu_end = .; |