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

Side by Side Diff: courgette/disassembler_win32_x86.cc

Issue 8477045: Add Elf 32 Support to Courgette. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Remove debug printf present by mistake. Created 9 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « courgette/disassembler_elf_32_x86_unittest.cc ('k') | courgette/encode_decode_unittest.cc » ('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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_win32_x86.h" 5 #include "courgette/disassembler_win32_x86.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 555
556 const uint8* p = start_pointer; 556 const uint8* p = start_pointer;
557 557
558 while (ok && p < end_pointer) { 558 while (ok && p < end_pointer) {
559 RVA current_rva = static_cast<RVA>(p - adjust_pointer_to_rva); 559 RVA current_rva = static_cast<RVA>(p - adjust_pointer_to_rva);
560 560
561 // The base relocation table is usually in the .relocs section, but it could 561 // The base relocation table is usually in the .relocs section, but it could
562 // actually be anywhere. Make sure we skip it because we will regenerate it 562 // actually be anywhere. Make sure we skip it because we will regenerate it
563 // during assembly. 563 // during assembly.
564 if (current_rva == relocs_start_rva) { 564 if (current_rva == relocs_start_rva) {
565 ok = program->EmitMakeRelocsInstruction(); 565 ok = program->EmitPeRelocsInstruction();
566 if (!ok) 566 if (!ok)
567 break; 567 break;
568 uint32 relocs_size = base_relocation_table().size_; 568 uint32 relocs_size = base_relocation_table().size_;
569 if (relocs_size) { 569 if (relocs_size) {
570 p += relocs_size; 570 p += relocs_size;
571 continue; 571 continue;
572 } 572 }
573 } 573 }
574 574
575 while (abs32_pos != abs32_locations_.end() && *abs32_pos < current_rva) 575 while (abs32_pos != abs32_locations_.end() && *abs32_pos < current_rva)
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
726 directory->size_ = static_cast<uint32>(size); 726 directory->size_ = static_cast<uint32>(size);
727 return true; 727 return true;
728 } else { 728 } else {
729 directory->address_ = 0; 729 directory->address_ = 0;
730 directory->size_ = 0; 730 directory->size_ = 0;
731 return true; 731 return true;
732 } 732 }
733 } 733 }
734 734
735 } // namespace courgette 735 } // namespace courgette
OLDNEW
« no previous file with comments | « courgette/disassembler_elf_32_x86_unittest.cc ('k') | courgette/encode_decode_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698