From 7884c95c7e8441bc8f30ac7bd02db465af6e75cc Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Thu, 4 Jun 2015 15:01:05 +0000 Subject: Disassemble the start of sections even if there is no symbol there. We already handled a section with no symbols, extend that to also handle a section with symbols that don't include the section start. llvm-svn: 239039 --- llvm/tools/llvm-objdump/llvm-objdump.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'llvm/tools/llvm-objdump/llvm-objdump.cpp') diff --git a/llvm/tools/llvm-objdump/llvm-objdump.cpp b/llvm/tools/llvm-objdump/llvm-objdump.cpp index d03556c4615..58600f62f4d 100644 --- a/llvm/tools/llvm-objdump/llvm-objdump.cpp +++ b/llvm/tools/llvm-objdump/llvm-objdump.cpp @@ -809,11 +809,9 @@ static void DisassembleObject(const ObjectFile *Obj, bool InlineRelocs) { outs() << SegmentName << ","; outs() << name << ':'; - // If the section has no symbols just insert a dummy one and disassemble - // the whole section. - if (Symbols.empty()) - Symbols.push_back(std::make_pair(0, name)); - + // If the section has no symbol at the start, just insert a dummy one. + if (Symbols.empty() || Symbols[0].first != 0) + Symbols.insert(Symbols.begin(), std::make_pair(0, name)); SmallString<40> Comments; raw_svector_ostream CommentStream(Comments); -- cgit v1.2.3