]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
LoongArch: module: set section addresses to 0x0
authorHuacai Chen <chenhuacai@loongson.cn>
Tue, 18 Apr 2023 11:38:58 +0000 (19:38 +0800)
committerHuacai Chen <chenhuacai@loongson.cn>
Tue, 18 Apr 2023 11:38:58 +0000 (19:38 +0800)
These got*, plt* and .text.ftrace_trampoline sections specified for
LoongArch have non-zero addressses. Non-zero section addresses in a
relocatable ELF would confuse GDB when it tries to compute the section
offsets and it ends up printing wrong symbol addresses. Therefore, set
them to zero, which mirrors the change in commit 5d8591bc0fbaeb6ded
("arm64 module: set plt* section addresses to 0x0").

Cc: stable@vger.kernel.org
Reviewed-by: Guo Ren <guoren@kernel.org>
Signed-off-by: Chong Qiao <qiaochong@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
arch/loongarch/include/asm/module.lds.h

index 438f09d4ccf41d6032f07b7ebcb3799ff7bf4c22..88554f92e0103de153ece66aa2e8b7d1857db1c8 100644 (file)
@@ -2,8 +2,8 @@
 /* Copyright (C) 2020-2022 Loongson Technology Corporation Limited */
 SECTIONS {
        . = ALIGN(4);
-       .got : { BYTE(0) }
-       .plt : { BYTE(0) }
-       .plt.idx : { BYTE(0) }
-       .ftrace_trampoline : { BYTE(0) }
+       .got : { BYTE(0) }
+       .plt : { BYTE(0) }
+       .plt.idx : { BYTE(0) }
+       .ftrace_trampoline : { BYTE(0) }
 }