[PATCH v2 2/6] LoongArch: Move the content defined by SYM_DATA to data or rodata section

From: Jinyang He
Date: Tue Feb 28 2023 - 03:04:01 EST


Due to the SYM_DATA do not give the section notes, manually set it.

Reported-by: Youling Tang <tangyouling@xxxxxxxxxxx>
Signed-off-by: Jinyang He <hejinyang@xxxxxxxxxxx>
---
arch/loongarch/kernel/genex.S | 2 ++
arch/loongarch/kernel/head.S | 2 ++
2 files changed, 4 insertions(+)

diff --git a/arch/loongarch/kernel/genex.S b/arch/loongarch/kernel/genex.S
index 1af169ca3734..de591a9270bd 100644
--- a/arch/loongarch/kernel/genex.S
+++ b/arch/loongarch/kernel/genex.S
@@ -77,7 +77,9 @@ SYM_FUNC_END(except_vec_cex)
668:
RESTORE_ALL_AND_RET
SYM_FUNC_END(handle_\exception)
+ .pushsection .rodata
SYM_DATA(unwind_hint_\exception, .word 668b - 666b)
+ .popsection
.endm

BUILD_HANDLER ade ade badv
diff --git a/arch/loongarch/kernel/head.S b/arch/loongarch/kernel/head.S
index aa64b179744f..7cfa1f850e54 100644
--- a/arch/loongarch/kernel/head.S
+++ b/arch/loongarch/kernel/head.S
@@ -32,9 +32,11 @@ _head:
pe_header:
__EFI_PE_HEADER

+.pushsection .rodata
SYM_DATA(kernel_asize, .long _end - _text);
SYM_DATA(kernel_fsize, .long _edata - _text);
SYM_DATA(kernel_offset, .long kernel_offset - _text);
+.popsection

#endif

--
2.34.3