[llvm-objcopy] Remove %p format specifiers
authorEugene Leviant <eleviant@accesssoftek.com>
Thu, 30 May 2019 09:09:01 +0000 (09:09 +0000)
committerEugene Leviant <eleviant@accesssoftek.com>
Thu, 30 May 2019 09:09:01 +0000 (09:09 +0000)
On 32-bit machines %p expects 32 bit values, however
addresses in llvm-objcopy are always 64 bits.

llvm-svn: 362074

llvm/test/tools/llvm-objcopy/ELF/ihex-writer.test
llvm/tools/llvm-objcopy/ELF/Object.cpp

index 9275ddd..f9c9155 100644 (file)
@@ -67,8 +67,8 @@
 # SIGN_EXTENDED-NEXT: :051000000001020304E1
 # SIGN_EXTENDED-NEXT: :00000001FF
 
-# BAD-ADDR: error: {{.*}}: Section '.text2' address range [{{.*}}, {{.*}}] is not 32 bit
-# BAD-ADDR2: error: {{.*}}: Section '.text3' address range [{{.*}}, {{.*}}] is not 32 bit
+# BAD-ADDR: error: {{.*}}: Section '.text2' address range [0x{{.*}}, 0x{{.*}}] is not 32 bit
+# BAD-ADDR2: error: {{.*}}: Section '.text3' address range [0x{{.*}}, 0x{{.*}}] is not 32 bit
 
 # There shouldn't be 'ExtendedAddr' nor 'Data' records
 # ZERO_SIZE_SEC-NOT:  :02000004
@@ -78,4 +78,4 @@
 # START1: :040000030000FFFFFB
 # START2: :0400000500100000E7
 # START3: :040000058000100067
-# BAD-START: error: {{.*}}: Entry point address {{.*}} overflows 32 bits
+# BAD-START: error: {{.*}}: Entry point address 0x{{.*}} overflows 32 bits
index a43fab2..e70a3b1 100644 (file)
@@ -2019,7 +2019,7 @@ Error IHexWriter::checkSection(const SectionBase &Sec) {
   if (addressOverflows32bit(Addr) || addressOverflows32bit(Addr + Sec.Size - 1))
     return createStringError(
         errc::invalid_argument,
-        "Section '%s' address range [%p, %p] is not 32 bit", Sec.Name.c_str(),
+        "Section '%s' address range [0x%llx, 0x%llx] is not 32 bit", Sec.Name.c_str(),
         Addr, Addr + Sec.Size - 1);
   return Error::success();
 }
@@ -2036,7 +2036,7 @@ Error IHexWriter::finalize() {
   // We can't write 64-bit addresses.
   if (addressOverflows32bit(Obj.Entry))
     return createStringError(errc::invalid_argument,
-                             "Entry point address %p overflows 32 bits.",
+                             "Entry point address 0x%llx overflows 32 bits.",
                              Obj.Entry);
 
   // If any section we're to write has segment then we