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