aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-generic/vmlinux.lds.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-generic/vmlinux.lds.h')
-rw-r--r--include/asm-generic/vmlinux.lds.h55
1 files changed, 51 insertions, 4 deletions
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index c61fab1dd2f8..5406e70aba86 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -430,12 +430,59 @@
430 *(.initcall7.init) \ 430 *(.initcall7.init) \
431 *(.initcall7s.init) 431 *(.initcall7s.init)
432 432
433/**
434 * PERCPU_VADDR - define output section for percpu area
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 * Note that this macros defines __per_cpu_load as an absolute symbol.
449 * If there is no need to put the percpu section at a predetermined
450 * address, use PERCPU().
451 */
452#define PERCPU_VADDR(vaddr, phdr) \
453 VMLINUX_SYMBOL(__per_cpu_load) = .; \
454 .data.percpu vaddr : AT(VMLINUX_SYMBOL(__per_cpu_load) \
455 - LOAD_OFFSET) { \
456 VMLINUX_SYMBOL(__per_cpu_start) = .; \
457 *(.data.percpu.first) \
458 *(.data.percpu.page_aligned) \
459 *(.data.percpu) \
460 *(.data.percpu.shared_aligned) \
461 VMLINUX_SYMBOL(__per_cpu_end) = .; \
462 } phdr \
463 . = VMLINUX_SYMBOL(__per_cpu_load) + SIZEOF(.data.percpu);
464
465/**
466 * PERCPU - define output section for percpu area, simple version
467 * @align: required alignment
468 *
469 * Align to @align and outputs output section for percpu area. This
470 * macro doesn't maniuplate @vaddr or @phdr and __per_cpu_load and
471 * __per_cpu_start will be identical.
472 *
473 * This macro is equivalent to ALIGN(align); PERCPU_VADDR( , ) except
474 * that __per_cpu_load is defined as a relative symbol against
475 * .data.percpu which is required for relocatable x86_32
476 * configuration.
477 */
433#define PERCPU(align) \ 478#define PERCPU(align) \
434 . = ALIGN(align); \ 479 . = ALIGN(align); \
435 VMLINUX_SYMBOL(__per_cpu_start) = .; \ 480 .data.percpu : AT(ADDR(.data.percpu) - LOAD_OFFSET) { \
436 .data.percpu : AT(ADDR(.data.percpu) - LOAD_OFFSET) { \ 481 VMLINUX_SYMBOL(__per_cpu_load) = .; \
482 VMLINUX_SYMBOL(__per_cpu_start) = .; \
483 *(.data.percpu.first) \
437 *(.data.percpu.page_aligned) \ 484 *(.data.percpu.page_aligned) \
438 *(.data.percpu) \ 485 *(.data.percpu) \
439 *(.data.percpu.shared_aligned) \ 486 *(.data.percpu.shared_aligned) \
440 } \ 487 VMLINUX_SYMBOL(__per_cpu_end) = .; \
441 VMLINUX_SYMBOL(__per_cpu_end) = .; 488 }