diff options
author | Kevin Enderby <enderby@apple.com> | 2016-02-09 18:33:15 +0000 |
---|---|---|
committer | Kevin Enderby <enderby@apple.com> | 2016-02-09 18:33:15 +0000 |
commit | 2058e9dff09d2ba750602429717aa16d22e24719 (patch) | |
tree | e47ea6b44a37c9686824815513ffdd384aa3dad8 /llvm/tools/llvm-size/llvm-size.cpp | |
parent | 24c46ad50f066e0368da1e6ad50458460857d9d5 (diff) | |
download | bcm5719-llvm-2058e9dff09d2ba750602429717aa16d22e24719.tar.gz bcm5719-llvm-2058e9dff09d2ba750602429717aa16d22e24719.zip |
Fix a formatting problems with llvm-size and the -m option.
It was using format() with a string for 64-bit types but was
passed a 32-bit type in places when printing values for
32-bit Mach-O files.
rdar://24542509
llvm-svn: 260243
Diffstat (limited to 'llvm/tools/llvm-size/llvm-size.cpp')
-rw-r--r-- | llvm/tools/llvm-size/llvm-size.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/tools/llvm-size/llvm-size.cpp b/llvm/tools/llvm-size/llvm-size.cpp index 159afcf6c86..5addbb3ea9d 100644 --- a/llvm/tools/llvm-size/llvm-size.cpp +++ b/llvm/tools/llvm-size/llvm-size.cpp @@ -171,10 +171,11 @@ static void PrintDarwinSectionSizes(MachOObjectFile *MachO) { outs() << "\ttotal " << format(fmt.str().c_str(), sec_total) << "\n"; } else if (Load.C.cmd == MachO::LC_SEGMENT) { MachO::segment_command Seg = MachO->getSegmentLoadCommand(Load); + uint64_t Seg_vmsize = Seg.vmsize; outs() << "Segment " << Seg.segname << ": " - << format(fmt.str().c_str(), Seg.vmsize); + << format(fmt.str().c_str(), Seg_vmsize); if (DarwinLongFormat) - outs() << " (vmaddr 0x" << format("%" PRIx64, Seg.vmaddr) << " fileoff " + outs() << " (vmaddr 0x" << format("%" PRIx32, Seg.vmaddr) << " fileoff " << Seg.fileoff << ")"; outs() << "\n"; total += Seg.vmsize; @@ -186,9 +187,10 @@ static void PrintDarwinSectionSizes(MachOObjectFile *MachO) { << format("%.16s", &Sec.sectname) << "): "; else outs() << "\tSection " << format("%.16s", &Sec.sectname) << ": "; - outs() << format(fmt.str().c_str(), Sec.size); + uint64_t Sec_size = Sec.size; + outs() << format(fmt.str().c_str(), Sec_size); if (DarwinLongFormat) - outs() << " (addr 0x" << format("%" PRIx64, Sec.addr) << " offset " + outs() << " (addr 0x" << format("%" PRIx32, Sec.addr) << " offset " << Sec.offset << ")"; outs() << "\n"; sec_total += Sec.size; |