diff options
author | Nicolas Pitre <nicolas.pitre@linaro.org> | 2018-02-28 04:39:27 +0100 |
---|---|---|
committer | Nicolas Pitre <nicolas.pitre@linaro.org> | 2018-03-10 02:19:01 +0100 |
commit | 2f181e0ba8db654cf9e1b6abe454aebca9587448 (patch) | |
tree | 16d86241f1e85cdc5d5ca8e723f6cdbc7d8ddc65 /arch/arm/kernel/vmlinux.lds.h | |
parent | Linux 4.16-rc2 (diff) | |
download | linux-2f181e0ba8db654cf9e1b6abe454aebca9587448.tar.xz linux-2f181e0ba8db654cf9e1b6abe454aebca9587448.zip |
ARM: linker script: factor out some common definitions between XIP and non-XIP
Lots of duplications between vmlinux.lds.S and vmlinux-xip.lds.S.
This may lead to one file being updated but not the other. For example,
SOFTIRQENTRY_TEXT and HYPERVISOR_TEXT were missing from the XIP version.
This creates vmlinux.lds.h where a bunch of common defines are moved.
Signed-off-by: Nicolas Pitre <nico@linaro.org>
Tested-by: Chris Brandt <Chris.Brandt@renesas.com>
Diffstat (limited to 'arch/arm/kernel/vmlinux.lds.h')
-rw-r--r-- | arch/arm/kernel/vmlinux.lds.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/arch/arm/kernel/vmlinux.lds.h b/arch/arm/kernel/vmlinux.lds.h new file mode 100644 index 000000000000..0a86e8a1119e --- /dev/null +++ b/arch/arm/kernel/vmlinux.lds.h @@ -0,0 +1,40 @@ +/* SPDX-License-Identifier: GPL-2.0 */ + +#ifdef CONFIG_HOTPLUG_CPU +#define ARM_CPU_DISCARD(x) +#define ARM_CPU_KEEP(x) x +#else +#define ARM_CPU_DISCARD(x) x +#define ARM_CPU_KEEP(x) +#endif + +#if (defined(CONFIG_SMP_ON_UP) && !defined(CONFIG_DEBUG_SPINLOCK)) || \ + defined(CONFIG_GENERIC_BUG) || defined(CONFIG_JUMP_LABEL) +#define ARM_EXIT_KEEP(x) x +#define ARM_EXIT_DISCARD(x) +#else +#define ARM_EXIT_KEEP(x) +#define ARM_EXIT_DISCARD(x) x +#endif + +#define PROC_INFO \ + . = ALIGN(4); \ + VMLINUX_SYMBOL(__proc_info_begin) = .; \ + *(.proc.info.init) \ + VMLINUX_SYMBOL(__proc_info_end) = .; + +#define HYPERVISOR_TEXT \ + VMLINUX_SYMBOL(__hyp_text_start) = .; \ + *(.hyp.text) \ + VMLINUX_SYMBOL(__hyp_text_end) = .; + +#define IDMAP_TEXT \ + ALIGN_FUNCTION(); \ + VMLINUX_SYMBOL(__idmap_text_start) = .; \ + *(.idmap.text) \ + VMLINUX_SYMBOL(__idmap_text_end) = .; \ + . = ALIGN(PAGE_SIZE); \ + VMLINUX_SYMBOL(__hyp_idmap_text_start) = .; \ + *(.hyp.idmap.text) \ + VMLINUX_SYMBOL(__hyp_idmap_text_end) = .; + |