]> granicus.if.org Git - llvm/commitdiff
[elfabi] Fix the type of the variable formated for error output
authorPetar Jovanovic <petar.jovanovic@mips.com>
Tue, 5 Feb 2019 22:23:46 +0000 (22:23 +0000)
committerPetar Jovanovic <petar.jovanovic@mips.com>
Tue, 5 Feb 2019 22:23:46 +0000 (22:23 +0000)
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

index 8f3b76ccc89449ca4b1eaabd0757269ff9a494a8..a41fc19f56c5df3aa2e827fd66c834e4c6bdc578 100644 (file)
@@ -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);
     }
   }