mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] LoongArch: Remove a redundant checking in relocator
@ 2024-07-06  7:38 Xi Ruoyao
  2024-07-06  7:38 ` [PATCH 2/2] LoongArch: Add support for relocating the kernel with RELR relocation Xi Ruoyao
  2024-07-06  9:44 ` [PATCH 1/2] LoongArch: Remove a redundant checking in relocator Markus Elfring
  0 siblings, 2 replies; 7+ messages in thread
From: Xi Ruoyao @ 2024-07-06  7:38 UTC (permalink / raw)
  To: Huacai Chen, WANG Xuerui
  Cc: Jinyang He, Youling Tang, Tiezhu Yang, Fangrui Song,
	Nathan Chancellor, Nick Desaulniers, loongarch, linux-kernel,
	llvm, Xi Ruoyao

With our linker script "relocated_addr >= VMLINUX_LOAD_ADDRESS" should
be always true.

Signed-off-by: Xi Ruoyao <xry111@xry111.site>
---
 arch/loongarch/kernel/relocate.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/loongarch/kernel/relocate.c b/arch/loongarch/kernel/relocate.c
index 1acfa704c8d0..69d73dc7326a 100644
--- a/arch/loongarch/kernel/relocate.c
+++ b/arch/loongarch/kernel/relocate.c
@@ -34,9 +34,7 @@ static inline void __init relocate_relative(void)
 		if (rela->r_info != R_LARCH_RELATIVE)
 			continue;
 
-		if (relocated_addr >= VMLINUX_LOAD_ADDRESS)
-			relocated_addr = (Elf64_Addr)RELOCATED(relocated_addr);
-
+		relocated_addr = (Elf64_Addr)RELOCATED(relocated_addr);
 		*(Elf64_Addr *)RELOCATED(addr) = relocated_addr;
 	}
 }
-- 
2.45.2


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-07-06 14:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-06  7:38 [PATCH 1/2] LoongArch: Remove a redundant checking in relocator Xi Ruoyao
2024-07-06  7:38 ` [PATCH 2/2] LoongArch: Add support for relocating the kernel with RELR relocation Xi Ruoyao
2024-07-06 10:29   ` Huacai Chen
2024-07-06 10:33     ` Xi Ruoyao
2024-07-06 13:49       ` Huacai Chen
2024-07-06 14:46         ` Xi Ruoyao
2024-07-06  9:44 ` [PATCH 1/2] LoongArch: Remove a redundant checking in relocator Markus Elfring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®