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