summaryrefslogtreecommitdiff
path: root/arch/loongarch/kernel/head.S
diff options
context:
space:
mode:
authorWANG Rui <wangrui@loongson.cn>2023-06-29 15:58:42 +0300
committerHuacai Chen <chenhuacai@loongson.cn>2023-06-29 15:58:42 +0300
commit414cefc798a30895d61e9d5b010fcf350af782d6 (patch)
treeac461832b70af66af685a23a3486506097bf9cee /arch/loongarch/kernel/head.S
parent0d03e9dce5c91d841a35af05ca61a5cf318f5064 (diff)
downloadlinux-414cefc798a30895d61e9d5b010fcf350af782d6.tar.xz
LoongArch: Calculate various sizes in the linker script
Taking the address delta between symbols in different sections is not supported by the LLVM IAS. Instead, do this in the linker script, so the same data can be properly referenced in assembly. Signed-off-by: WANG Rui <wangrui@loongson.cn> Signed-off-by: WANG Xuerui <git@xen0n.name> [chenhuacai: Fix build with !CONFIG_EFI_STUB] Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Diffstat (limited to 'arch/loongarch/kernel/head.S')
-rw-r--r--arch/loongarch/kernel/head.S8
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/loongarch/kernel/head.S b/arch/loongarch/kernel/head.S
index aa64b179744f..5e828a8bc0a0 100644
--- a/arch/loongarch/kernel/head.S
+++ b/arch/loongarch/kernel/head.S
@@ -23,7 +23,7 @@ _head:
.word MZ_MAGIC /* "MZ", MS-DOS header */
.org 0x8
.dword kernel_entry /* Kernel entry point */
- .dword _end - _text /* Kernel image effective size */
+ .dword _kernel_asize /* Kernel image effective size */
.quad PHYS_LINK_KADDR /* Kernel image load offset from start of RAM */
.org 0x38 /* 0x20 ~ 0x37 reserved */
.long LINUX_PE_MAGIC
@@ -32,9 +32,9 @@ _head:
pe_header:
__EFI_PE_HEADER
-SYM_DATA(kernel_asize, .long _end - _text);
-SYM_DATA(kernel_fsize, .long _edata - _text);
-SYM_DATA(kernel_offset, .long kernel_offset - _text);
+SYM_DATA(kernel_asize, .long _kernel_asize);
+SYM_DATA(kernel_fsize, .long _kernel_fsize);
+SYM_DATA(kernel_offset, .long _kernel_offset);
#endif