From 148ee150f0a4dafc2935dc8e39083a3c996992da Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Sun, 22 Nov 2020 10:56:05 +0900 Subject: [PATCH] binfmt/libelf/libelf_bind.c: Fix syslog formats --- binfmt/libelf/libelf_bind.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/binfmt/libelf/libelf_bind.c b/binfmt/libelf/libelf_bind.c index 4daac9a906..ef42a4f7ee 100644 --- a/binfmt/libelf/libelf_bind.c +++ b/binfmt/libelf/libelf_bind.c @@ -39,6 +39,7 @@ #include +#include #include #include #include @@ -338,8 +339,9 @@ static int elf_relocate(FAR struct elf_loadinfo_s *loadinfo, int relidx, rel->r_offset > dstsec->sh_size - sizeof(uint32_t)) { berr("Section %d reloc %d: Relocation address out of range, " - "offset %d size %d\n", - relidx, i, rel->r_offset, dstsec->sh_size); + "offset %" PRIdPTR " size %jd\n", + relidx, i, (uintptr_t)rel->r_offset, + (uintmax_t)dstsec->sh_size); ret = -EINVAL; break; } @@ -522,8 +524,9 @@ static int elf_relocateadd(FAR struct elf_loadinfo_s *loadinfo, int relidx, rela->r_offset > dstsec->sh_size) { berr("Section %d reloc %d: Relocation address out of range, " - "offset %d size %d\n", - relidx, i, rela->r_offset, dstsec->sh_size); + "offset %" PRIdPTR " size %jd\n", + relidx, i, (uintptr_t)rela->r_offset, + (uintmax_t)dstsec->sh_size); ret = -EINVAL; break; }