diff --git a/libs/libc/machine/arm/armv7-a/arch_elf.c b/libs/libc/machine/arm/armv7-a/arch_elf.c index 73ba3dbeec1..8e6210ca71c 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 +#include #include #include #include @@ -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; }