summaryrefslogtreecommitdiff
path: root/lib/Object
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-04-03 23:54:35 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-04-03 23:54:35 +0000
commit7df905954106fe2302df36d96e4952b736817298 (patch)
tree12b8012501c0a94fadad86472c55c5f4eafdc4ac /lib/Object
parent5ca1f954193c8cfe9efa53c888746abbb8edbbbc (diff)
downloadllvm-7df905954106fe2302df36d96e4952b736817298.tar.gz
llvm-7df905954106fe2302df36d96e4952b736817298.tar.bz2
llvm-7df905954106fe2302df36d96e4952b736817298.tar.xz
Implement getRelocationAddress for MachO and ET_REL elf files.
With that, fix the symbolizer to work with any ELF file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205588 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Object')
-rw-r--r--lib/Object/MachOObjectFile.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/Object/MachOObjectFile.cpp b/lib/Object/MachOObjectFile.cpp
index dd732aefb0..7ce62eb2a4 100644
--- a/lib/Object/MachOObjectFile.cpp
+++ b/lib/Object/MachOObjectFile.cpp
@@ -784,7 +784,15 @@ void MachOObjectFile::moveRelocationNext(DataRefImpl &Rel) const {
error_code
MachOObjectFile::getRelocationAddress(DataRefImpl Rel, uint64_t &Res) const {
- report_fatal_error("getRelocationAddress not implemented in MachOObjectFile");
+ MachO::any_relocation_info RE = getRelocation(Rel);
+ uint64_t Offset = getAnyRelocationAddress(RE);
+
+ DataRefImpl Sec;
+ Sec.d.a = Rel.d.a;
+ uint64_t SecAddress;
+ getSectionAddress(Sec, SecAddress);
+ Res = SecAddress + Offset;
+ return object_error::success;
}
error_code MachOObjectFile::getRelocationOffset(DataRefImpl Rel,