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.h29
1 files changed, 20 insertions, 9 deletions
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index f3180a85c66a..5406e70aba86 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -445,24 +445,22 @@
445 * section in the linker script will go there too. @phdr should have 445 * section in the linker script will go there too. @phdr should have
446 * a leading colon. 446 * a leading colon.
447 * 447 *
448 * This macro defines three symbols, __per_cpu_load, __per_cpu_start 448 * Note that this macros defines __per_cpu_load as an absolute symbol.
449 * and __per_cpu_end. The first one is the vaddr of loaded percpu 449 * If there is no need to put the percpu section at a predetermined
450 * init data. __per_cpu_start equals @vaddr and __per_cpu_end is the 450 * address, use PERCPU().
451 * end offset.
452 */ 451 */
453#define PERCPU_VADDR(vaddr, phdr) \ 452#define PERCPU_VADDR(vaddr, phdr) \
454 VMLINUX_SYMBOL(__per_cpu_load_abs) = .; \ 453 VMLINUX_SYMBOL(__per_cpu_load) = .; \
455 .data.percpu vaddr : AT(VMLINUX_SYMBOL(__per_cpu_load_abs) \ 454 .data.percpu vaddr : AT(VMLINUX_SYMBOL(__per_cpu_load) \
456 - LOAD_OFFSET) { \ 455 - LOAD_OFFSET) { \
457 VMLINUX_SYMBOL(__per_cpu_start) = .; \ 456 VMLINUX_SYMBOL(__per_cpu_start) = .; \
458 VMLINUX_SYMBOL(__per_cpu_load) = LOADADDR(.data.percpu) + LOAD_OFFSET;\
459 *(.data.percpu.first) \ 457 *(.data.percpu.first) \
460 *(.data.percpu.page_aligned) \ 458 *(.data.percpu.page_aligned) \
461 *(.data.percpu) \ 459 *(.data.percpu) \
462 *(.data.percpu.shared_aligned) \ 460 *(.data.percpu.shared_aligned) \
463 VMLINUX_SYMBOL(__per_cpu_end) = .; \ 461 VMLINUX_SYMBOL(__per_cpu_end) = .; \
464 } phdr \ 462 } phdr \
465 . = VMLINUX_SYMBOL(__per_cpu_load_abs) + SIZEOF(.data.percpu); 463 . = VMLINUX_SYMBOL(__per_cpu_load) + SIZEOF(.data.percpu);
466 464
467/** 465/**
468 * PERCPU - define output section for percpu area, simple version 466 * PERCPU - define output section for percpu area, simple version
@@ -471,7 +469,20 @@
471 * Align to @align and outputs output section for percpu area. This 469 * Align to @align and outputs output section for percpu area. This
472 * macro doesn't maniuplate @vaddr or @phdr and __per_cpu_load and 470 * macro doesn't maniuplate @vaddr or @phdr and __per_cpu_load and
473 * __per_cpu_start will be identical. 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.
474 */ 477 */
475#define PERCPU(align) \ 478#define PERCPU(align) \
476 . = ALIGN(align); \ 479 . = ALIGN(align); \
477 PERCPU_VADDR( , ) 480 .data.percpu : AT(ADDR(.data.percpu) - LOAD_OFFSET) { \
481 VMLINUX_SYMBOL(__per_cpu_load) = .; \
482 VMLINUX_SYMBOL(__per_cpu_start) = .; \
483 *(.data.percpu.first) \
484 *(.data.percpu.page_aligned) \
485 *(.data.percpu) \
486 *(.data.percpu.shared_aligned) \
487 VMLINUX_SYMBOL(__per_cpu_end) = .; \
488 }