You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2020/11/22 03:38:59 UTC
[incubator-nuttx] 21/22: binfmt/libelf/libelf_bind.c: Fix syslog
formats
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 148ee150f0a4dafc2935dc8e39083a3c996992da
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Sun Nov 22 10:56:05 2020 +0900
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 4daac9a..ef42a4f 100644
--- a/binfmt/libelf/libelf_bind.c
+++ b/binfmt/libelf/libelf_bind.c
@@ -39,6 +39,7 @@
#include <nuttx/config.h>
+#include <inttypes.h>
#include <stdint.h>
#include <string.h>
#include <errno.h>
@@ -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;
}