summaryrefslogtreecommitdiff
path: root/include/llvm/Object/RelocVisitor.h
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2013-01-26 08:27:36 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2013-01-26 08:27:36 +0000
commit3802947dec01dcf95d1b4b6545e88e549744e2b1 (patch)
tree5a8b6a010f4e819c8271a4505a65269a6a38a380 /include/llvm/Object/RelocVisitor.h
parent994754feea585ba4f088e0aed2e0b59cc77702bd (diff)
downloadllvm-3802947dec01dcf95d1b4b6545e88e549744e2b1.tar.gz
llvm-3802947dec01dcf95d1b4b6545e88e549744e2b1.tar.bz2
llvm-3802947dec01dcf95d1b4b6545e88e549744e2b1.tar.xz
Object/RelocVisitor: Add minimal support, R_MIPS_32, for mips.
It fixes llvm-dwarfdump for mips and mipsel. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173567 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Object/RelocVisitor.h')
-rw-r--r--include/llvm/Object/RelocVisitor.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/llvm/Object/RelocVisitor.h b/include/llvm/Object/RelocVisitor.h
index d17610a6c4..edac89914d 100644
--- a/include/llvm/Object/RelocVisitor.h
+++ b/include/llvm/Object/RelocVisitor.h
@@ -84,6 +84,14 @@ public:
HasError = true;
return RelocToApply();
}
+ } else if (FileFormat == "ELF32-mips") {
+ switch (RelocType) {
+ case llvm::ELF::R_MIPS_32:
+ return visitELF_MIPS_32(R, Value);
+ default:
+ HasError = true;
+ return RelocToApply();
+ }
}
HasError = true;
return RelocToApply();
@@ -156,6 +164,14 @@ private:
uint32_t Res = (Value + Addend) & 0xFFFFFFFF;
return RelocToApply(Res, 4);
}
+
+ /// MIPS ELF
+ RelocToApply visitELF_MIPS_32(RelocationRef R, uint64_t Value) {
+ int64_t Addend;
+ R.getAdditionalInfo(Addend);
+ uint32_t Res = (Value + Addend) & 0xFFFFFFFF;
+ return RelocToApply(Res, 4);
+ }
};
}