summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86/MCTargetDesc/X86MachORelocationInfo.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-06-05 01:33:53 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-06-05 01:33:53 +0000
commit806f00649090e81ed478441e3edcddaef1176ee0 (patch)
treed568409a0c21e6b767feb6bdb9a1b27705505c71 /llvm/lib/Target/X86/MCTargetDesc/X86MachORelocationInfo.cpp
parente6c0144208a4352c7c50616508081278c2ee5f88 (diff)
downloadbcm5719-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/X86MachORelocationInfo.cpp')
-rw-r--r--llvm/lib/Target/X86/MCTargetDesc/X86MachORelocationInfo.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/llvm/lib/Target/X86/MCTargetDesc/X86MachORelocationInfo.cpp b/llvm/lib/Target/X86/MCTargetDesc/X86MachORelocationInfo.cpp
index a76cad555df..75b5acf5089 100644
--- a/llvm/lib/Target/X86/MCTargetDesc/X86MachORelocationInfo.cpp
+++ b/llvm/lib/Target/X86/MCTargetDesc/X86MachORelocationInfo.cpp
@@ -28,10 +28,10 @@ public:
const MachOObjectFile *Obj = cast<MachOObjectFile>(Rel.getObjectFile());
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);
+ StringRef SymName; SymI->getName(SymName);
+ uint64_t SymAddr; SymI->getAddress(SymAddr);
RelocationEntry RE = Obj->getRelocation(Rel.getRawDataRefImpl());
bool isPCRel = Obj->getAnyRelocationPCRel(RE);
@@ -86,12 +86,11 @@ public:
const MCExpr *LHS = MCSymbolRefExpr::Create(Sym, Ctx);
- SymbolRef RSymRef;
- RelNext.getSymbol(RSymRef);
+ symbol_iterator RSymI = RelNext.getSymbol();
uint64_t RSymAddr;
- RSymRef.getAddress(RSymAddr);
+ RSymI->getAddress(RSymAddr);
StringRef RSymName;
- RSymRef.getName(RSymName);
+ RSymI->getName(RSymName);
MCSymbol *RSym = Ctx.GetOrCreateSymbol(RSymName);
if (RSym->isVariable() == false)
OpenPOWER on IntegriCloud