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
This commit is contained in:
Rafael Espindola
2014-04-03 23:54:35 +00:00
parent 5ca1f95419
commit 7df9059541
6 changed files with 44 additions and 37 deletions
+9 -1
View File
@@ -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,