diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-06-05 01:33:53 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-06-05 01:33:53 +0000 |
commit | 806f00649090e81ed478441e3edcddaef1176ee0 (patch) | |
tree | d568409a0c21e6b767feb6bdb9a1b27705505c71 /llvm/lib/Target/X86/MCTargetDesc/X86ELFRelocationInfo.cpp | |
parent | e6c0144208a4352c7c50616508081278c2ee5f88 (diff) | |
download | bcm5719-llvm-806f00649090e81ed478441e3edcddaef1176ee0.tar.gz bcm5719-llvm-806f00649090e81ed478441e3edcddaef1176ee0.zip |
Handle relocations that don't point to symbols.
In ELF (as in MachO), not all relocations point to symbols. Represent this
properly by using a symbol_iterator instead of a SymbolRef. Update llvm-readobj
ELF's dumper to handle relocatios without symbols.
llvm-svn: 183284
Diffstat (limited to 'llvm/lib/Target/X86/MCTargetDesc/X86ELFRelocationInfo.cpp')
-rw-r--r-- | llvm/lib/Target/X86/MCTargetDesc/X86ELFRelocationInfo.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Target/X86/MCTargetDesc/X86ELFRelocationInfo.cpp b/llvm/lib/Target/X86/MCTargetDesc/X86ELFRelocationInfo.cpp index 917c37d2ca5..8f4ab4673d5 100644 --- a/llvm/lib/Target/X86/MCTargetDesc/X86ELFRelocationInfo.cpp +++ b/llvm/lib/Target/X86/MCTargetDesc/X86ELFRelocationInfo.cpp @@ -27,11 +27,11 @@ public: const MCExpr *createExprForRelocation(RelocationRef Rel) { uint64_t RelType; Rel.getType(RelType); - SymbolRef SymRef; Rel.getSymbol(SymRef); + symbol_iterator SymI = Rel.getSymbol(); - StringRef SymName; SymRef.getName(SymName); - uint64_t SymAddr; SymRef.getAddress(SymAddr); - uint64_t SymSize; SymRef.getSize(SymSize); + StringRef SymName; SymI->getName(SymName); + uint64_t SymAddr; SymI->getAddress(SymAddr); + uint64_t SymSize; SymI->getSize(SymSize); int64_t Addend; getELFRelocationAddend(Rel, Addend); MCSymbol *Sym = Ctx.GetOrCreateSymbol(SymName); |