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

Unified Diff: courgette/encoded_program.h

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « courgette/encode_decode_unittest.cc ('k') | courgette/encoded_program.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: courgette/encoded_program.h
diff --git a/courgette/encoded_program.h b/courgette/encoded_program.h
index b1203535f25b1296cb45ab8679d78ee51c3cb782..62f143917b74208de5ea83aadbeff8ad4f572385 100644
--- a/courgette/encoded_program.h
+++ b/courgette/encoded_program.h
@@ -43,7 +43,8 @@ class EncodedProgram {
CheckBool AddCopy(uint32 count, const void* bytes) WARN_UNUSED_RESULT;
CheckBool AddRel32(int label_index) WARN_UNUSED_RESULT;
CheckBool AddAbs32(int label_index) WARN_UNUSED_RESULT;
- CheckBool AddMakeRelocs() WARN_UNUSED_RESULT;
+ CheckBool AddPeMakeRelocs() WARN_UNUSED_RESULT;
+ CheckBool AddElfMakeRelocs() WARN_UNUSED_RESULT;
// (3) Serialize binary assembly language tables to a set of streams.
CheckBool WriteTo(SinkStreamSet* streams) WARN_UNUSED_RESULT;
@@ -58,16 +59,18 @@ class EncodedProgram {
private:
// Binary assembly language operations.
+ // These are part of the patch format. Reusing an existing value will
+ // break backwards compatibility.
enum OP {
- ORIGIN, // ORIGIN <rva> - set address for subsequent assembly.
- COPY, // COPY <count> <bytes> - copy bytes to output.
- COPY1, // COPY1 <byte> - same as COPY 1 <byte>.
- REL32, // REL32 <index> - emit rel32 encoded reference to address at
- // address table offset <index>
- ABS32, // ABS32 <index> - emit abs32 encoded reference to address at
- // address table offset <index>
- MAKE_BASE_RELOCATION_TABLE, // Emit base relocation table blocks.
- OP_LAST
+ ORIGIN = 0, // ORIGIN <rva> - set address for subsequent assembly.
+ COPY = 1, // COPY <count> <bytes> - copy bytes to output.
+ COPY1 = 2, // COPY1 <byte> - same as COPY 1 <byte>.
+ REL32 = 3, // REL32 <index> - emit rel32 encoded reference to address at
+ // address table offset <index>
+ ABS32 = 4, // ABS32 <index> - emit abs32 encoded reference to address at
+ // address table offset <index>
+ MAKE_PE_RELOCATION_TABLE = 5, // Emit PE base relocation table blocks.
+ MAKE_ELF_RELOCATION_TABLE = 6, // Emit Elf relocation table.
};
typedef NoThrowBuffer<RVA> RvaVector;
@@ -76,7 +79,8 @@ class EncodedProgram {
typedef NoThrowBuffer<OP> OPVector;
void DebuggingSummary();
- CheckBool GenerateBaseRelocations(SinkStream *buffer) WARN_UNUSED_RESULT;
+ CheckBool GeneratePeRelocations(SinkStream *buffer) WARN_UNUSED_RESULT;
+ CheckBool GenerateElfRelocations(SinkStream *buffer) WARN_UNUSED_RESULT;
CheckBool DefineLabelCommon(RvaVector*, int, RVA) WARN_UNUSED_RESULT;
void FinishLabelsCommon(RvaVector* addresses);
« no previous file with comments | « courgette/encode_decode_unittest.cc ('k') | courgette/encoded_program.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698