From 4876a5d039e291d2f5eba4a8900b78b397cb58c5 Mon Sep 17 00:00:00 2001 From: Petar Jovanovic Date: Tue, 5 Feb 2019 22:23:46 +0000 Subject: [PATCH] [elfabi] Fix the type of the variable formated for error output Change the format type of Dyn.SONameOffset to PRIx64 since it is a uint64_t. The problem was detected on mips builds, where it was printing junk values and causing test failure. Patch by Milos Stojanovic. Differential Revision: https://reviews.llvm.org/D57676 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353225 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/llvm-elfabi/ELFObjHandler.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/llvm-elfabi/ELFObjHandler.cpp b/tools/llvm-elfabi/ELFObjHandler.cpp index 8f3b76ccc89..a41fc19f56c 100644 --- a/tools/llvm-elfabi/ELFObjHandler.cpp +++ b/tools/llvm-elfabi/ELFObjHandler.cpp @@ -130,14 +130,16 @@ static Error populateDynamic(DynamicEntries &Dyn, if (Dyn.SONameOffset.hasValue() && *Dyn.SONameOffset >= Dyn.StrSize) { return createStringError( object_error::parse_failed, - "DT_SONAME string offset (0x%016x) outside of dynamic string table", + "DT_SONAME string offset (0x%016" PRIx64 + ") outside of dynamic string table", *Dyn.SONameOffset); } for (uint64_t Offset : Dyn.NeededLibNames) { if (Offset >= Dyn.StrSize) { return createStringError( object_error::parse_failed, - "DT_NEEDED string offset (0x%016x) outside of dynamic string table", + "DT_NEEDED string offset (0x%016" PRIx64 + ") outside of dynamic string table", Offset); } } -- 2.50.1