Change getRelocationAdditionalInfo to be ELF only.

It was only implemented for ELF where it collected the Addend, so this
patch also renames it to getRelocationAddend.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181502 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2013-05-09 03:39:05 +00:00
parent c496875f0c
commit 167957fa09
10 changed files with 65 additions and 59 deletions

View File

@ -579,7 +579,7 @@ void ELFDumper<ELFT>::printRelocation(section_iterator Sec,
uint64_t Offset;
uint64_t RelocType;
SmallString<32> RelocName;
int64_t Info;
int64_t Addend;
StringRef SymbolName;
SymbolRef Symbol;
if (Obj->getElfHeader()->e_type == ELF::ET_REL){
@ -589,7 +589,7 @@ void ELFDumper<ELFT>::printRelocation(section_iterator Sec,
}
if (error(RelI->getType(RelocType))) return;
if (error(RelI->getTypeName(RelocName))) return;
if (error(RelI->getAdditionalInfo(Info))) return;
if (error(getELFRelocationAddend(*RelI, Addend))) return;
if (error(RelI->getSymbol(Symbol))) return;
if (error(Symbol.getName(SymbolName))) return;
@ -598,13 +598,13 @@ void ELFDumper<ELFT>::printRelocation(section_iterator Sec,
W.printHex("Offset", Offset);
W.printNumber("Type", RelocName, RelocType);
W.printString("Symbol", SymbolName.size() > 0 ? SymbolName : "-");
W.printHex("Info", Info);
W.printHex("Addend", Addend);
} else {
raw_ostream& OS = W.startLine();
OS << W.hex(Offset)
<< " " << RelocName
<< " " << (SymbolName.size() > 0 ? SymbolName : "-")
<< " " << W.hex(Info)
<< " " << W.hex(Addend)
<< "\n";
}
}