OLD | NEW |
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 #ifndef COURGETTE_ASSEMBLY_PROGRAM_H_ | 5 #ifndef COURGETTE_ASSEMBLY_PROGRAM_H_ |
6 #define COURGETTE_ASSEMBLY_PROGRAM_H_ | 6 #define COURGETTE_ASSEMBLY_PROGRAM_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 class AssemblyProgram { | 62 class AssemblyProgram { |
63 public: | 63 public: |
64 AssemblyProgram(); | 64 AssemblyProgram(); |
65 ~AssemblyProgram(); | 65 ~AssemblyProgram(); |
66 | 66 |
67 void set_image_base(uint64 image_base) { image_base_ = image_base; } | 67 void set_image_base(uint64 image_base) { image_base_ = image_base; } |
68 | 68 |
69 // Instructions will be assembled in the order they are emitted. | 69 // Instructions will be assembled in the order they are emitted. |
70 | 70 |
71 // Generates an entire base relocation table. | 71 // Generates an entire base relocation table. |
72 CheckBool EmitMakeRelocsInstruction() WARN_UNUSED_RESULT; | 72 CheckBool EmitPeRelocsInstruction() WARN_UNUSED_RESULT; |
| 73 |
| 74 // Generates an ELF style relocation table. |
| 75 CheckBool EmitElfRelocationInstruction() WARN_UNUSED_RESULT; |
73 | 76 |
74 // Following instruction will be assembled at address 'rva'. | 77 // Following instruction will be assembled at address 'rva'. |
75 CheckBool EmitOriginInstruction(RVA rva) WARN_UNUSED_RESULT; | 78 CheckBool EmitOriginInstruction(RVA rva) WARN_UNUSED_RESULT; |
76 | 79 |
77 // Generates a single byte of data or machine instruction. | 80 // Generates a single byte of data or machine instruction. |
78 CheckBool EmitByteInstruction(uint8 byte) WARN_UNUSED_RESULT; | 81 CheckBool EmitByteInstruction(uint8 byte) WARN_UNUSED_RESULT; |
79 | 82 |
80 // Generates 4-byte relative reference to address of 'label'. | 83 // Generates 4-byte relative reference to address of 'label'. |
81 CheckBool EmitRel32(Label* label) WARN_UNUSED_RESULT; | 84 CheckBool EmitRel32(Label* label) WARN_UNUSED_RESULT; |
82 | 85 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 // We have separate label spaces for addresses referenced by rel32 labels and | 134 // We have separate label spaces for addresses referenced by rel32 labels and |
132 // abs32 labels. This is somewhat arbitrary. | 135 // abs32 labels. This is somewhat arbitrary. |
133 RVAToLabel rel32_labels_; | 136 RVAToLabel rel32_labels_; |
134 RVAToLabel abs32_labels_; | 137 RVAToLabel abs32_labels_; |
135 | 138 |
136 DISALLOW_COPY_AND_ASSIGN(AssemblyProgram); | 139 DISALLOW_COPY_AND_ASSIGN(AssemblyProgram); |
137 }; | 140 }; |
138 | 141 |
139 } // namespace courgette | 142 } // namespace courgette |
140 #endif // COURGETTE_ASSEMBLY_PROGRAM_H_ | 143 #endif // COURGETTE_ASSEMBLY_PROGRAM_H_ |
OLD | NEW |