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/12/06 13:41:56 UTC

[incubator-nuttx] 06/27: libs/libc/machine/arm/armv7-a/arch_elf.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 0117d2b2f6906b258e4b30af5e906aa996cc98de
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Sat Dec 5 22:23:02 2020 +0900

    libs/libc/machine/arm/armv7-a/arch_elf.c: Fix syslog formats
---
 libs/libc/machine/arm/armv7-a/arch_elf.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/libs/libc/machine/arm/armv7-a/arch_elf.c b/libs/libc/machine/arm/armv7-a/arch_elf.c
index 73ba3db..8e6210c 100644
--- a/libs/libc/machine/arm/armv7-a/arch_elf.c
+++ b/libs/libc/machine/arm/armv7-a/arch_elf.c
@@ -39,6 +39,7 @@
 
 #include <nuttx/config.h>
 
+#include <inttypes.h>
 #include <stdlib.h>
 #include <errno.h>
 #include <debug.h>
@@ -102,7 +103,7 @@ bool up_checkarch(FAR const Elf32_Ehdr *ehdr)
 
   if ((ehdr->e_entry & 3) != 0)
     {
-      berr("ERROR: Entry point is not properly aligned: %08x\n",
+      berr("ERROR: Entry point is not properly aligned: %08" PRIx32 "\n",
            ehdr->e_entry);
       return false;
     }
@@ -164,7 +165,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
     case R_ARM_CALL:
     case R_ARM_JUMP24:
       {
-        binfo("Performing PC24 [%d] link "
+        binfo("Performing PC24 [%" PRId32 "] link "
               "at addr %08lx [%08lx] to sym '%p' st_value=%08lx\n",
               ELF32_R_TYPE(rel->r_info), (long)addr,
               (long)(*(uint32_t *)addr),
@@ -180,7 +181,8 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
         if (offset & 3 || offset < (int32_t) 0xfe000000 ||
             offset >= (int32_t) 0x02000000)
           {
-            berr("ERROR: PC24 [%d] relocation out of range, offset=%08lx\n",
+            berr("ERROR: PC24 [%" PRId32 "] relocation out of range, "
+                 "offset=%08lx\n",
                  ELF32_R_TYPE(rel->r_info), offset);
 
             return -EINVAL;
@@ -235,7 +237,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
     case R_ARM_MOVW_ABS_NC:
     case R_ARM_MOVT_ABS:
       {
-        binfo("Performing MOVx_ABS [%d] link "
+        binfo("Performing MOVx_ABS [%" PRId32 "] link "
               "at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n",
               ELF32_R_TYPE(rel->r_info), (long)addr,
               (long)(*(uint32_t *)addr),
@@ -256,7 +258,8 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
       break;
 
     default:
-      berr("ERROR: Unsupported relocation: %d\n", ELF32_R_TYPE(rel->r_info));
+      berr("ERROR: Unsupported relocation: %" PRId32 "\n",
+           ELF32_R_TYPE(rel->r_info));
       return -EINVAL;
     }