mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-26 12:50:30 +00:00
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
This commit is contained in:
parent
3c711cad2a
commit
a4ac37168e
BIN
test/Object/Inputs/no-start-symbol.elf-x86_64
Normal file
BIN
test/Object/Inputs/no-start-symbol.elf-x86_64
Normal file
Binary file not shown.
9
test/Object/no-start-symbol.test
Normal file
9
test/Object/no-start-symbol.test
Normal file
@ -0,0 +1,9 @@
|
||||
RUN: llvm-objdump -d %p/Inputs/no-start-symbol.elf-x86_64 | FileCheck %s
|
||||
|
||||
Test that we disassemble the start of the section.
|
||||
|
||||
CHECK: Disassembly of section .text:
|
||||
CHECK-NEXT: .text:
|
||||
CHECK-NEXT: 0: 90 nop
|
||||
CHECK: foo:
|
||||
CHECK-NEXT: 1: 90 nop
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user