| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 if (symbol != 0) | 284 if (symbol != 0) |
| 285 return false; | 285 return false; |
| 286 | 286 |
| 287 // This is a basic ABS32 relocation address | 287 // This is a basic ABS32 relocation address |
| 288 *result = rel.r_offset; | 288 *result = rel.r_offset; |
| 289 return true; | 289 return true; |
| 290 | 290 |
| 291 default: | 291 default: |
| 292 return false; | 292 return false; |
| 293 } | 293 } |
| 294 | |
| 295 return false; | |
| 296 } | 294 } |
| 297 | 295 |
| 298 CheckBool DisassemblerElf32ARM::ParseRelocationSection( | 296 CheckBool DisassemblerElf32ARM::ParseRelocationSection( |
| 299 const Elf32_Shdr *section_header, | 297 const Elf32_Shdr *section_header, |
| 300 AssemblyProgram* program) { | 298 AssemblyProgram* program) { |
| 301 // This method compresses a contiguous stretch of R_ARM_RELATIVE | 299 // This method compresses a contiguous stretch of R_ARM_RELATIVE |
| 302 // entries in the relocation table with a Courgette relocation table | 300 // entries in the relocation table with a Courgette relocation table |
| 303 // instruction. It skips any entries at the beginning that appear | 301 // instruction. It skips any entries at the beginning that appear |
| 304 // in a section that Courgette doesn't support, e.g. INIT. | 302 // in a section that Courgette doesn't support, e.g. INIT. |
| 305 // Specifically, the entries should be | 303 // Specifically, the entries should be |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 481 // Move 2 bytes at a time, but track 32-bit boundaries | 479 // Move 2 bytes at a time, but track 32-bit boundaries |
| 482 p += 2; | 480 p += 2; |
| 483 on_32bit = ((on_32bit + 1) % 2) != 0; | 481 on_32bit = ((on_32bit + 1) % 2) != 0; |
| 484 } | 482 } |
| 485 } | 483 } |
| 486 | 484 |
| 487 return true; | 485 return true; |
| 488 } | 486 } |
| 489 | 487 |
| 490 } // namespace courgette | 488 } // namespace courgette |
| OLD | NEW |