diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2013-01-26 08:27:29 +0000 |
---|---|---|
committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2013-01-26 08:27:29 +0000 |
commit | 994754feea585ba4f088e0aed2e0b59cc77702bd (patch) | |
tree | b5b95d79a58a29a239cb070a4d8b398c3a726bf1 | |
parent | 1ae9e8b2783870ebf1c3353611acecef2d951495 (diff) | |
download | external_llvm-994754feea585ba4f088e0aed2e0b59cc77702bd.zip external_llvm-994754feea585ba4f088e0aed2e0b59cc77702bd.tar.gz external_llvm-994754feea585ba4f088e0aed2e0b59cc77702bd.tar.bz2 |
Object/RelocVisitor: Add minimal support, R_PPC64_ADDR32, for ppc64.
It fixes llvm-dwarfdump for ppc64-elf.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173566 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/Object/RelocVisitor.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/llvm/Object/RelocVisitor.h b/include/llvm/Object/RelocVisitor.h index f09055d..d17610a 100644 --- a/include/llvm/Object/RelocVisitor.h +++ b/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); + } }; } |