[llvm] beae6bf - [LLVM][objcopy] Fix update-section.test on 32 bit platforms

David Spickett via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 16 03:12:43 PST 2022


Author: David Spickett
Date: 2022-12-16T11:12:15Z
New Revision: beae6bfa14ac991b405d2928027fb0e31e777a09

URL: https://github.com/llvm/llvm-project/commit/beae6bfa14ac991b405d2928027fb0e31e777a09
DIFF: https://github.com/llvm/llvm-project/commit/beae6bfa14ac991b405d2928027fb0e31e777a09.diff

LOG: [LLVM][objcopy] Fix update-section.test on 32 bit platforms

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.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/ObjCopy/ELF/ELFObject.cpp b/llvm/lib/ObjCopy/ELF/ELFObject.cpp
index 9960974e1d4e1..ea6dadabace6d 100644
--- a/llvm/lib/ObjCopy/ELF/ELFObject.cpp
+++ b/llvm/lib/ObjCopy/ELF/ELFObject.cpp
@@ -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) {

diff  --git a/llvm/test/tools/llvm-objcopy/ELF/update-section.test b/llvm/test/tools/llvm-objcopy/ELF/update-section.test
index ecd108b19bb9c..79cfe0e719418 100644
--- a/llvm/test/tools/llvm-objcopy/ELF/update-section.test
+++ b/llvm/test/tools/llvm-objcopy/ELF/update-section.test
@@ -1,4 +1,3 @@
-# XFAIL: target={{arm.*linux-gnu.*}}
 # REQUIRES: x86-registered-target
 
 # RUN: yaml2obj %s -o %t


        


More information about the llvm-commits mailing list