[llvm-commits] [llvm] r171651 - /llvm/trunk/tools/llvm-objdump/ELFDump.cpp
Michael J. Spencer
bigcheesegs at gmail.com
Sat Jan 5 21:23:59 PST 2013
Author: mspencer
Date: Sat Jan 5 23:23:59 2013
New Revision: 171651
URL: http://llvm.org/viewvc/llvm-project?rev=171651&view=rev
Log:
[objdump] Use correct format specifiers and fix C++03 variadic warning.
Modified:
llvm/trunk/tools/llvm-objdump/ELFDump.cpp
Modified: llvm/trunk/tools/llvm-objdump/ELFDump.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objdump/ELFDump.cpp?rev=171651&r1=171650&r2=171651&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-objdump/ELFDump.cpp (original)
+++ llvm/trunk/tools/llvm-objdump/ELFDump.cpp Sat Jan 5 23:23:59 2013
@@ -44,17 +44,19 @@
outs() << " UNKNOWN ";
}
+ const char *Fmt = is64Bits ? "0x%016" PRIx64 " " : "0x%08" PRIx64 " ";
+
outs() << "off "
- << format(is64Bits ? "0x%016x " : "0x%08x ", pi->p_offset)
+ << format(Fmt, (uint64_t)pi->p_offset)
<< "vaddr "
- << format(is64Bits ? "0x%016x " : "0x%08x ", pi->p_vaddr)
+ << format(Fmt, (uint64_t)pi->p_vaddr)
<< "paddr "
- << format(is64Bits ? "0x%016x " : "0x%08x ", pi->p_paddr)
- << format("align 2**%d\n", CountTrailingZeros_32(pi->p_align))
+ << format(Fmt, (uint64_t)pi->p_paddr)
+ << format("align 2**%u\n", CountTrailingZeros_64(pi->p_align))
<< " filesz "
- << format(is64Bits ? "0x%016x " : "0x%08x ", pi->p_filesz)
+ << format(Fmt, (uint64_t)pi->p_filesz)
<< "memsz "
- << format(is64Bits ? "0x%016x " : "0x%08x ", pi->p_memsz)
+ << format(Fmt, (uint64_t)pi->p_memsz)
<< "flags "
<< ((pi->p_flags & ELF::PF_R) ? "r" : "-")
<< ((pi->p_flags & ELF::PF_W) ? "w" : "-")
More information about the llvm-commits
mailing list