Skip to content

Commit d7e3b06

Browse files
keesingomolnar
authored andcommitted
arm/build: Refactor linker script headers
In preparation for adding --orphan-handling=warn, refactor the linker script header includes, and extract common macros. Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Ingo Molnar <mingo@kernel.org> Cc: Russell King <linux@armlinux.org.uk> Link: https://lore.kernel.org/r/20200821194310.3089815-16-keescook@chromium.org
1 parent be28818 commit d7e3b06

3 files changed

Lines changed: 10 additions & 11 deletions

File tree

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/* SPDX-License-Identifier: GPL-2.0 */
2+
#include <asm-generic/vmlinux.lds.h>
23

34
#ifdef CONFIG_HOTPLUG_CPU
45
#define ARM_CPU_DISCARD(x)
@@ -49,8 +50,12 @@
4950
EXIT_CALL \
5051
ARM_MMU_DISCARD(*(.text.fixup)) \
5152
ARM_MMU_DISCARD(*(__ex_table)) \
52-
*(.discard) \
53-
*(.discard.*)
53+
COMMON_DISCARDS
54+
55+
#define ARM_STUBS_TEXT \
56+
*(.gnu.warning) \
57+
*(.glue_7) \
58+
*(.glue_7t)
5459

5560
#define ARM_TEXT \
5661
IDMAP_TEXT \
@@ -64,9 +69,7 @@
6469
CPUIDLE_TEXT \
6570
LOCK_TEXT \
6671
KPROBES_TEXT \
67-
*(.gnu.warning) \
68-
*(.glue_7) \
69-
*(.glue_7t) \
72+
ARM_STUBS_TEXT \
7073
. = ALIGN(4); \
7174
*(.got) /* Global offset table */ \
7275
ARM_CPU_KEEP(PROC_INFO)

arch/arm/kernel/vmlinux-xip.lds.S

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,13 @@
99

1010
#include <linux/sizes.h>
1111

12-
#include <asm-generic/vmlinux.lds.h>
12+
#include <asm/vmlinux.lds.h>
1313
#include <asm/cache.h>
1414
#include <asm/thread_info.h>
1515
#include <asm/memory.h>
1616
#include <asm/mpu.h>
1717
#include <asm/page.h>
1818

19-
#include "vmlinux.lds.h"
20-
2119
OUTPUT_ARCH(arm)
2220
ENTRY(stext)
2321

arch/arm/kernel/vmlinux.lds.S

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,13 @@
99
#else
1010

1111
#include <linux/pgtable.h>
12-
#include <asm-generic/vmlinux.lds.h>
12+
#include <asm/vmlinux.lds.h>
1313
#include <asm/cache.h>
1414
#include <asm/thread_info.h>
1515
#include <asm/memory.h>
1616
#include <asm/mpu.h>
1717
#include <asm/page.h>
1818

19-
#include "vmlinux.lds.h"
20-
2119
OUTPUT_ARCH(arm)
2220
ENTRY(stext)
2321

0 commit comments

Comments
 (0)