diff options
author | Michael J. Spencer <bigcheesegs@gmail.com> | 2013-01-06 05:23:59 +0000 |
---|---|---|
committer | Michael J. Spencer <bigcheesegs@gmail.com> | 2013-01-06 05:23:59 +0000 |
commit | 46418797cd3b24ddf92240eab76f52bc7ac72d9d (patch) | |
tree | f39e2645c2350ce6a83283488271f7ca62566134 /tools | |
parent | 95abfbe8e9567e08188ada7d29f589f08e539bd6 (diff) |
[objdump] Use correct format specifiers and fix C++03 variadic warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171651 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r-- | tools/llvm-objdump/ELFDump.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/tools/llvm-objdump/ELFDump.cpp b/tools/llvm-objdump/ELFDump.cpp index f018eed4f5..a635fefc3b 100644 --- a/tools/llvm-objdump/ELFDump.cpp +++ b/tools/llvm-objdump/ELFDump.cpp @@ -44,17 +44,19 @@ void printProgramHeaders( 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" : "-") |