[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
This commit is contained in:
Michael J. Spencer 2013-01-06 05:23:59 +00:00
parent 95abfbe8e9
commit 46418797cd

View File

@ -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" : "-")