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, 22 insertions, 7 deletions
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 6ad76bf5fb40..29ca8f53ffbe 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -33,13 +33,10 @@
33 * BSS_SECTION(0, 0, 0) 33 * BSS_SECTION(0, 0, 0)
34 * _end = .; 34 * _end = .;
35 * 35 *
36 * /DISCARD/ : {
37 * EXIT_TEXT
38 * EXIT_DATA
39 * EXIT_CALL
40 * }
41 * STABS_DEBUG 36 * STABS_DEBUG
42 * DWARF_DEBUG 37 * DWARF_DEBUG
38 *
39 * DISCARDS // must be the last
43 * } 40 * }
44 * 41 *
45 * [__init_begin, __init_end] is the init section that may be freed after init 42 * [__init_begin, __init_end] is the init section that may be freed after init
@@ -91,7 +88,8 @@
91#endif 88#endif
92 89
93#ifdef CONFIG_FTRACE_MCOUNT_RECORD 90#ifdef CONFIG_FTRACE_MCOUNT_RECORD
94#define MCOUNT_REC() VMLINUX_SYMBOL(__start_mcount_loc) = .; \ 91#define MCOUNT_REC() . = ALIGN(8); \
92 VMLINUX_SYMBOL(__start_mcount_loc) = .; \
95 *(__mcount_loc) \ 93 *(__mcount_loc) \
96 VMLINUX_SYMBOL(__stop_mcount_loc) = .; 94 VMLINUX_SYMBOL(__stop_mcount_loc) = .;
97#else 95#else
@@ -331,7 +329,6 @@
331 /* __*init sections */ \ 329 /* __*init sections */ \
332 __init_rodata : AT(ADDR(__init_rodata) - LOAD_OFFSET) { \ 330 __init_rodata : AT(ADDR(__init_rodata) - LOAD_OFFSET) { \
333 *(.ref.rodata) \ 331 *(.ref.rodata) \
334 MCOUNT_REC() \
335 DEV_KEEP(init.rodata) \ 332 DEV_KEEP(init.rodata) \
336 DEV_KEEP(exit.rodata) \ 333 DEV_KEEP(exit.rodata) \
337 CPU_KEEP(init.rodata) \ 334 CPU_KEEP(init.rodata) \
@@ -455,6 +452,7 @@
455 MEM_DISCARD(init.data) \ 452 MEM_DISCARD(init.data) \
456 KERNEL_CTORS() \ 453 KERNEL_CTORS() \
457 *(.init.rodata) \ 454 *(.init.rodata) \
455 MCOUNT_REC() \
458 DEV_DISCARD(init.rodata) \ 456 DEV_DISCARD(init.rodata) \
459 CPU_DISCARD(init.rodata) \ 457 CPU_DISCARD(init.rodata) \
460 MEM_DISCARD(init.rodata) 458 MEM_DISCARD(init.rodata)
@@ -626,6 +624,23 @@
626#define INIT_RAM_FS 624#define INIT_RAM_FS
627#endif 625#endif
628 626
627/*
628 * Default discarded sections.
629 *
630 * Some archs want to discard exit text/data at runtime rather than
631 * link time due to cross-section references such as alt instructions,
632 * bug table, eh_frame, etc. DISCARDS must be the last of output
633 * section definitions so that such archs put those in earlier section
634 * definitions.
635 */
636#define DISCARDS \
637 /DISCARD/ : { \
638 EXIT_TEXT \
639 EXIT_DATA \
640 EXIT_CALL \
641 *(.discard) \
642 }
643
629/** 644/**
630 * PERCPU_VADDR - define output section for percpu area 645 * PERCPU_VADDR - define output section for percpu area
631 * @vaddr: explicit base address (optional) 646 * @vaddr: explicit base address (optional)