Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1882)

Unified Diff: courgette/disassembler_elf_32_x86.cc

Issue 2462993003: [Courgette] Refactor: Add and use Instruction*Receptor classes; call ParseFile() in 2 passes. (Closed)
Patch Set: Fix comments. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « courgette/disassembler_elf_32_x86.h ('k') | courgette/disassembler_win32.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: courgette/disassembler_elf_32_x86.cc
diff --git a/courgette/disassembler_elf_32_x86.cc b/courgette/disassembler_elf_32_x86.cc
index fc3c98c4bc8f899aa11aa0b88b16c07da9f79d57..a14475fc5b4019c7026932c067e595817611d68e 100644
--- a/courgette/disassembler_elf_32_x86.cc
+++ b/courgette/disassembler_elf_32_x86.cc
@@ -21,9 +21,9 @@ CheckBool DisassemblerElf32X86::TypedRVAX86::ComputeRelativeTarget(
}
CheckBool DisassemblerElf32X86::TypedRVAX86::EmitInstruction(
- AssemblyProgram* program,
- Label* label) {
- return program->EmitRel32(label);
+ Label* label,
+ InstructionReceptor* receptor) {
+ return receptor->EmitRel32(label);
}
uint16_t DisassemblerElf32X86::TypedRVAX86::op_size() const {
@@ -72,7 +72,7 @@ CheckBool DisassemblerElf32X86::RelToRVA(Elf32_Rel rel, RVA* result) const {
CheckBool DisassemblerElf32X86::ParseRelocationSection(
const Elf32_Shdr* section_header,
- AssemblyProgram* program) {
+ InstructionReceptor* receptor) const {
// We can reproduce the R_386_RELATIVE entries in one of the relocation table
// based on other information in the patch, given these conditions:
//
@@ -119,12 +119,12 @@ CheckBool DisassemblerElf32X86::ParseRelocationSection(
if (match) {
// Skip over relocation tables.
- if (!program->EmitElfRelocationInstruction())
+ if (!receptor->EmitElfRelocation())
return false;
file_offset += sizeof(Elf32_Rel) * abs32_locations_.size();
}
- return ParseSimpleRegion(file_offset, section_end, program);
+ return ParseSimpleRegion(file_offset, section_end, receptor);
}
CheckBool DisassemblerElf32X86::ParseRel32RelocsFromSection(
« no previous file with comments | « courgette/disassembler_elf_32_x86.h ('k') | courgette/disassembler_win32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698