From 1385254f170a9d0369e8b8a781383975c73e0111 Mon Sep 17 00:00:00 2001 From: Xiaotian Wu Date: Tue, 13 Jun 2023 17:06:32 +0800 Subject: [PATCH] util/grub-mkimagexx: Optimize code using pc variable We already have the pc variable, no need to calculate it again. Signed-off-by: Xiaotian Wu Reviewed-by: Daniel Kiper --- util/grub-mkimagexx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c index e7d5bc631..a3ab04eb1 100644 --- a/util/grub-mkimagexx.c +++ b/util/grub-mkimagexx.c @@ -1156,7 +1156,7 @@ SUFFIX (relocate_addrs) (Elf_Ehdr *e, struct section_metadata *smd, { grub_int64_t off; - off = sym_addr - target_section_addr - offset - image_target->vaddr_offset; + off = sym_addr - pc; grub_loongarch64_b26 (t32, off); }