From fa147c97d6ba1a59fe885a193a40a274158f38da Mon Sep 17 00:00:00 2001 From: Eugene Leviant Date: Thu, 30 May 2019 09:09:01 +0000 Subject: [PATCH] [llvm-objcopy] Remove %p format specifiers 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 | 6 +++--- llvm/tools/llvm-objcopy/ELF/Object.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/llvm/test/tools/llvm-objcopy/ELF/ihex-writer.test b/llvm/test/tools/llvm-objcopy/ELF/ihex-writer.test index 9275ddd..f9c9155 100644 --- a/llvm/test/tools/llvm-objcopy/ELF/ihex-writer.test +++ b/llvm/test/tools/llvm-objcopy/ELF/ihex-writer.test @@ -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 diff --git a/llvm/tools/llvm-objcopy/ELF/Object.cpp b/llvm/tools/llvm-objcopy/ELF/Object.cpp index a43fab2..e70a3b1 100644 --- a/llvm/tools/llvm-objcopy/ELF/Object.cpp +++ b/llvm/tools/llvm-objcopy/ELF/Object.cpp @@ -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 -- 2.7.4