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