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

Unified Diff: courgette/disassembler_elf_32.cc

Issue 2583373002: [Courgette] Simple AssemblyProgram and Disassembler cleanups. (Closed)
Patch Set: Tune up header inclusion. Created 3 years, 11 months 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.h ('k') | courgette/disassembler_elf_32_x86_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: courgette/disassembler_elf_32.cc
diff --git a/courgette/disassembler_elf_32.cc b/courgette/disassembler_elf_32.cc
index a668401ba06287fbf2788fcd799da104eb70755d..b1c3f0bde06a412c1d1776b815f3bfacce8de188 100644
--- a/courgette/disassembler_elf_32.cc
+++ b/courgette/disassembler_elf_32.cc
@@ -6,7 +6,6 @@
#include <algorithm>
#include <iterator>
-#include <utility>
#include "base/bind.h"
#include "base/logging.h"
@@ -164,23 +163,20 @@ bool DisassemblerElf32::ParseHeader() {
return Good();
}
-bool DisassemblerElf32::Disassemble(AssemblyProgram* target) {
+bool DisassemblerElf32::Disassemble(AssemblyProgram* program) {
if (!ok())
return false;
- // The Image Base is always 0 for ELF Executables
- target->set_image_base(0);
-
if (!ParseAbs32Relocs())
return false;
if (!ParseRel32RelocsFromSections()) // Does not sort rel32 locations.
return false;
- PrecomputeLabels(target);
- RemoveUnusedRel32Locations(target);
+ PrecomputeLabels(program);
+ RemoveUnusedRel32Locations(program);
- if (!target->GenerateInstructions(
+ if (!program->GenerateInstructions(
base::Bind(&DisassemblerElf32::ParseFile, base::Unretained(this)))) {
return false;
}
@@ -192,7 +188,7 @@ bool DisassemblerElf32::Disassemble(AssemblyProgram* target) {
DCHECK(rel32_locations_.empty() ||
rel32_locations_.back()->rva() != kUnassignedRVA);
- target->DefaultAssignIndexes();
+ program->DefaultAssignIndexes();
return true;
}
« no previous file with comments | « courgette/disassembler_elf_32.h ('k') | courgette/disassembler_elf_32_x86_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698