diff options
Diffstat (limited to 'include/asm-generic/vmlinux.lds.h')
-rw-r--r-- | include/asm-generic/vmlinux.lds.h | 55 |
1 files changed, 51 insertions, 4 deletions
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index aca40b93bd28..a654d724d3b0 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h | |||
@@ -427,12 +427,59 @@ | |||
427 | *(.initcall7.init) \ | 427 | *(.initcall7.init) \ |
428 | *(.initcall7s.init) | 428 | *(.initcall7s.init) |
429 | 429 | ||
430 | /** | ||
431 | * PERCPU_VADDR - define output section for percpu area | ||
432 | * @vaddr: explicit base address (optional) | ||
433 | * @phdr: destination PHDR (optional) | ||
434 | * | ||
435 | * Macro which expands to output section for percpu area. If @vaddr | ||
436 | * is not blank, it specifies explicit base address and all percpu | ||
437 | * symbols will be offset from the given address. If blank, @vaddr | ||
438 | * always equals @laddr + LOAD_OFFSET. | ||
439 | * | ||
440 | * @phdr defines the output PHDR to use if not blank. Be warned that | ||
441 | * output PHDR is sticky. If @phdr is specified, the next output | ||
442 | * section in the linker script will go there too. @phdr should have | ||
443 | * a leading colon. | ||
444 | * | ||
445 | * Note that this macros defines __per_cpu_load as an absolute symbol. | ||
446 | * If there is no need to put the percpu section at a predetermined | ||
447 | * address, use PERCPU(). | ||
448 | */ | ||
449 | #define PERCPU_VADDR(vaddr, phdr) \ | ||
450 | VMLINUX_SYMBOL(__per_cpu_load) = .; \ | ||
451 | .data.percpu vaddr : AT(VMLINUX_SYMBOL(__per_cpu_load) \ | ||
452 | - LOAD_OFFSET) { \ | ||
453 | VMLINUX_SYMBOL(__per_cpu_start) = .; \ | ||
454 | *(.data.percpu.first) \ | ||
455 | *(.data.percpu.page_aligned) \ | ||
456 | *(.data.percpu) \ | ||
457 | *(.data.percpu.shared_aligned) \ | ||
458 | VMLINUX_SYMBOL(__per_cpu_end) = .; \ | ||
459 | } phdr \ | ||
460 | . = VMLINUX_SYMBOL(__per_cpu_load) + SIZEOF(.data.percpu); | ||
461 | |||
462 | /** | ||
463 | * PERCPU - define output section for percpu area, simple version | ||
464 | * @align: required alignment | ||
465 | * | ||
466 | * Align to @align and outputs output section for percpu area. This | ||
467 | * macro doesn't maniuplate @vaddr or @phdr and __per_cpu_load and | ||
468 | * __per_cpu_start will be identical. | ||
469 | * | ||
470 | * This macro is equivalent to ALIGN(align); PERCPU_VADDR( , ) except | ||
471 | * that __per_cpu_load is defined as a relative symbol against | ||
472 | * .data.percpu which is required for relocatable x86_32 | ||
473 | * configuration. | ||
474 | */ | ||
430 | #define PERCPU(align) \ | 475 | #define PERCPU(align) \ |
431 | . = ALIGN(align); \ | 476 | . = ALIGN(align); \ |
432 | VMLINUX_SYMBOL(__per_cpu_start) = .; \ | 477 | .data.percpu : AT(ADDR(.data.percpu) - LOAD_OFFSET) { \ |
433 | .data.percpu : AT(ADDR(.data.percpu) - LOAD_OFFSET) { \ | 478 | VMLINUX_SYMBOL(__per_cpu_load) = .; \ |
479 | VMLINUX_SYMBOL(__per_cpu_start) = .; \ | ||
480 | *(.data.percpu.first) \ | ||
434 | *(.data.percpu.page_aligned) \ | 481 | *(.data.percpu.page_aligned) \ |
435 | *(.data.percpu) \ | 482 | *(.data.percpu) \ |
436 | *(.data.percpu.shared_aligned) \ | 483 | *(.data.percpu.shared_aligned) \ |
437 | } \ | 484 | VMLINUX_SYMBOL(__per_cpu_end) = .; \ |
438 | VMLINUX_SYMBOL(__per_cpu_end) = .; | 485 | } |