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

Side by Side Diff: courgette/disassembler_elf_32_arm.cc

Issue 2055343002: Courgette: Add static method QuickDetect() to optimize program detection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sync Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « courgette/disassembler_elf_32_arm.h ('k') | courgette/disassembler_elf_32_x86.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "courgette/disassembler_elf_32_arm.h" 5 #include "courgette/disassembler_elf_32_arm.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 return false; 297 return false;
298 } 298 }
299 } 299 }
300 300
301 CheckBool DisassemblerElf32ARM::TypedRVAARM::EmitInstruction( 301 CheckBool DisassemblerElf32ARM::TypedRVAARM::EmitInstruction(
302 AssemblyProgram* program, 302 AssemblyProgram* program,
303 Label* label) { 303 Label* label) {
304 return program->EmitRel32ARM(c_op(), label, arm_op_, op_size()); 304 return program->EmitRel32ARM(c_op(), label, arm_op_, op_size());
305 } 305 }
306 306
307 DisassemblerElf32ARM::DisassemblerElf32ARM(const void* start, size_t length) 307 DisassemblerElf32ARM::DisassemblerElf32ARM(const uint8_t* start, size_t length)
308 : DisassemblerElf32(start, length) { 308 : DisassemblerElf32(start, length) {}
309 }
310 309
311 // Convert an ELF relocation struction into an RVA. 310 // Convert an ELF relocation struction into an RVA.
312 CheckBool DisassemblerElf32ARM::RelToRVA(Elf32_Rel rel, RVA* result) const { 311 CheckBool DisassemblerElf32ARM::RelToRVA(Elf32_Rel rel, RVA* result) const {
313 // The rightmost byte of r_info is the type. 312 // The rightmost byte of r_info is the type.
314 elf32_rel_arm_type_values type = 313 elf32_rel_arm_type_values type =
315 static_cast<elf32_rel_arm_type_values>(rel.r_info & 0xFF); 314 static_cast<elf32_rel_arm_type_values>(rel.r_info & 0xFF);
316 315
317 // The other 3 bytes of r_info are the symbol. 316 // The other 3 bytes of r_info are the symbol.
318 uint32_t symbol = rel.r_info >> 8; 317 uint32_t symbol = rel.r_info >> 8;
319 318
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 // Move 2 bytes at a time, but track 32-bit boundaries 520 // Move 2 bytes at a time, but track 32-bit boundaries
522 p += 2; 521 p += 2;
523 on_32bit = ((on_32bit + 1) % 2) != 0; 522 on_32bit = ((on_32bit + 1) % 2) != 0;
524 } 523 }
525 } 524 }
526 525
527 return true; 526 return true;
528 } 527 }
529 528
530 } // namespace courgette 529 } // namespace courgette
OLDNEW
« no previous file with comments | « courgette/disassembler_elf_32_arm.h ('k') | courgette/disassembler_elf_32_x86.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698