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 | eb8f689 | 2008-01-20 20:07:28 +0100 | [diff] [blame] | 12 | /* The actual configuration determine if the init/exit sections |
| 13 | * are handled as text/data or they can be discarded (which |
| 14 | * often happens at runtime) |
| 15 | */ |
| 16 | #ifdef CONFIG_HOTPLUG |
| 17 | #define DEV_KEEP(sec) *(.dev##sec) |
| 18 | #define DEV_DISCARD(sec) |
| 19 | #else |
| 20 | #define DEV_KEEP(sec) |
| 21 | #define DEV_DISCARD(sec) *(.dev##sec) |
| 22 | #endif |
| 23 | |
| 24 | #ifdef CONFIG_HOTPLUG_CPU |
| 25 | #define CPU_KEEP(sec) *(.cpu##sec) |
| 26 | #define CPU_DISCARD(sec) |
| 27 | #else |
| 28 | #define CPU_KEEP(sec) |
| 29 | #define CPU_DISCARD(sec) *(.cpu##sec) |
| 30 | #endif |
| 31 | |
Adrian Bunk | 1a3fb6d | 2008-01-24 22:20:18 +0100 | [diff] [blame] | 32 | #if defined(CONFIG_MEMORY_HOTPLUG) |
Sam Ravnborg | eb8f689 | 2008-01-20 20:07:28 +0100 | [diff] [blame] | 33 | #define MEM_KEEP(sec) *(.mem##sec) |
| 34 | #define MEM_DISCARD(sec) |
| 35 | #else |
| 36 | #define MEM_KEEP(sec) |
| 37 | #define MEM_DISCARD(sec) *(.mem##sec) |
| 38 | #endif |
| 39 | |
Steven Rostedt | 8da3821 | 2008-08-14 15:45:07 -0400 | [diff] [blame] | 40 | #ifdef CONFIG_FTRACE_MCOUNT_RECORD |
| 41 | #define MCOUNT_REC() VMLINUX_SYMBOL(__start_mcount_loc) = .; \ |
| 42 | *(__mcount_loc) \ |
| 43 | VMLINUX_SYMBOL(__stop_mcount_loc) = .; |
| 44 | #else |
| 45 | #define MCOUNT_REC() |
| 46 | #endif |
Sam Ravnborg | eb8f689 | 2008-01-20 20:07:28 +0100 | [diff] [blame] | 47 | |
Steven Rostedt | 2ed84ee | 2008-11-12 15:24:24 -0500 | [diff] [blame] | 48 | #ifdef CONFIG_TRACE_BRANCH_PROFILING |
Steven Rostedt | 45b7974 | 2008-11-21 00:40:40 -0500 | [diff] [blame^] | 49 | #define LIKELY_PROFILE() VMLINUX_SYMBOL(__start_annotated_branch_profile) = .; \ |
| 50 | *(_ftrace_annotated_branch) \ |
| 51 | VMLINUX_SYMBOL(__stop_annotated_branch_profile) = .; |
Steven Rostedt | 1f0d69a | 2008-11-12 00:14:39 -0500 | [diff] [blame] | 52 | #else |
| 53 | #define LIKELY_PROFILE() |
| 54 | #endif |
| 55 | |
Sam Ravnborg | ca96725 | 2007-05-17 13:38:44 +0200 | [diff] [blame] | 56 | /* .data section */ |
| 57 | #define DATA_DATA \ |
Sam Ravnborg | 0e0d314 | 2007-05-17 20:14:48 +0200 | [diff] [blame] | 58 | *(.data) \ |
Mathieu Desnoyers | 8256e47 | 2007-10-18 23:41:06 -0700 | [diff] [blame] | 59 | *(.data.init.refok) \ |
Sam Ravnborg | 312b148 | 2008-01-28 20:21:15 +0100 | [diff] [blame] | 60 | *(.ref.data) \ |
Sam Ravnborg | eb8f689 | 2008-01-20 20:07:28 +0100 | [diff] [blame] | 61 | DEV_KEEP(init.data) \ |
| 62 | DEV_KEEP(exit.data) \ |
| 63 | CPU_KEEP(init.data) \ |
| 64 | CPU_KEEP(exit.data) \ |
| 65 | MEM_KEEP(init.data) \ |
| 66 | MEM_KEEP(exit.data) \ |
Mathieu Desnoyers | 8256e47 | 2007-10-18 23:41:06 -0700 | [diff] [blame] | 67 | . = ALIGN(8); \ |
| 68 | VMLINUX_SYMBOL(__start___markers) = .; \ |
| 69 | *(__markers) \ |
Mathieu Desnoyers | 97e1c18 | 2008-07-18 12:16:16 -0400 | [diff] [blame] | 70 | VMLINUX_SYMBOL(__stop___markers) = .; \ |
Mathieu Desnoyers | 7e066fb | 2008-11-14 17:47:47 -0500 | [diff] [blame] | 71 | . = ALIGN(32); \ |
Mathieu Desnoyers | 97e1c18 | 2008-07-18 12:16:16 -0400 | [diff] [blame] | 72 | VMLINUX_SYMBOL(__start___tracepoints) = .; \ |
| 73 | *(__tracepoints) \ |
Steven Rostedt | 1f0d69a | 2008-11-12 00:14:39 -0500 | [diff] [blame] | 74 | VMLINUX_SYMBOL(__stop___tracepoints) = .; \ |
| 75 | LIKELY_PROFILE() |
Sam Ravnborg | ca96725 | 2007-05-17 13:38:44 +0200 | [diff] [blame] | 76 | |
Sam Ravnborg | 4096b46 | 2007-05-29 21:29:00 +0200 | [diff] [blame] | 77 | #define RO_DATA(align) \ |
| 78 | . = ALIGN((align)); \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 79 | .rodata : AT(ADDR(.rodata) - LOAD_OFFSET) { \ |
Vivek Goyal | 6569580 | 2006-12-07 02:14:03 +0100 | [diff] [blame] | 80 | VMLINUX_SYMBOL(__start_rodata) = .; \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 81 | *(.rodata) *(.rodata.*) \ |
| 82 | *(__vermagic) /* Kernel version magic */ \ |
Mathieu Desnoyers | 8256e47 | 2007-10-18 23:41:06 -0700 | [diff] [blame] | 83 | *(__markers_strings) /* Markers: strings */ \ |
Mathieu Desnoyers | 97e1c18 | 2008-07-18 12:16:16 -0400 | [diff] [blame] | 84 | *(__tracepoints_strings)/* Tracepoints: strings */ \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 85 | } \ |
| 86 | \ |
| 87 | .rodata1 : AT(ADDR(.rodata1) - LOAD_OFFSET) { \ |
| 88 | *(.rodata1) \ |
| 89 | } \ |
| 90 | \ |
Jan Beulich | 6360b1f | 2008-05-12 15:44:41 +0200 | [diff] [blame] | 91 | BUG_TABLE \ |
| 92 | \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 93 | /* PCI quirks */ \ |
| 94 | .pci_fixup : AT(ADDR(.pci_fixup) - LOAD_OFFSET) { \ |
| 95 | VMLINUX_SYMBOL(__start_pci_fixups_early) = .; \ |
| 96 | *(.pci_fixup_early) \ |
| 97 | VMLINUX_SYMBOL(__end_pci_fixups_early) = .; \ |
| 98 | VMLINUX_SYMBOL(__start_pci_fixups_header) = .; \ |
| 99 | *(.pci_fixup_header) \ |
| 100 | VMLINUX_SYMBOL(__end_pci_fixups_header) = .; \ |
| 101 | VMLINUX_SYMBOL(__start_pci_fixups_final) = .; \ |
| 102 | *(.pci_fixup_final) \ |
| 103 | VMLINUX_SYMBOL(__end_pci_fixups_final) = .; \ |
| 104 | VMLINUX_SYMBOL(__start_pci_fixups_enable) = .; \ |
| 105 | *(.pci_fixup_enable) \ |
| 106 | VMLINUX_SYMBOL(__end_pci_fixups_enable) = .; \ |
Alan Cox | 1597cac | 2006-12-04 15:14:45 -0800 | [diff] [blame] | 107 | VMLINUX_SYMBOL(__start_pci_fixups_resume) = .; \ |
| 108 | *(.pci_fixup_resume) \ |
| 109 | VMLINUX_SYMBOL(__end_pci_fixups_resume) = .; \ |
Rafael J. Wysocki | e1a2a51 | 2008-05-15 21:51:31 +0200 | [diff] [blame] | 110 | VMLINUX_SYMBOL(__start_pci_fixups_resume_early) = .; \ |
| 111 | *(.pci_fixup_resume_early) \ |
| 112 | VMLINUX_SYMBOL(__end_pci_fixups_resume_early) = .; \ |
| 113 | VMLINUX_SYMBOL(__start_pci_fixups_suspend) = .; \ |
| 114 | *(.pci_fixup_suspend) \ |
| 115 | VMLINUX_SYMBOL(__end_pci_fixups_suspend) = .; \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 116 | } \ |
| 117 | \ |
David Woodhouse | 5658c76 | 2008-05-23 13:52:42 +0100 | [diff] [blame] | 118 | /* Built-in firmware blobs */ \ |
| 119 | .builtin_fw : AT(ADDR(.builtin_fw) - LOAD_OFFSET) { \ |
| 120 | VMLINUX_SYMBOL(__start_builtin_fw) = .; \ |
| 121 | *(.builtin_fw) \ |
| 122 | VMLINUX_SYMBOL(__end_builtin_fw) = .; \ |
| 123 | } \ |
| 124 | \ |
Matt Porter | 394b701 | 2005-11-07 01:00:15 -0800 | [diff] [blame] | 125 | /* RapidIO route ops */ \ |
| 126 | .rio_route : AT(ADDR(.rio_route) - LOAD_OFFSET) { \ |
| 127 | VMLINUX_SYMBOL(__start_rio_route_ops) = .; \ |
| 128 | *(.rio_route_ops) \ |
| 129 | VMLINUX_SYMBOL(__end_rio_route_ops) = .; \ |
| 130 | } \ |
| 131 | \ |
Jan Beulich | 63687a5 | 2008-05-12 15:44:41 +0200 | [diff] [blame] | 132 | TRACEDATA \ |
| 133 | \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 134 | /* Kernel symbol table: Normal symbols */ \ |
| 135 | __ksymtab : AT(ADDR(__ksymtab) - LOAD_OFFSET) { \ |
| 136 | VMLINUX_SYMBOL(__start___ksymtab) = .; \ |
| 137 | *(__ksymtab) \ |
| 138 | VMLINUX_SYMBOL(__stop___ksymtab) = .; \ |
| 139 | } \ |
| 140 | \ |
| 141 | /* Kernel symbol table: GPL-only symbols */ \ |
| 142 | __ksymtab_gpl : AT(ADDR(__ksymtab_gpl) - LOAD_OFFSET) { \ |
| 143 | VMLINUX_SYMBOL(__start___ksymtab_gpl) = .; \ |
| 144 | *(__ksymtab_gpl) \ |
| 145 | VMLINUX_SYMBOL(__stop___ksymtab_gpl) = .; \ |
| 146 | } \ |
| 147 | \ |
Arjan van de Ven | f71d20e | 2006-06-28 04:26:45 -0700 | [diff] [blame] | 148 | /* Kernel symbol table: Normal unused symbols */ \ |
| 149 | __ksymtab_unused : AT(ADDR(__ksymtab_unused) - LOAD_OFFSET) { \ |
| 150 | VMLINUX_SYMBOL(__start___ksymtab_unused) = .; \ |
| 151 | *(__ksymtab_unused) \ |
| 152 | VMLINUX_SYMBOL(__stop___ksymtab_unused) = .; \ |
| 153 | } \ |
| 154 | \ |
| 155 | /* Kernel symbol table: GPL-only unused symbols */ \ |
| 156 | __ksymtab_unused_gpl : AT(ADDR(__ksymtab_unused_gpl) - LOAD_OFFSET) { \ |
| 157 | VMLINUX_SYMBOL(__start___ksymtab_unused_gpl) = .; \ |
| 158 | *(__ksymtab_unused_gpl) \ |
| 159 | VMLINUX_SYMBOL(__stop___ksymtab_unused_gpl) = .; \ |
| 160 | } \ |
| 161 | \ |
Greg Kroah-Hartman | 9f28bb7 | 2006-03-20 13:17:13 -0800 | [diff] [blame] | 162 | /* Kernel symbol table: GPL-future-only symbols */ \ |
| 163 | __ksymtab_gpl_future : AT(ADDR(__ksymtab_gpl_future) - LOAD_OFFSET) { \ |
| 164 | VMLINUX_SYMBOL(__start___ksymtab_gpl_future) = .; \ |
| 165 | *(__ksymtab_gpl_future) \ |
| 166 | VMLINUX_SYMBOL(__stop___ksymtab_gpl_future) = .; \ |
| 167 | } \ |
| 168 | \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 169 | /* Kernel symbol table: Normal symbols */ \ |
| 170 | __kcrctab : AT(ADDR(__kcrctab) - LOAD_OFFSET) { \ |
| 171 | VMLINUX_SYMBOL(__start___kcrctab) = .; \ |
| 172 | *(__kcrctab) \ |
| 173 | VMLINUX_SYMBOL(__stop___kcrctab) = .; \ |
| 174 | } \ |
| 175 | \ |
| 176 | /* Kernel symbol table: GPL-only symbols */ \ |
| 177 | __kcrctab_gpl : AT(ADDR(__kcrctab_gpl) - LOAD_OFFSET) { \ |
| 178 | VMLINUX_SYMBOL(__start___kcrctab_gpl) = .; \ |
| 179 | *(__kcrctab_gpl) \ |
| 180 | VMLINUX_SYMBOL(__stop___kcrctab_gpl) = .; \ |
| 181 | } \ |
| 182 | \ |
Arjan van de Ven | f71d20e | 2006-06-28 04:26:45 -0700 | [diff] [blame] | 183 | /* Kernel symbol table: Normal unused symbols */ \ |
| 184 | __kcrctab_unused : AT(ADDR(__kcrctab_unused) - LOAD_OFFSET) { \ |
| 185 | VMLINUX_SYMBOL(__start___kcrctab_unused) = .; \ |
| 186 | *(__kcrctab_unused) \ |
| 187 | VMLINUX_SYMBOL(__stop___kcrctab_unused) = .; \ |
| 188 | } \ |
| 189 | \ |
| 190 | /* Kernel symbol table: GPL-only unused symbols */ \ |
| 191 | __kcrctab_unused_gpl : AT(ADDR(__kcrctab_unused_gpl) - LOAD_OFFSET) { \ |
| 192 | VMLINUX_SYMBOL(__start___kcrctab_unused_gpl) = .; \ |
| 193 | *(__kcrctab_unused_gpl) \ |
| 194 | VMLINUX_SYMBOL(__stop___kcrctab_unused_gpl) = .; \ |
| 195 | } \ |
| 196 | \ |
Greg Kroah-Hartman | 9f28bb7 | 2006-03-20 13:17:13 -0800 | [diff] [blame] | 197 | /* Kernel symbol table: GPL-future-only symbols */ \ |
| 198 | __kcrctab_gpl_future : AT(ADDR(__kcrctab_gpl_future) - LOAD_OFFSET) { \ |
| 199 | VMLINUX_SYMBOL(__start___kcrctab_gpl_future) = .; \ |
| 200 | *(__kcrctab_gpl_future) \ |
| 201 | VMLINUX_SYMBOL(__stop___kcrctab_gpl_future) = .; \ |
| 202 | } \ |
| 203 | \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 204 | /* Kernel symbol table: strings */ \ |
| 205 | __ksymtab_strings : AT(ADDR(__ksymtab_strings) - LOAD_OFFSET) { \ |
| 206 | *(__ksymtab_strings) \ |
| 207 | } \ |
| 208 | \ |
Sam Ravnborg | eb8f689 | 2008-01-20 20:07:28 +0100 | [diff] [blame] | 209 | /* __*init sections */ \ |
| 210 | __init_rodata : AT(ADDR(__init_rodata) - LOAD_OFFSET) { \ |
Sam Ravnborg | 312b148 | 2008-01-28 20:21:15 +0100 | [diff] [blame] | 211 | *(.ref.rodata) \ |
Steven Rostedt | 8da3821 | 2008-08-14 15:45:07 -0400 | [diff] [blame] | 212 | MCOUNT_REC() \ |
Sam Ravnborg | eb8f689 | 2008-01-20 20:07:28 +0100 | [diff] [blame] | 213 | DEV_KEEP(init.rodata) \ |
| 214 | DEV_KEEP(exit.rodata) \ |
| 215 | CPU_KEEP(init.rodata) \ |
| 216 | CPU_KEEP(exit.rodata) \ |
| 217 | MEM_KEEP(init.rodata) \ |
| 218 | MEM_KEEP(exit.rodata) \ |
| 219 | } \ |
| 220 | \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 221 | /* Built-in module parameters. */ \ |
| 222 | __param : AT(ADDR(__param) - LOAD_OFFSET) { \ |
| 223 | VMLINUX_SYMBOL(__start___param) = .; \ |
| 224 | *(__param) \ |
| 225 | VMLINUX_SYMBOL(__stop___param) = .; \ |
Arjan van de Ven | edeed30 | 2008-01-30 13:34:08 +0100 | [diff] [blame] | 226 | . = ALIGN((align)); \ |
Vivek Goyal | 6569580 | 2006-12-07 02:14:03 +0100 | [diff] [blame] | 227 | VMLINUX_SYMBOL(__end_rodata) = .; \ |
Marcelo Tosatti | 7583ddf | 2006-09-27 01:51:02 -0700 | [diff] [blame] | 228 | } \ |
Sam Ravnborg | 4096b46 | 2007-05-29 21:29:00 +0200 | [diff] [blame] | 229 | . = ALIGN((align)); |
| 230 | |
| 231 | /* RODATA provided for backward compatibility. |
| 232 | * All archs are supposed to use RO_DATA() */ |
| 233 | #define RODATA RO_DATA(4096) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 234 | |
| 235 | #define SECURITY_INIT \ |
Eric W. Biederman | 60bad7f | 2005-06-25 14:57:46 -0700 | [diff] [blame] | 236 | .security_initcall.init : AT(ADDR(.security_initcall.init) - LOAD_OFFSET) { \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 237 | VMLINUX_SYMBOL(__security_initcall_start) = .; \ |
| 238 | *(.security_initcall.init) \ |
| 239 | VMLINUX_SYMBOL(__security_initcall_end) = .; \ |
| 240 | } |
| 241 | |
Sam Ravnborg | 7664709 | 2007-05-13 00:31:33 +0200 | [diff] [blame] | 242 | /* .text section. Map to function alignment to avoid address changes |
| 243 | * during second ld run in second ld pass when generating System.map */ |
| 244 | #define TEXT_TEXT \ |
| 245 | ALIGN_FUNCTION(); \ |
Jan Beulich | fb5e2b3 | 2008-06-18 12:36:01 +0100 | [diff] [blame] | 246 | *(.text.hot) \ |
Sam Ravnborg | 0e0d314 | 2007-05-17 20:14:48 +0200 | [diff] [blame] | 247 | *(.text) \ |
Sam Ravnborg | 312b148 | 2008-01-28 20:21:15 +0100 | [diff] [blame] | 248 | *(.ref.text) \ |
Al Viro | 23ec23c | 2007-10-13 08:40:24 +0100 | [diff] [blame] | 249 | *(.text.init.refok) \ |
Sam Ravnborg | eb8f689 | 2008-01-20 20:07:28 +0100 | [diff] [blame] | 250 | *(.exit.text.refok) \ |
| 251 | DEV_KEEP(init.text) \ |
| 252 | DEV_KEEP(exit.text) \ |
| 253 | CPU_KEEP(init.text) \ |
| 254 | CPU_KEEP(exit.text) \ |
| 255 | MEM_KEEP(init.text) \ |
Jan Beulich | fb5e2b3 | 2008-06-18 12:36:01 +0100 | [diff] [blame] | 256 | MEM_KEEP(exit.text) \ |
| 257 | *(.text.unlikely) |
Sam Ravnborg | eb8f689 | 2008-01-20 20:07:28 +0100 | [diff] [blame] | 258 | |
Sam Ravnborg | 7664709 | 2007-05-13 00:31:33 +0200 | [diff] [blame] | 259 | |
Sam Ravnborg | 6d30e3a | 2005-07-14 20:15:44 +0000 | [diff] [blame] | 260 | /* sched.text is aling to function alignment to secure we have same |
| 261 | * address even at second ld pass when generating System.map */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 262 | #define SCHED_TEXT \ |
Sam Ravnborg | 6d30e3a | 2005-07-14 20:15:44 +0000 | [diff] [blame] | 263 | ALIGN_FUNCTION(); \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 264 | VMLINUX_SYMBOL(__sched_text_start) = .; \ |
| 265 | *(.sched.text) \ |
| 266 | VMLINUX_SYMBOL(__sched_text_end) = .; |
| 267 | |
Sam Ravnborg | 6d30e3a | 2005-07-14 20:15:44 +0000 | [diff] [blame] | 268 | /* spinlock.text is aling to function alignment to secure we have same |
| 269 | * address even at second ld pass when generating System.map */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 270 | #define LOCK_TEXT \ |
Sam Ravnborg | 6d30e3a | 2005-07-14 20:15:44 +0000 | [diff] [blame] | 271 | ALIGN_FUNCTION(); \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 272 | VMLINUX_SYMBOL(__lock_text_start) = .; \ |
| 273 | *(.spinlock.text) \ |
| 274 | VMLINUX_SYMBOL(__lock_text_end) = .; |
Prasanna S Panchamukhi | d0aaff9 | 2005-09-06 15:19:26 -0700 | [diff] [blame] | 275 | |
| 276 | #define KPROBES_TEXT \ |
| 277 | ALIGN_FUNCTION(); \ |
| 278 | VMLINUX_SYMBOL(__kprobes_text_start) = .; \ |
| 279 | *(.kprobes.text) \ |
| 280 | VMLINUX_SYMBOL(__kprobes_text_end) = .; |
Paolo 'Blaisorblade' Giarrusso | a7d0c21 | 2005-09-10 19:44:54 +0200 | [diff] [blame] | 281 | |
Sam Ravnborg | 37c514e | 2008-02-19 21:00:18 +0100 | [diff] [blame] | 282 | /* Section used for early init (in .S files) */ |
| 283 | #define HEAD_TEXT *(.head.text) |
| 284 | |
Sam Ravnborg | 01ba2bd | 2008-01-20 14:15:03 +0100 | [diff] [blame] | 285 | /* init and exit section handling */ |
Sam Ravnborg | eb8f689 | 2008-01-20 20:07:28 +0100 | [diff] [blame] | 286 | #define INIT_DATA \ |
| 287 | *(.init.data) \ |
| 288 | DEV_DISCARD(init.data) \ |
| 289 | DEV_DISCARD(init.rodata) \ |
| 290 | CPU_DISCARD(init.data) \ |
| 291 | CPU_DISCARD(init.rodata) \ |
| 292 | MEM_DISCARD(init.data) \ |
Jason Baron | 346e15b | 2008-08-12 16:46:19 -0400 | [diff] [blame] | 293 | MEM_DISCARD(init.rodata) \ |
| 294 | /* implement dynamic printk debug */ \ |
| 295 | VMLINUX_SYMBOL(__start___verbose_strings) = .; \ |
| 296 | *(__verbose_strings) \ |
| 297 | VMLINUX_SYMBOL(__stop___verbose_strings) = .; \ |
| 298 | . = ALIGN(8); \ |
| 299 | VMLINUX_SYMBOL(__start___verbose) = .; \ |
| 300 | *(__verbose) \ |
| 301 | VMLINUX_SYMBOL(__stop___verbose) = .; |
Sam Ravnborg | 01ba2bd | 2008-01-20 14:15:03 +0100 | [diff] [blame] | 302 | |
Sam Ravnborg | eb8f689 | 2008-01-20 20:07:28 +0100 | [diff] [blame] | 303 | #define INIT_TEXT \ |
| 304 | *(.init.text) \ |
| 305 | DEV_DISCARD(init.text) \ |
| 306 | CPU_DISCARD(init.text) \ |
| 307 | MEM_DISCARD(init.text) |
| 308 | |
| 309 | #define EXIT_DATA \ |
| 310 | *(.exit.data) \ |
| 311 | DEV_DISCARD(exit.data) \ |
| 312 | DEV_DISCARD(exit.rodata) \ |
| 313 | CPU_DISCARD(exit.data) \ |
| 314 | CPU_DISCARD(exit.rodata) \ |
| 315 | MEM_DISCARD(exit.data) \ |
| 316 | MEM_DISCARD(exit.rodata) |
| 317 | |
| 318 | #define EXIT_TEXT \ |
| 319 | *(.exit.text) \ |
| 320 | DEV_DISCARD(exit.text) \ |
| 321 | CPU_DISCARD(exit.text) \ |
| 322 | MEM_DISCARD(exit.text) |
Sam Ravnborg | 01ba2bd | 2008-01-20 14:15:03 +0100 | [diff] [blame] | 323 | |
Paolo 'Blaisorblade' Giarrusso | a7d0c21 | 2005-09-10 19:44:54 +0200 | [diff] [blame] | 324 | /* DWARF debug sections. |
| 325 | Symbols in the DWARF debugging sections are relative to |
| 326 | the beginning of the section so we begin them at 0. */ |
| 327 | #define DWARF_DEBUG \ |
| 328 | /* DWARF 1 */ \ |
| 329 | .debug 0 : { *(.debug) } \ |
| 330 | .line 0 : { *(.line) } \ |
| 331 | /* GNU DWARF 1 extensions */ \ |
| 332 | .debug_srcinfo 0 : { *(.debug_srcinfo) } \ |
| 333 | .debug_sfnames 0 : { *(.debug_sfnames) } \ |
| 334 | /* DWARF 1.1 and DWARF 2 */ \ |
| 335 | .debug_aranges 0 : { *(.debug_aranges) } \ |
| 336 | .debug_pubnames 0 : { *(.debug_pubnames) } \ |
| 337 | /* DWARF 2 */ \ |
| 338 | .debug_info 0 : { *(.debug_info \ |
| 339 | .gnu.linkonce.wi.*) } \ |
| 340 | .debug_abbrev 0 : { *(.debug_abbrev) } \ |
| 341 | .debug_line 0 : { *(.debug_line) } \ |
| 342 | .debug_frame 0 : { *(.debug_frame) } \ |
| 343 | .debug_str 0 : { *(.debug_str) } \ |
| 344 | .debug_loc 0 : { *(.debug_loc) } \ |
| 345 | .debug_macinfo 0 : { *(.debug_macinfo) } \ |
| 346 | /* SGI/MIPS DWARF 2 extensions */ \ |
| 347 | .debug_weaknames 0 : { *(.debug_weaknames) } \ |
| 348 | .debug_funcnames 0 : { *(.debug_funcnames) } \ |
| 349 | .debug_typenames 0 : { *(.debug_typenames) } \ |
| 350 | .debug_varnames 0 : { *(.debug_varnames) } \ |
| 351 | |
| 352 | /* Stabs debugging sections. */ |
| 353 | #define STABS_DEBUG \ |
| 354 | .stab 0 : { *(.stab) } \ |
| 355 | .stabstr 0 : { *(.stabstr) } \ |
| 356 | .stab.excl 0 : { *(.stab.excl) } \ |
| 357 | .stab.exclstr 0 : { *(.stab.exclstr) } \ |
| 358 | .stab.index 0 : { *(.stab.index) } \ |
| 359 | .stab.indexstr 0 : { *(.stab.indexstr) } \ |
| 360 | .comment 0 : { *(.comment) } |
Jeremy Fitzhardinge | 9c9b8b3 | 2006-09-25 23:32:26 -0700 | [diff] [blame] | 361 | |
Jan Beulich | 6360b1f | 2008-05-12 15:44:41 +0200 | [diff] [blame] | 362 | #ifdef CONFIG_GENERIC_BUG |
Jeremy Fitzhardinge | 7664c5a | 2006-12-08 02:36:19 -0800 | [diff] [blame] | 363 | #define BUG_TABLE \ |
| 364 | . = ALIGN(8); \ |
| 365 | __bug_table : AT(ADDR(__bug_table) - LOAD_OFFSET) { \ |
Yoshinori Sato | c6de002 | 2008-07-31 00:07:29 -0700 | [diff] [blame] | 366 | VMLINUX_SYMBOL(__start___bug_table) = .; \ |
Jeremy Fitzhardinge | 7664c5a | 2006-12-08 02:36:19 -0800 | [diff] [blame] | 367 | *(__bug_table) \ |
Yoshinori Sato | c6de002 | 2008-07-31 00:07:29 -0700 | [diff] [blame] | 368 | VMLINUX_SYMBOL(__stop___bug_table) = .; \ |
Jeremy Fitzhardinge | 7664c5a | 2006-12-08 02:36:19 -0800 | [diff] [blame] | 369 | } |
Jan Beulich | 6360b1f | 2008-05-12 15:44:41 +0200 | [diff] [blame] | 370 | #else |
| 371 | #define BUG_TABLE |
| 372 | #endif |
Jeremy Fitzhardinge | 7664c5a | 2006-12-08 02:36:19 -0800 | [diff] [blame] | 373 | |
Jan Beulich | 63687a5 | 2008-05-12 15:44:41 +0200 | [diff] [blame] | 374 | #ifdef CONFIG_PM_TRACE |
| 375 | #define TRACEDATA \ |
| 376 | . = ALIGN(4); \ |
| 377 | .tracedata : AT(ADDR(.tracedata) - LOAD_OFFSET) { \ |
Yoshinori Sato | c6de002 | 2008-07-31 00:07:29 -0700 | [diff] [blame] | 378 | VMLINUX_SYMBOL(__tracedata_start) = .; \ |
Jan Beulich | 63687a5 | 2008-05-12 15:44:41 +0200 | [diff] [blame] | 379 | *(.tracedata) \ |
Yoshinori Sato | c6de002 | 2008-07-31 00:07:29 -0700 | [diff] [blame] | 380 | VMLINUX_SYMBOL(__tracedata_end) = .; \ |
Jan Beulich | 63687a5 | 2008-05-12 15:44:41 +0200 | [diff] [blame] | 381 | } |
| 382 | #else |
| 383 | #define TRACEDATA |
| 384 | #endif |
| 385 | |
Jeremy Fitzhardinge | 9c9b8b3 | 2006-09-25 23:32:26 -0700 | [diff] [blame] | 386 | #define NOTES \ |
Roland McGrath | cbe8712 | 2007-07-19 01:48:36 -0700 | [diff] [blame] | 387 | .notes : AT(ADDR(.notes) - LOAD_OFFSET) { \ |
| 388 | VMLINUX_SYMBOL(__start_notes) = .; \ |
| 389 | *(.note.*) \ |
| 390 | VMLINUX_SYMBOL(__stop_notes) = .; \ |
| 391 | } |
Andrew Morton | 61ce1ef | 2006-10-27 11:41:44 -0700 | [diff] [blame] | 392 | |
| 393 | #define INITCALLS \ |
Eduard - Gabriel Munteanu | c2147a5 | 2008-07-25 19:45:11 -0700 | [diff] [blame] | 394 | *(.initcallearly.init) \ |
Yoshinori Sato | c6de002 | 2008-07-31 00:07:29 -0700 | [diff] [blame] | 395 | VMLINUX_SYMBOL(__early_initcall_end) = .; \ |
Linus Torvalds | b3438f8 | 2006-11-20 11:47:18 -0800 | [diff] [blame] | 396 | *(.initcall0.init) \ |
| 397 | *(.initcall0s.init) \ |
Andrew Morton | 61ce1ef | 2006-10-27 11:41:44 -0700 | [diff] [blame] | 398 | *(.initcall1.init) \ |
Andrew Morton | 735a7ff | 2006-10-27 11:42:37 -0700 | [diff] [blame] | 399 | *(.initcall1s.init) \ |
Andrew Morton | 61ce1ef | 2006-10-27 11:41:44 -0700 | [diff] [blame] | 400 | *(.initcall2.init) \ |
Andrew Morton | 735a7ff | 2006-10-27 11:42:37 -0700 | [diff] [blame] | 401 | *(.initcall2s.init) \ |
Andrew Morton | 61ce1ef | 2006-10-27 11:41:44 -0700 | [diff] [blame] | 402 | *(.initcall3.init) \ |
Andrew Morton | 735a7ff | 2006-10-27 11:42:37 -0700 | [diff] [blame] | 403 | *(.initcall3s.init) \ |
Andrew Morton | 61ce1ef | 2006-10-27 11:41:44 -0700 | [diff] [blame] | 404 | *(.initcall4.init) \ |
Andrew Morton | 735a7ff | 2006-10-27 11:42:37 -0700 | [diff] [blame] | 405 | *(.initcall4s.init) \ |
Andrew Morton | 61ce1ef | 2006-10-27 11:41:44 -0700 | [diff] [blame] | 406 | *(.initcall5.init) \ |
Andrew Morton | 735a7ff | 2006-10-27 11:42:37 -0700 | [diff] [blame] | 407 | *(.initcall5s.init) \ |
Linus Torvalds | 8d610dd | 2006-12-11 12:12:04 -0800 | [diff] [blame] | 408 | *(.initcallrootfs.init) \ |
Andrew Morton | 61ce1ef | 2006-10-27 11:41:44 -0700 | [diff] [blame] | 409 | *(.initcall6.init) \ |
Andrew Morton | 735a7ff | 2006-10-27 11:42:37 -0700 | [diff] [blame] | 410 | *(.initcall6s.init) \ |
| 411 | *(.initcall7.init) \ |
| 412 | *(.initcall7s.init) |
Andrew Morton | 61ce1ef | 2006-10-27 11:41:44 -0700 | [diff] [blame] | 413 | |
Fenghua Yu | 5fb7dc3 | 2007-07-19 01:48:12 -0700 | [diff] [blame] | 414 | #define PERCPU(align) \ |
| 415 | . = ALIGN(align); \ |
Yoshinori Sato | c6de002 | 2008-07-31 00:07:29 -0700 | [diff] [blame] | 416 | VMLINUX_SYMBOL(__per_cpu_start) = .; \ |
Fenghua Yu | 5fb7dc3 | 2007-07-19 01:48:12 -0700 | [diff] [blame] | 417 | .data.percpu : AT(ADDR(.data.percpu) - LOAD_OFFSET) { \ |
Eric Dumazet | 63cc8c7 | 2008-05-12 15:44:40 +0200 | [diff] [blame] | 418 | *(.data.percpu.page_aligned) \ |
Fenghua Yu | 5fb7dc3 | 2007-07-19 01:48:12 -0700 | [diff] [blame] | 419 | *(.data.percpu) \ |
| 420 | *(.data.percpu.shared_aligned) \ |
| 421 | } \ |
Yoshinori Sato | c6de002 | 2008-07-31 00:07:29 -0700 | [diff] [blame] | 422 | VMLINUX_SYMBOL(__per_cpu_end) = .; |