Index: llvm/tools/llvm-objdump/llvm-objdump.cpp =================================================================== --- llvm/tools/llvm-objdump/llvm-objdump.cpp +++ llvm/tools/llvm-objdump/llvm-objdump.cpp @@ -1224,6 +1224,9 @@ SmallString<40> Comments; raw_svector_ostream CommentStream(Comments); + SmallString<128> InstString; + raw_svector_ostream InstStringStream(InstString); + ArrayRef Bytes = arrayRefFromStringRef( unwrapOrError(Section.getContents(), Obj->getFileName())); @@ -1383,9 +1386,10 @@ PIP.printInst( *IP, Disassembled ? &Inst : nullptr, Bytes.slice(Index, Size), - {SectionAddr + Index + VMAAdjustment, Section.getIndex()}, outs(), - "", *STI, &SP, &Rels); - outs() << CommentStream.str(); + {SectionAddr + Index + VMAAdjustment, Section.getIndex()}, + InstStringStream, "", *STI, &SP, &Rels); + outs() << InstStringStream.str() << CommentStream.str(); + InstString.clear(); Comments.clear(); // Try to resolve the target of a call, tail call, etc. to a specific