]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
util/grub-mkimagexx: Optimize code using pc variable
authorXiaotian Wu <wuxiaotian@loongson.cn>
Tue, 13 Jun 2023 09:06:32 +0000 (17:06 +0800)
committerDaniel Kiper <daniel.kiper@oracle.com>
Tue, 13 Jun 2023 14:00:39 +0000 (16:00 +0200)
We already have the pc variable, no need to calculate it again.

Signed-off-by: Xiaotian Wu <wuxiaotian@loongson.cn>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
util/grub-mkimagexx.c

index e7d5bc631a1abfc1a111f9ebf222c6b8a8eaf2a4..a3ab04eb1671b144be08c063bd563484369f452a 100644 (file)
@@ -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);
                     }