Skip to content

Commit 5f1f7f6

Browse files
committed
arm64: Reduce the number of header files pulled into vmlinux.lds.S
Although vmlinux.lds.S smells like an assembly file and is compiled with __ASSEMBLY__ defined, it's actually just fed to the preprocessor to create our linker script. This means that any assembly macros defined by headers that it includes will result in a helpful link error: | aarch64-linux-gnu-ld:./arch/arm64/kernel/vmlinux.lds:1: syntax error In preparation for an arm64-private asm/rwonce.h implementation, which will end up pulling assembly macros into linux/compiler.h, reduce the number of headers we include directly and transitively in vmlinux.lds.S Acked-by: Peter Zijlstra (Intel) <[email protected]> Signed-off-by: Will Deacon <[email protected]>
1 parent eb5c2d4 commit 5f1f7f6

File tree

6 files changed

+10
-7
lines changed

6 files changed

+10
-7
lines changed

arch/arm64/include/asm/kernel-pgtable.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#ifndef __ASM_KERNEL_PGTABLE_H
99
#define __ASM_KERNEL_PGTABLE_H
1010

11-
#include <linux/pgtable.h>
11+
#include <asm/pgtable-hwdef.h>
1212
#include <asm/sparsemem.h>
1313

1414
/*

arch/arm64/include/asm/memory.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,8 @@
1010
#ifndef __ASM_MEMORY_H
1111
#define __ASM_MEMORY_H
1212

13-
#include <linux/compiler.h>
1413
#include <linux/const.h>
1514
#include <linux/sizes.h>
16-
#include <linux/types.h>
17-
#include <asm/bug.h>
1815
#include <asm/page-def.h>
1916

2017
/*
@@ -157,11 +154,15 @@
157154
#endif
158155

159156
#ifndef __ASSEMBLY__
160-
extern u64 vabits_actual;
161-
#define PAGE_END (_PAGE_END(vabits_actual))
162157

163158
#include <linux/bitops.h>
159+
#include <linux/compiler.h>
164160
#include <linux/mmdebug.h>
161+
#include <linux/types.h>
162+
#include <asm/bug.h>
163+
164+
extern u64 vabits_actual;
165+
#define PAGE_END (_PAGE_END(vabits_actual))
165166

166167
extern s64 physvirt_offset;
167168
extern s64 memstart_addr;

arch/arm64/include/asm/uaccess.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <linux/string.h>
2020

2121
#include <asm/cpufeature.h>
22+
#include <asm/mmu.h>
2223
#include <asm/ptrace.h>
2324
#include <asm/memory.h>
2425
#include <asm/extable.h>

arch/arm64/kernel/entry.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <asm/assembler.h>
1616
#include <asm/asm-offsets.h>
1717
#include <asm/asm_pointer_auth.h>
18+
#include <asm/bug.h>
1819
#include <asm/cpufeature.h>
1920
#include <asm/errno.h>
2021
#include <asm/esr.h>

arch/arm64/kernel/vmlinux.lds.S

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include <asm-generic/vmlinux.lds.h>
1111
#include <asm/cache.h>
1212
#include <asm/kernel-pgtable.h>
13-
#include <asm/thread_info.h>
1413
#include <asm/memory.h>
1514
#include <asm/page.h>
1615

arch/arm64/kvm/hyp-init.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
#include <linux/linkage.h>
88

9+
#include <asm/alternative.h>
910
#include <asm/assembler.h>
1011
#include <asm/kvm_arm.h>
1112
#include <asm/kvm_mmu.h>

0 commit comments

Comments
 (0)