OLD | NEW |
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 <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 set_relative_target(relative_target); | 292 set_relative_target(relative_target); |
293 return ret; | 293 return ret; |
294 } | 294 } |
295 default: | 295 default: |
296 return false; | 296 return false; |
297 } | 297 } |
298 } | 298 } |
299 | 299 |
300 CheckBool DisassemblerElf32ARM::TypedRVAARM::EmitInstruction( | 300 CheckBool DisassemblerElf32ARM::TypedRVAARM::EmitInstruction( |
301 AssemblyProgram* program, | 301 AssemblyProgram* program, |
302 RVA target_rva) { | 302 Label* label) { |
303 return program->EmitRel32ARM(c_op(), | 303 return program->EmitRel32ARM(c_op(), label, arm_op_, op_size()); |
304 program->FindOrMakeRel32Label(target_rva), | |
305 arm_op_, | |
306 op_size()); | |
307 } | 304 } |
308 | 305 |
309 DisassemblerElf32ARM::DisassemblerElf32ARM(const void* start, size_t length) | 306 DisassemblerElf32ARM::DisassemblerElf32ARM(const void* start, size_t length) |
310 : DisassemblerElf32(start, length) { | 307 : DisassemblerElf32(start, length) { |
311 } | 308 } |
312 | 309 |
313 // Convert an ELF relocation struction into an RVA. | 310 // Convert an ELF relocation struction into an RVA. |
314 CheckBool DisassemblerElf32ARM::RelToRVA(Elf32_Rel rel, RVA* result) const { | 311 CheckBool DisassemblerElf32ARM::RelToRVA(Elf32_Rel rel, RVA* result) const { |
315 // The rightmost byte of r_info is the type. | 312 // The rightmost byte of r_info is the type. |
316 elf32_rel_arm_type_values type = | 313 elf32_rel_arm_type_values type = |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 // Move 2 bytes at a time, but track 32-bit boundaries | 520 // Move 2 bytes at a time, but track 32-bit boundaries |
524 p += 2; | 521 p += 2; |
525 on_32bit = ((on_32bit + 1) % 2) != 0; | 522 on_32bit = ((on_32bit + 1) % 2) != 0; |
526 } | 523 } |
527 } | 524 } |
528 | 525 |
529 return true; | 526 return true; |
530 } | 527 } |
531 | 528 |
532 } // namespace courgette | 529 } // namespace courgette |
OLD | NEW |