aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object/COFFObjectFile.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/Object/COFFObjectFile.cpp
parente6c0144208a4352c7c50616508081278c2ee5f88 (diff)
downloadllvm-806f00649090e81ed478441e3edcddaef1176ee0.zip
llvm-806f00649090e81ed478441e3edcddaef1176ee0.tar.gz
llvm-806f00649090e81ed478441e3edcddaef1176ee0.tar.bz2
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/Object/COFFObjectFile.cpp')
-rw-r--r--llvm/lib/Object/COFFObjectFile.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/Object/COFFObjectFile.cpp b/llvm/lib/Object/COFFObjectFile.cpp
index f5b49ab..bc5958d 100644
--- a/llvm/lib/Object/COFFObjectFile.cpp
+++ b/llvm/lib/Object/COFFObjectFile.cpp
@@ -712,13 +712,11 @@ error_code COFFObjectFile::getRelocationOffset(DataRefImpl Rel,
Res = toRel(Rel)->VirtualAddress;
return object_error::success;
}
-error_code COFFObjectFile::getRelocationSymbol(DataRefImpl Rel,
- SymbolRef &Res) const {
+symbol_iterator COFFObjectFile::getRelocationSymbol(DataRefImpl Rel) const {
const coff_relocation* R = toRel(Rel);
DataRefImpl Symb;
Symb.p = reinterpret_cast<uintptr_t>(SymbolTable + R->SymbolTableIndex);
- Res = SymbolRef(Symb, this);
- return object_error::success;
+ return symbol_iterator(SymbolRef(Symb, this));
}
error_code COFFObjectFile::getRelocationType(DataRefImpl Rel,
uint64_t &Res) const {