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 0add6b28c366..9d974914e914 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h | |||
| @@ -439,12 +439,59 @@ | |||
| 439 | *(.initcall7.init) \ | 439 | *(.initcall7.init) \ |
| 440 | *(.initcall7s.init) | 440 | *(.initcall7s.init) |
| 441 | 441 | ||
| 442 | /** | ||
| 443 | * PERCPU_VADDR - define output section for percpu area | ||
| 444 | * @vaddr: explicit base address (optional) | ||
| 445 | * @phdr: destination PHDR (optional) | ||
| 446 | * | ||
| 447 | * Macro which expands to output section for percpu area. If @vaddr | ||
| 448 | * is not blank, it specifies explicit base address and all percpu | ||
| 449 | * symbols will be offset from the given address. If blank, @vaddr | ||
| 450 | * always equals @laddr + LOAD_OFFSET. | ||
| 451 | * | ||
| 452 | * @phdr defines the output PHDR to use if not blank. Be warned that | ||
| 453 | * output PHDR is sticky. If @phdr is specified, the next output | ||
| 454 | * section in the linker script will go there too. @phdr should have | ||
| 455 | * a leading colon. | ||
| 456 | * | ||
| 457 | * Note that this macros defines __per_cpu_load as an absolute symbol. | ||
| 458 | * If there is no need to put the percpu section at a predetermined | ||
| 459 | * address, use PERCPU(). | ||
| 460 | */ | ||
| 461 | #define PERCPU_VADDR(vaddr, phdr) \ | ||
| 462 | VMLINUX_SYMBOL(__per_cpu_load) = .; \ | ||
| 463 | .data.percpu vaddr : AT(VMLINUX_SYMBOL(__per_cpu_load) \ | ||
| 464 | - LOAD_OFFSET) { \ | ||
| 465 | VMLINUX_SYMBOL(__per_cpu_start) = .; \ | ||
| 466 | *(.data.percpu.first) \ | ||
| 467 | *(.data.percpu.page_aligned) \ | ||
| 468 | *(.data.percpu) \ | ||
| 469 | *(.data.percpu.shared_aligned) \ | ||
| 470 | VMLINUX_SYMBOL(__per_cpu_end) = .; \ | ||
| 471 | } phdr \ | ||
| 472 | . = VMLINUX_SYMBOL(__per_cpu_load) + SIZEOF(.data.percpu); | ||
| 473 | |||
| 474 | /** | ||
| 475 | * PERCPU - define output section for percpu area, simple version | ||
| 476 | * @align: required alignment | ||
| 477 | * | ||
| 478 | * Align to @align and outputs output section for percpu area. This | ||
| 479 | * macro doesn't maniuplate @vaddr or @phdr and __per_cpu_load and | ||
| 480 | * __per_cpu_start will be identical. | ||
| 481 | * | ||
| 482 | * This macro is equivalent to ALIGN(align); PERCPU_VADDR( , ) except | ||
| 483 | * that __per_cpu_load is defined as a relative symbol against | ||
| 484 | * .data.percpu which is required for relocatable x86_32 | ||
| 485 | * configuration. | ||
| 486 | */ | ||
| 442 | #define PERCPU(align) \ | 487 | #define PERCPU(align) \ |
| 443 | . = ALIGN(align); \ | 488 | . = ALIGN(align); \ |
| 444 | VMLINUX_SYMBOL(__per_cpu_start) = .; \ | 489 | .data.percpu : AT(ADDR(.data.percpu) - LOAD_OFFSET) { \ |
| 445 | .data.percpu : AT(ADDR(.data.percpu) - LOAD_OFFSET) { \ | 490 | VMLINUX_SYMBOL(__per_cpu_load) = .; \ |
| 491 | VMLINUX_SYMBOL(__per_cpu_start) = .; \ | ||
| 492 | *(.data.percpu.first) \ | ||
| 446 | *(.data.percpu.page_aligned) \ | 493 | *(.data.percpu.page_aligned) \ |
| 447 | *(.data.percpu) \ | 494 | *(.data.percpu) \ |
| 448 | *(.data.percpu.shared_aligned) \ | 495 | *(.data.percpu.shared_aligned) \ |
| 449 | } \ | 496 | VMLINUX_SYMBOL(__per_cpu_end) = .; \ |
| 450 | VMLINUX_SYMBOL(__per_cpu_end) = .; | 497 | } |
