From: NAKAMURA Takumi Date: Sat, 26 Jan 2013 08:27:29 +0000 (+0000) Subject: Object/RelocVisitor: Add minimal support, R_PPC64_ADDR32, for ppc64. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3ba23555dea36cbb185cc41f77f06cc847b311c6;p=platform%2Fupstream%2Fllvm.git Object/RelocVisitor: Add minimal support, R_PPC64_ADDR32, for ppc64. It fixes llvm-dwarfdump for ppc64-elf. llvm-svn: 173566 --- diff --git a/llvm/include/llvm/Object/RelocVisitor.h b/llvm/include/llvm/Object/RelocVisitor.h index f09055d..d17610a 100644 --- a/llvm/include/llvm/Object/RelocVisitor.h +++ b/llvm/include/llvm/Object/RelocVisitor.h @@ -76,6 +76,14 @@ public: HasError = true; return RelocToApply(); } + } else if (FileFormat == "ELF64-ppc64") { + switch (RelocType) { + case llvm::ELF::R_PPC64_ADDR32: + return visitELF_PPC64_ADDR32(R, Value); + default: + HasError = true; + return RelocToApply(); + } } HasError = true; return RelocToApply(); @@ -140,6 +148,14 @@ private: int32_t Res = (Value + Addend) & 0xFFFFFFFF; return RelocToApply(Res, 4); } + + /// PPC64 ELF + RelocToApply visitELF_PPC64_ADDR32(RelocationRef R, uint64_t Value) { + int64_t Addend; + R.getAdditionalInfo(Addend); + uint32_t Res = (Value + Addend) & 0xFFFFFFFF; + return RelocToApply(Res, 4); + } }; }