From 8188bbbc9408322c18cdc2d1049126900abf793c Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Mon, 18 Feb 2019 21:48:19 -0800 Subject: 4981 - no, go back to 3 phases Considering how much trouble a merge phase would be (commit 4978), it seems simpler to just add the extra syntax for controlling the entry point of the generated ELF binary. But I wouldn't have noticed this if I hadn't taken the time to write out the commit messages of 4976 and 4978. Even if we happened to already have linked list primitives built, this may still be a good idea considering that I'm saving quite a lot of code in duplicated entrypoints. --- subx/028translate.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'subx/028translate.cc') diff --git a/subx/028translate.cc b/subx/028translate.cc index 2104d57b..d4b1a3a5 100644 --- a/subx/028translate.cc +++ b/subx/028translate.cc @@ -97,13 +97,14 @@ void write_elf_header(ostream& out, const program& p) { // e_version O(0x01); O(0x00); O(0x00); O(0x00); // e_entry - int e_entry = p.segments.at(0).start; // convention + uint32_t e_entry = p.segments.at(0).start; // convention + // Override e_entry emit(e_entry); // e_phoff -- immediately after ELF header - int e_phoff = 0x34; + uint32_t e_phoff = 0x34; emit(e_phoff); // e_shoff; unused - int dummy32 = 0; + uint32_t dummy32 = 0; emit(dummy32); // e_flags; unused emit(dummy32); -- cgit 1.4.1-2-gfad0