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.h75
1 files changed, 70 insertions, 5 deletions
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index c61fab1dd2f8..0e0f39be6c8b 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -61,6 +61,22 @@
61#define BRANCH_PROFILE() 61#define BRANCH_PROFILE()
62#endif 62#endif
63 63
64#ifdef CONFIG_EVENT_TRACER
65#define FTRACE_EVENTS() VMLINUX_SYMBOL(__start_ftrace_events) = .; \
66 *(_ftrace_events) \
67 VMLINUX_SYMBOL(__stop_ftrace_events) = .;
68#else
69#define FTRACE_EVENTS()
70#endif
71
72#ifdef CONFIG_TRACING
73#define TRACE_PRINTKS() VMLINUX_SYMBOL(__start___trace_bprintk_fmt) = .; \
74 *(__trace_printk_fmt) /* Trace_printk fmt' pointer */ \
75 VMLINUX_SYMBOL(__stop___trace_bprintk_fmt) = .;
76#else
77#define TRACE_PRINTKS()
78#endif
79
64/* .data section */ 80/* .data section */
65#define DATA_DATA \ 81#define DATA_DATA \
66 *(.data) \ 82 *(.data) \
@@ -81,7 +97,9 @@
81 *(__tracepoints) \ 97 *(__tracepoints) \
82 VMLINUX_SYMBOL(__stop___tracepoints) = .; \ 98 VMLINUX_SYMBOL(__stop___tracepoints) = .; \
83 LIKELY_PROFILE() \ 99 LIKELY_PROFILE() \
84 BRANCH_PROFILE() 100 BRANCH_PROFILE() \
101 TRACE_PRINTKS() \
102 FTRACE_EVENTS()
85 103
86#define RO_DATA(align) \ 104#define RO_DATA(align) \
87 . = ALIGN((align)); \ 105 . = ALIGN((align)); \
@@ -430,12 +448,59 @@
430 *(.initcall7.init) \ 448 *(.initcall7.init) \
431 *(.initcall7s.init) 449 *(.initcall7s.init)
432 450
451/**
452 * PERCPU_VADDR - define output section for percpu area
453 * @vaddr: explicit base address (optional)
454 * @phdr: destination PHDR (optional)
455 *
456 * Macro which expands to output section for percpu area. If @vaddr
457 * is not blank, it specifies explicit base address and all percpu
458 * symbols will be offset from the given address. If blank, @vaddr
459 * always equals @laddr + LOAD_OFFSET.
460 *
461 * @phdr defines the output PHDR to use if not blank. Be warned that
462 * output PHDR is sticky. If @phdr is specified, the next output
463 * section in the linker script will go there too. @phdr should have
464 * a leading colon.
465 *
466 * Note that this macros defines __per_cpu_load as an absolute symbol.
467 * If there is no need to put the percpu section at a predetermined
468 * address, use PERCPU().
469 */
470#define PERCPU_VADDR(vaddr, phdr) \
471 VMLINUX_SYMBOL(__per_cpu_load) = .; \
472 .data.percpu vaddr : AT(VMLINUX_SYMBOL(__per_cpu_load) \
473 - LOAD_OFFSET) { \
474 VMLINUX_SYMBOL(__per_cpu_start) = .; \
475 *(.data.percpu.first) \
476 *(.data.percpu.page_aligned) \
477 *(.data.percpu) \
478 *(.data.percpu.shared_aligned) \
479 VMLINUX_SYMBOL(__per_cpu_end) = .; \
480 } phdr \
481 . = VMLINUX_SYMBOL(__per_cpu_load) + SIZEOF(.data.percpu);
482
483/**
484 * PERCPU - define output section for percpu area, simple version
485 * @align: required alignment
486 *
487 * Align to @align and outputs output section for percpu area. This
488 * macro doesn't maniuplate @vaddr or @phdr and __per_cpu_load and
489 * __per_cpu_start will be identical.
490 *
491 * This macro is equivalent to ALIGN(align); PERCPU_VADDR( , ) except
492 * that __per_cpu_load is defined as a relative symbol against
493 * .data.percpu which is required for relocatable x86_32
494 * configuration.
495 */
433#define PERCPU(align) \ 496#define PERCPU(align) \
434 . = ALIGN(align); \ 497 . = ALIGN(align); \
435 VMLINUX_SYMBOL(__per_cpu_start) = .; \ 498 .data.percpu : AT(ADDR(.data.percpu) - LOAD_OFFSET) { \
436 .data.percpu : AT(ADDR(.data.percpu) - LOAD_OFFSET) { \ 499 VMLINUX_SYMBOL(__per_cpu_load) = .; \
500 VMLINUX_SYMBOL(__per_cpu_start) = .; \
501 *(.data.percpu.first) \
437 *(.data.percpu.page_aligned) \ 502 *(.data.percpu.page_aligned) \
438 *(.data.percpu) \ 503 *(.data.percpu) \
439 *(.data.percpu.shared_aligned) \ 504 *(.data.percpu.shared_aligned) \
440 } \ 505 VMLINUX_SYMBOL(__per_cpu_end) = .; \
441 VMLINUX_SYMBOL(__per_cpu_end) = .; 506 }