mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 19:23:23 +01:00
llvm-objdump: Fix dumping of multiple symbols with the same address.
This happens in COFF because there is a symbol for the beginning of each section. llvm-svn: 141885
This commit is contained in:
parent
9a10012151
commit
fa3f63c14a
@ -234,7 +234,18 @@ static void DisassembleObject(const ObjectFile *Obj) {
|
|||||||
// Disassemble symbol by symbol.
|
// Disassemble symbol by symbol.
|
||||||
for (unsigned si = 0, se = Symbols.size(); si != se; ++si) {
|
for (unsigned si = 0, se = Symbols.size(); si != se; ++si) {
|
||||||
uint64_t Start = Symbols[si].first;
|
uint64_t Start = Symbols[si].first;
|
||||||
uint64_t End = si == se-1 ? SectSize : Symbols[si + 1].first - 1;
|
uint64_t End;
|
||||||
|
// The end is either the size of the section or the beginning of the next
|
||||||
|
// symbol.
|
||||||
|
if (si == se - 1)
|
||||||
|
End = SectSize;
|
||||||
|
// Make sure this symbol takes up space.
|
||||||
|
else if (Symbols[si + 1].first != Start)
|
||||||
|
End = Symbols[si + 1].first - 1;
|
||||||
|
else
|
||||||
|
// This symbol has the same address as the next symbol. Skip it.
|
||||||
|
continue;
|
||||||
|
|
||||||
outs() << '\n' << Symbols[si].second << ":\n";
|
outs() << '\n' << Symbols[si].second << ":\n";
|
||||||
|
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
|
Loading…
Reference in New Issue
Block a user