diff options
author | paulgazz@chromium.org <paulgazz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-23 21:18:19 +0000 |
---|---|---|
committer | paulgazz@chromium.org <paulgazz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-23 21:18:19 +0000 |
commit | 144c8e950add26b44467784568d0ca5387a1047d (patch) | |
tree | 74c55e162f2128d67552a654d1cc57fb21b91afe /courgette/disassembler_elf_32_x86.h | |
parent | 63d353f9d7a70dc827bad25e0932967711d595f3 (diff) | |
download | chromium_src-144c8e950add26b44467784568d0ca5387a1047d.zip chromium_src-144c8e950add26b44467784568d0ca5387a1047d.tar.gz chromium_src-144c8e950add26b44467784568d0ca5387a1047d.tar.bz2 |
Added a TypedRVA to track what kind of branch instruction is used for
the jump and compute the target RVA accordingly. Also updated the
unit test to use TypedRVA and check that only X86 RVAs are found by
the X86 "disassembler".
BUG=258645
Review URL: https://chromiumcodereview.appspot.com/18055007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@213220 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'courgette/disassembler_elf_32_x86.h')
-rw-r--r-- | courgette/disassembler_elf_32_x86.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/courgette/disassembler_elf_32_x86.h b/courgette/disassembler_elf_32_x86.h index 28de7cf..5e7cdff 100644 --- a/courgette/disassembler_elf_32_x86.h +++ b/courgette/disassembler_elf_32_x86.h @@ -16,6 +16,17 @@ class AssemblyProgram; class DisassemblerElf32X86 : public DisassemblerElf32 { public: + class TypedRVAX86 : public TypedRVA { + public: + explicit TypedRVAX86(RVA rva) : TypedRVA(rva) { + } + + virtual CheckBool ComputeRelativeTarget(const uint8* op_pointer) OVERRIDE { + set_relative_target(Read32LittleEndian(op_pointer) + 4); + return true; + } + }; + explicit DisassemblerElf32X86(const void* start, size_t length); virtual ExecutableType kind() { return EXE_ELF_32_X86; } |