OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef COURGETTE_DISASSEMBLER_ELF_32_X86_H_ | 5 #ifndef COURGETTE_DISASSEMBLER_ELF_32_X86_H_ |
6 #define COURGETTE_DISASSEMBLER_ELF_32_X86_H_ | 6 #define COURGETTE_DISASSEMBLER_ELF_32_X86_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "courgette/disassembler_elf_32.h" | 9 #include "courgette/disassembler_elf_32.h" |
10 #include "courgette/memory_allocator.h" | 10 #include "courgette/memory_allocator.h" |
11 #include "courgette/types_elf.h" | 11 #include "courgette/types_elf.h" |
12 | 12 |
13 namespace courgette { | 13 namespace courgette { |
14 | 14 |
15 class AssemblyProgram; | 15 class AssemblyProgram; |
16 | 16 |
17 class DisassemblerElf32X86 : public DisassemblerElf32 { | 17 class DisassemblerElf32X86 : public DisassemblerElf32 { |
18 public: | 18 public: |
19 explicit DisassemblerElf32X86(const void* start, size_t length); | 19 explicit DisassemblerElf32X86(const void* start, size_t length); |
20 | 20 |
21 virtual ExecutableType kind() { return EXE_ELF_32_X86; } | 21 virtual ExecutableType kind() { return EXE_ELF_32_X86; } |
22 | 22 |
23 virtual e_machine_values ElfEM() { return EM_386; } | 23 virtual e_machine_values ElfEM() { return EM_386; } |
24 | 24 |
25 protected: | 25 protected: |
26 | |
27 virtual CheckBool RelToRVA(Elf32_Rel rel, RVA* result) | 26 virtual CheckBool RelToRVA(Elf32_Rel rel, RVA* result) |
28 const WARN_UNUSED_RESULT; | 27 const WARN_UNUSED_RESULT; |
29 | 28 |
30 virtual CheckBool ParseRelocationSection( | 29 virtual CheckBool ParseRelocationSection( |
31 const Elf32_Shdr *section_header, | 30 const Elf32_Shdr *section_header, |
32 AssemblyProgram* program) WARN_UNUSED_RESULT; | 31 AssemblyProgram* program) WARN_UNUSED_RESULT; |
33 | 32 |
34 virtual CheckBool ParseRel32RelocsFromSection( | 33 virtual CheckBool ParseRel32RelocsFromSection( |
35 const Elf32_Shdr* section) WARN_UNUSED_RESULT; | 34 const Elf32_Shdr* section) WARN_UNUSED_RESULT; |
36 | 35 |
37 DISALLOW_COPY_AND_ASSIGN(DisassemblerElf32X86); | 36 DISALLOW_COPY_AND_ASSIGN(DisassemblerElf32X86); |
38 }; | 37 }; |
39 | 38 |
40 } // namespace courgette | 39 } // namespace courgette |
41 | 40 |
42 #endif // COURGETTE_DISASSEMBLER_ELF_32_X86_H_ | 41 #endif // COURGETTE_DISASSEMBLER_ELF_32_X86_H_ |
OLD | NEW |