summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object/MachOObjectFile.cpp
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
commit7e91bc9e324c65b676d8926082edb8b409a6640f (patch)
treeef11f96d108e87d1b107489e1e075802422c8bb7 /llvm/lib/Object/MachOObjectFile.cpp
parent128b8111d7b6e7bb002b1867cc7a2fbf6b7d0ebd (diff)
downloadbcm5719-llvm-7e91bc9e324c65b676d8926082edb8b409a6640f.tar.gz
bcm5719-llvm-7e91bc9e324c65b676d8926082edb8b409a6640f.zip
Implement getRelocationAddress for MachO and ET_REL elf files.
With that, fix the symbolizer to work with any ELF file. llvm-svn: 205588
Diffstat (limited to 'llvm/lib/Object/MachOObjectFile.cpp')
-rw-r--r--llvm/lib/Object/MachOObjectFile.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/llvm/lib/Object/MachOObjectFile.cpp b/llvm/lib/Object/MachOObjectFile.cpp
index dd732aefb0d..7ce62eb2a44 100644
--- a/llvm/lib/Object/MachOObjectFile.cpp
+++ b/llvm/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,
OpenPOWER on IntegriCloud