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