[llvm] r353225 - [elfabi] Fix the type of the variable formated for error output

Petar Jovanovic via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 5 14:23:46 PST 2019


Author: petarj
Date: Tue Feb  5 14:23:46 2019
New Revision: 353225

URL: http://llvm.org/viewvc/llvm-project?rev=353225&view=rev
Log:
[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

Modified:
    llvm/trunk/tools/llvm-elfabi/ELFObjHandler.cpp

Modified: llvm/trunk/tools/llvm-elfabi/ELFObjHandler.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-elfabi/ELFObjHandler.cpp?rev=353225&r1=353224&r2=353225&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-elfabi/ELFObjHandler.cpp (original)
+++ llvm/trunk/tools/llvm-elfabi/ELFObjHandler.cpp Tue Feb  5 14:23:46 2019
@@ -130,14 +130,16 @@ static Error populateDynamic(DynamicEntr
   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);
     }
   }




More information about the llvm-commits mailing list