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:39:00 UTC

[incubator-nuttx] 22/22: binfmt/libelf/libelf_symbols.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 d0687137388f91f3c7d584328d3892d49ca59ff9
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Sun Nov 22 10:58:24 2020 +0900

    binfmt/libelf/libelf_symbols.c: Fix syslog formats
---
 binfmt/libelf/libelf_symbols.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/binfmt/libelf/libelf_symbols.c b/binfmt/libelf/libelf_symbols.c
index 34a3c0c..bacab25 100644
--- a/binfmt/libelf/libelf_symbols.c
+++ b/binfmt/libelf/libelf_symbols.c
@@ -39,6 +39,7 @@
 
 #include <nuttx/config.h>
 
+#include <inttypes.h>
 #include <stdlib.h>
 #include <string.h>
 #include <errno.h>
@@ -323,9 +324,11 @@ int elf_symvalue(FAR struct elf_loadinfo_s *loadinfo, FAR Elf_Sym *sym,
          * entry
          */
 
-        binfo("SHN_UNDEF: name=%s %08x+%08x=%08x\n",
-              loadinfo->iobuffer, sym->st_value, symbol->sym_value,
-              sym->st_value + symbol->sym_value);
+        binfo("SHN_UNDEF: name=%s "
+              "%08" PRIxPTR "+%08" PRIxPTR "=%08" PRIxPTR "\n",
+              loadinfo->iobuffer, (uintptr_t)sym->st_value,
+              (uintptr_t)symbol->sym_value,
+              (uintptr_t)(sym->st_value + symbol->sym_value));
 
         sym->st_value += ((uintptr_t)symbol->sym_value);
       }
@@ -335,8 +338,9 @@ int elf_symvalue(FAR struct elf_loadinfo_s *loadinfo, FAR Elf_Sym *sym,
       {
         secbase = loadinfo->shdr[sym->st_shndx].sh_addr;
 
-        binfo("Other: %08x+%08x=%08x\n",
-              sym->st_value, secbase, sym->st_value + secbase);
+        binfo("Other: %08" PRIxPTR "+%08" PRIxPTR "=%08" PRIxPTR "\n",
+              (uintptr_t)sym->st_value, secbase,
+              (uintptr_t)(sym->st_value + secbase));
 
         sym->st_value += secbase;
       }