From 7df905954106fe2302df36d96e4952b736817298 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Thu, 3 Apr 2014 23:54:35 +0000 Subject: 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 --- lib/Object/MachOObjectFile.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'lib/Object') 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, -- cgit v1.2.3