[LLVM][objcopy] Fix update-section.test on 32 bit platforms
authorDavid Spickett <david.spickett@linaro.org>
Fri, 16 Dec 2022 11:09:49 +0000 (11:09 +0000)
committerDavid Spickett <david.spickett@linaro.org>
Fri, 16 Dec 2022 11:12:15 +0000 (11:12 +0000)
This used %zu to print a uint64_t type. z is for size_t so on 32 bit
we tried to treat it as a 32 bit number.

Use PRIu64 instead to print as 64 bit everywhere.

llvm/lib/ObjCopy/ELF/ELFObject.cpp
llvm/test/tools/llvm-objcopy/ELF/update-section.test

index 9960974..ea6dada 100644 (file)
@@ -2115,7 +2115,7 @@ Error Object::updateSection(StringRef Name, ArrayRef<uint8_t> Data) {
   if (Data.size() > OldSec->Size && OldSec->ParentSegment)
     return createStringError(errc::invalid_argument,
                              "cannot fit data of size %zu into section '%s' "
-                             "with size %zu that is part of a segment",
+                             "with size %" PRIu64 " that is part of a segment",
                              Data.size(), Name.str().c_str(), OldSec->Size);
 
   if (!OldSec->ParentSegment) {
index ecd108b..79cfe0e 100644 (file)
@@ -1,4 +1,3 @@
-# XFAIL: target={{arm.*linux-gnu.*}}
 # REQUIRES: x86-registered-target
 
 # RUN: yaml2obj %s -o %t