summaryrefslogtreecommitdiffstats
path: root/courgette/disassembler_elf_32_arm.h
diff options
context:
space:
mode:
authorpaulgazz@chromium.org <paulgazz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-01 00:11:24 +0000
committerpaulgazz@chromium.org <paulgazz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-01 00:11:24 +0000
commit2b637b698c76e43c9cf729e868cf7618d5327cc8 (patch)
tree91aeaa633d613ec7fa34a1073eb48bf26af7a8c7 /courgette/disassembler_elf_32_arm.h
parent1c9bf75724817afb7cfa9b3bfdf917b01b8a667f (diff)
downloadchromium_src-2b637b698c76e43c9cf729e868cf7618d5327cc8.zip
chromium_src-2b637b698c76e43c9cf729e868cf7618d5327cc8.tar.gz
chromium_src-2b637b698c76e43c9cf729e868cf7618d5327cc8.tar.bz2
Support for ARM 32-bit ELF binaries in Courgette
Notes for reviewers: dgarrett: courgette correctness, ARM benchan: style, correctness BUG=258640,258645,258653 Review URL: https://chromiumcodereview.appspot.com/20099004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@214873 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'courgette/disassembler_elf_32_arm.h')
-rw-r--r--courgette/disassembler_elf_32_arm.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/courgette/disassembler_elf_32_arm.h b/courgette/disassembler_elf_32_arm.h
index 57e750e..08b8db8 100644
--- a/courgette/disassembler_elf_32_arm.h
+++ b/courgette/disassembler_elf_32_arm.h
@@ -18,6 +18,8 @@ enum ARM_RVA {
ARM_OFF8,
ARM_OFF11,
ARM_OFF24,
+ ARM_OFF25,
+ ARM_OFF21,
};
class DisassemblerElf32ARM : public DisassemblerElf32 {
@@ -26,10 +28,22 @@ class DisassemblerElf32ARM : public DisassemblerElf32 {
public:
TypedRVAARM(ARM_RVA type, RVA rva) : TypedRVA(rva), type_(type) { }
- virtual CheckBool ComputeRelativeTarget(const uint8* op_pointer) OVERRIDE;
+ uint16 c_op() const {
+ return c_op_;
+ }
+
+ virtual CheckBool ComputeRelativeTarget(const uint8* op_pointer);
+
+ virtual CheckBool EmitInstruction(AssemblyProgram* program,
+ RVA target_rva);
+
+ virtual uint16 op_size() const;
private:
ARM_RVA type_;
+
+ uint16 c_op_; // set by ComputeRelativeTarget()
+ const uint8* arm_op_;
};
explicit DisassemblerElf32ARM(const void* start, size_t length);
@@ -38,6 +52,12 @@ class DisassemblerElf32ARM : public DisassemblerElf32 {
virtual e_machine_values ElfEM() { return EM_ARM; }
+ static CheckBool Compress(ARM_RVA type, uint32 arm_op, RVA rva,
+ uint16* c_op /* out */, uint32* addr /* out */);
+
+ static CheckBool Decompress(ARM_RVA type, uint16 c_op, uint32 addr,
+ uint32* arm_op /* out */);
+
protected:
virtual CheckBool RelToRVA(Elf32_Rel rel, RVA* result)