From 34cd44f8d7df19eece6420babaceda64ae971f06 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Sun, 22 Nov 2020 10:15:04 +0900 Subject: [PATCH] libs/libc/modlib/modlib_symbols.c: Fix syslog formats --- libs/libc/modlib/modlib_symbols.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/libs/libc/modlib/modlib_symbols.c b/libs/libc/modlib/modlib_symbols.c index 3082db2291b..3d3fd437e6d 100644 --- a/libs/libc/modlib/modlib_symbols.c +++ b/libs/libc/modlib/modlib_symbols.c @@ -24,6 +24,8 @@ #include +#include +#include #include #include #include @@ -366,7 +368,7 @@ int modlib_symvalue(FAR struct module_s *modp, (FAR void *)&exportinfo); if (ret < 0) { - berr("ERROR: modlib_symcallback failed: \n", ret); + berr("ERROR: modlib_symcallback failed: %d\n", ret); return ret; } @@ -401,9 +403,11 @@ int modlib_symvalue(FAR struct module_s *modp, * 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); } @@ -413,8 +417,9 @@ int modlib_symvalue(FAR struct module_s *modp, { 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; }