OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_x86.h" | 5 #include "courgette/disassembler_elf_32_x86.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 | 99 |
100 uint32_t section_relocs_count = | 100 uint32_t section_relocs_count = |
101 section_header->sh_size / section_header->sh_entsize; | 101 section_header->sh_size / section_header->sh_entsize; |
102 | 102 |
103 if (abs32_locations_.empty()) | 103 if (abs32_locations_.empty()) |
104 match = false; | 104 match = false; |
105 | 105 |
106 if (abs32_locations_.size() > section_relocs_count) | 106 if (abs32_locations_.size() > section_relocs_count) |
107 match = false; | 107 match = false; |
108 | 108 |
109 std::vector<RVA>::iterator reloc_iter = abs32_locations_.begin(); | 109 std::vector<RVA>::const_iterator reloc_iter = abs32_locations_.begin(); |
110 | 110 |
111 while (match && (reloc_iter != abs32_locations_.end())) { | 111 while (match && (reloc_iter != abs32_locations_.end())) { |
112 if (section_relocs_iter->r_info != R_386_RELATIVE || | 112 if (section_relocs_iter->r_info != R_386_RELATIVE || |
113 section_relocs_iter->r_offset != *reloc_iter) { | 113 section_relocs_iter->r_offset != *reloc_iter) { |
114 match = false; | 114 match = false; |
115 } | 115 } |
116 ++section_relocs_iter; | 116 ++section_relocs_iter; |
117 ++reloc_iter; | 117 ++reloc_iter; |
118 } | 118 } |
119 | 119 |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 continue; | 193 continue; |
194 } | 194 } |
195 } | 195 } |
196 p += 1; | 196 p += 1; |
197 } | 197 } |
198 | 198 |
199 return true; | 199 return true; |
200 } | 200 } |
201 | 201 |
202 } // namespace courgette | 202 } // namespace courgette |
OLD | NEW |