summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-readobj
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-10-15 18:55:30 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-10-15 18:55:30 +0000
commita74b5e682361e336f56cc3fdbeb05c8183c089e1 (patch)
tree11e01d2e892ddc6be7638d29e6d4cf28da48edfa /llvm/tools/llvm-readobj
parentb0c5b8f22879ad8445962d60b3d479b10b4d9d56 (diff)
downloadbcm5719-llvm-a74b5e682361e336f56cc3fdbeb05c8183c089e1.tar.gz
bcm5719-llvm-a74b5e682361e336f56cc3fdbeb05c8183c089e1.zip
Correctly handle references to section symbols.
When processing assembly like .long .text we were creating a new undefined symbol .text. GAS on the other hand would handle that as a reference to the .text section. This patch implements that by creating the section symbols earlier so that they are visible during asm parsing. The patch also updates llvm-readobj to print the symbol number in the relocation dump so that the test can differentiate between two sections with the same name. llvm-svn: 219829
Diffstat (limited to 'llvm/tools/llvm-readobj')
-rw-r--r--llvm/tools/llvm-readobj/ELFDumper.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/tools/llvm-readobj/ELFDumper.cpp b/llvm/tools/llvm-readobj/ELFDumper.cpp
index 6da3318c931..d68c78682d2 100644
--- a/llvm/tools/llvm-readobj/ELFDumper.cpp
+++ b/llvm/tools/llvm-readobj/ELFDumper.cpp
@@ -676,7 +676,8 @@ void ELFDumper<ELFT>::printRelocation(const Elf_Shdr *Sec,
DictScope Group(W, "Relocation");
W.printHex("Offset", Rel.r_offset);
W.printNumber("Type", RelocName, (int)Rel.getType(Obj->isMips64EL()));
- W.printString("Symbol", SymbolName.size() > 0 ? SymbolName : "-");
+ W.printNumber("Symbol", SymbolName.size() > 0 ? SymbolName : "-",
+ Rel.getSymbol(Obj->isMips64EL()));
W.printHex("Addend", Rel.r_addend);
} else {
raw_ostream& OS = W.startLine();
OpenPOWER on IntegriCloud