summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-objdump/llvm-objdump.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2015-06-04 15:01:05 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2015-06-04 15:01:05 +0000
commit7884c95c7e8441bc8f30ac7bd02db465af6e75cc (patch)
tree4ba01bb0a304735bb9915977e9dad8a854518524 /llvm/tools/llvm-objdump/llvm-objdump.cpp
parentf08fadfe2b9bc752745192f3d3f7fa61254cf0d8 (diff)
downloadbcm5719-llvm-7884c95c7e8441bc8f30ac7bd02db465af6e75cc.tar.gz
bcm5719-llvm-7884c95c7e8441bc8f30ac7bd02db465af6e75cc.zip
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
Diffstat (limited to 'llvm/tools/llvm-objdump/llvm-objdump.cpp')
-rw-r--r--llvm/tools/llvm-objdump/llvm-objdump.cpp8
1 files changed, 3 insertions, 5 deletions
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);
OpenPOWER on IntegriCloud