libs/libc/modlib/modlib_symbols.c: Fix syslog formats

This commit is contained in:
YAMAMOTO Takashi
2020-11-22 10:15:04 +09:00
committed by Xiang Xiao
parent 6bdca69a32
commit 34cd44f8d7
+11 -6
View File
@@ -24,6 +24,8 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <inttypes.h>
#include <stdint.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <errno.h> #include <errno.h>
@@ -366,7 +368,7 @@ int modlib_symvalue(FAR struct module_s *modp,
(FAR void *)&exportinfo); (FAR void *)&exportinfo);
if (ret < 0) if (ret < 0)
{ {
berr("ERROR: modlib_symcallback failed: \n", ret); berr("ERROR: modlib_symcallback failed: %d\n", ret);
return ret; return ret;
} }
@@ -401,9 +403,11 @@ int modlib_symvalue(FAR struct module_s *modp,
* entry * entry
*/ */
binfo("SHN_UNDEF: name=%s %08x+%08x=%08x\n", binfo("SHN_UNDEF: name=%s "
loadinfo->iobuffer, sym->st_value, symbol->sym_value, "%08" PRIxPTR "+%08" PRIxPTR "=%08" PRIxPTR "\n",
sym->st_value + symbol->sym_value); 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); sym->st_value += ((uintptr_t)symbol->sym_value);
} }
@@ -413,8 +417,9 @@ int modlib_symvalue(FAR struct module_s *modp,
{ {
secbase = loadinfo->shdr[sym->st_shndx].sh_addr; secbase = loadinfo->shdr[sym->st_shndx].sh_addr;
binfo("Other: %08x+%08x=%08x\n", binfo("Other: %08" PRIxPTR "+%08" PRIxPTR "=%08" PRIxPTR "\n",
sym->st_value, secbase, sym->st_value + secbase); (uintptr_t)sym->st_value, secbase,
(uintptr_t)(sym->st_value + secbase));
sym->st_value += secbase; sym->st_value += secbase;
} }