[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v6 10/14] error: Use format code PRIxGRUB_UINT64_T for 64-bit arg
From: |
Glenn Washburn |
Subject: |
[PATCH v6 10/14] error: Use format code PRIxGRUB_UINT64_T for 64-bit arg in grub_error |
Date: |
Thu, 4 Mar 2021 18:22:41 -0600 |
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 riscv architecture, rel->r_info could be either Elf32_Xword or
Elf64_Xword depending on if 32 or 64-bit risc is being built. So cast to
64-bit value regardless.
Signed-off-by: Glenn Washburn <development@efficientek.com>
---
grub-core/efiemu/i386/loadcore64.c | 3 ++-
grub-core/kern/arm64/dl.c | 3 ++-
grub-core/kern/ia64/dl.c | 3 ++-
grub-core/kern/riscv/dl.c | 5 +++--
grub-core/kern/sparc64/dl.c | 3 ++-
grub-core/kern/x86_64/dl.c | 3 ++-
6 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/grub-core/efiemu/i386/loadcore64.c
b/grub-core/efiemu/i386/loadcore64.c
index 18facf47f..7316efc39 100644
--- a/grub-core/efiemu/i386/loadcore64.c
+++ b/grub-core/efiemu/i386/loadcore64.c
@@ -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));
}
}
diff --git a/grub-core/kern/arm64/dl.c b/grub-core/kern/arm64/dl.c
index fb0337319..401672374 100644
--- a/grub-core/kern/arm64/dl.c
+++ b/grub-core/kern/arm64/dl.c
@@ -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));
}
}
diff --git a/grub-core/kern/ia64/dl.c b/grub-core/kern/ia64/dl.c
index ebcf31629..b19706c50 100644
--- a/grub-core/kern/ia64/dl.c
+++ b/grub-core/kern/ia64/dl.c
@@ -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));
}
}
diff --git a/grub-core/kern/riscv/dl.c b/grub-core/kern/riscv/dl.c
index 6fb8385ef..d78297eee 100644
--- a/grub-core/kern/riscv/dl.c
+++ b/grub-core/kern/riscv/dl.c
@@ -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));
}
}
diff --git a/grub-core/kern/sparc64/dl.c b/grub-core/kern/sparc64/dl.c
index 739be4717..bbcce8ed5 100644
--- a/grub-core/kern/sparc64/dl.c
+++ b/grub-core/kern/sparc64/dl.c
@@ -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));
}
}
diff --git a/grub-core/kern/x86_64/dl.c b/grub-core/kern/x86_64/dl.c
index 3a73e6e6c..1af5a0eeb 100644
--- a/grub-core/kern/x86_64/dl.c
+++ b/grub-core/kern/x86_64/dl.c
@@ -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));
}
}
--
2.27.0
- [PATCH v6 00/14] error: Do compile-time format string checking on grub>, Glenn Washburn, 2021/03/04
- [PATCH v6 07/14] efi: Format string error in grub_error, Glenn Washburn, 2021/03/04
- [PATCH v6 02/14] error: grub_error missing format string argument, Glenn Washburn, 2021/03/04
- [PATCH v6 06/14] pgp: Format code for grub_error is incorrect, Glenn Washburn, 2021/03/04
- [PATCH v6 10/14] error: Use format code PRIxGRUB_UINT64_T for 64-bit arg in grub_error,
Glenn Washburn <=
- [PATCH v6 08/14] error: Use PRI* macros to get correct format string code across architectures, Glenn Washburn, 2021/03/04
- [PATCH v6 01/14] misc: Format string for grub_error should be a literal, Glenn Washburn, 2021/03/04
- [PATCH v6 03/14] error: grub_error format string add missing format code, Glenn Washburn, 2021/03/04
- [PATCH v6 05/14] grub_error: Use format code PRIuGRUB_SIZE for variables of type grub_size_t, Glenn Washburn, 2021/03/04
- [PATCH v6 09/14] error: Use format code PRIxGRUB_UINT64_T for 64-bit uint argument in grub_error, Glenn Washburn, 2021/03/04
- [PATCH v6 04/14] dmraid_nvidia: Format string error in grub_error, Glenn Washburn, 2021/03/04
- [PATCH v6 14/14] zfs: Use grub_uint64_t instead of 1ULL in BF64_*CODE macros, Glenn Washburn, 2021/03/04
- [PATCH v6 11/14] error: Use format code PRIuGRUB_UINT64_T for 64-bit typed fileblock in grub_error, Glenn Washburn, 2021/03/04
- [PATCH v6 13/14] error: Do compile-time format string checking on grub_error, Glenn Washburn, 2021/03/04
- [PATCH v6 12/14] error: Use format code llu for 64-bit uint bp->blk_prop in grub_error, Glenn Washburn, 2021/03/04