]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
dl/elf: Use format code PRIxGRUB_UINT64_T for 64-bit arg in grub_error()
authorGlenn Washburn <development@efficientek.com>
Fri, 5 Mar 2021 00:22:41 +0000 (18:22 -0600)
committerDaniel Kiper <daniel.kiper@oracle.com>
Wed, 10 Mar 2021 14:22:18 +0000 (15:22 +0100)
The macro ELF_R_TYPE does not change the underlying type. Here its argument
is a 64-bit Elf64_Xword. Make sure the format code matches.

For the RISC-V architecture, rel->r_info could be either Elf32_Xword or
Elf64_Xword depending on if 32 or 64-bit RISC-V is being built. So cast
to 64-bit value regardless.

Signed-off-by: Glenn Washburn <development@efficientek.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/efiemu/i386/loadcore64.c
grub-core/kern/arm64/dl.c
grub-core/kern/ia64/dl.c
grub-core/kern/riscv/dl.c
grub-core/kern/sparc64/dl.c
grub-core/kern/x86_64/dl.c

index 18facf47fd7678007deb730fb71256edff6292ad..7316efc39060dbcad063583bb8d8619b923868d9 100644 (file)
@@ -122,7 +122,8 @@ grub_arch_efiemu_relocate_symbols64 (grub_efiemu_segment_t segs,
                     break;
                  default:
                    return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
-                                      N_("relocation 0x%x is not implemented yet"),
+                                      N_("relocation 0x%" PRIxGRUB_UINT64_T
+                                         " is not implemented yet"),
                                       ELF_R_TYPE (rel->r_info));
                  }
              }
index fb03373190bdef5be23080cd44705f2ab0569fc7..40167237419066b43b65bbbfe182b0cc7dc67940 100644 (file)
@@ -184,7 +184,8 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr,
 
        default:
          return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
-                            N_("relocation 0x%x is not implemented yet"),
+                            N_("relocation 0x%" PRIxGRUB_UINT64_T
+                               " is not implemented yet"),
                             ELF_R_TYPE (rel->r_info));
        }
     }
index ebcf3162982a320386b25a9fc98ee924430cb0ad..b19706c500d5671a6b40d72ae036265439da46cd 100644 (file)
@@ -137,7 +137,8 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr,
          break;
        default:
          return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
-                            N_("relocation 0x%x is not implemented yet"),
+                            N_("relocation 0x%" PRIxGRUB_UINT64_T
+                               " is not implemented yet"),
                             ELF_R_TYPE (rel->r_info));
        }
     }
index 6fb8385efd0705f7e6e1c5e2d93be2bcdceef2e5..d78297eee29b7a1391fd975f1fe8f605810dedbe 100644 (file)
@@ -331,8 +331,9 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr,
          break;
        default:
          return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
-                            N_("relocation 0x%x is not implemented yet"),
-                            ELF_R_TYPE (rel->r_info));
+                            N_("relocation 0x%" PRIxGRUB_UINT64_T
+                               " is not implemented yet"),
+                            (grub_uint64_t) ELF_R_TYPE (rel->r_info));
        }
     }
 
index 739be47174accd627e277adb0ab7b1bc01a60d08..bbcce8ed5078d4c2fc850a63f58a1f1cfd0119dd 100644 (file)
@@ -177,7 +177,8 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr,
          break;
        default:
          return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
-                            N_("relocation 0x%x is not implemented yet"),
+                            N_("relocation 0x%" PRIxGRUB_UINT64_T
+                               " is not implemented yet"),
                             ELF_R_TYPE (rel->r_info));
        }
     }
index 3a73e6e6ce2c5aefc33313e583cb259ea9bc2645..1af5a0eeb39cb5f8d75d9575db63ca580a92c836 100644 (file)
@@ -107,7 +107,8 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr,
 
        default:
          return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
-                            N_("relocation 0x%x is not implemented yet"),
+                            N_("relocation 0x%" PRIxGRUB_UINT64_T
+                               " is not implemented yet"),
                             ELF_R_TYPE (rel->r_info));
        }
     }