about summary refs log tree commit diff stats
path: root/subx/021translate.cc
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2018-06-30 10:47:01 -0700
committerKartik Agaram <vc@akkartik.com>2018-06-30 10:47:01 -0700
commit3e0c2b7c1345009de3eaaaf26978180b9919b5a1 (patch)
tree7521b166b15c09136584fd5b71e9ab6baac253e2 /subx/021translate.cc
parentb141a448ce0964f2a854b59a799875b94d2f1ec0 (diff)
downloadmu-3e0c2b7c1345009de3eaaaf26978180b9919b5a1.tar.gz
4290
Clarify a few happy accidents.
Diffstat (limited to 'subx/021translate.cc')
-rw-r--r--subx/021translate.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/subx/021translate.cc b/subx/021translate.cc
index de945fbc..ae110c21 100644
--- a/subx/021translate.cc
+++ b/subx/021translate.cc
@@ -73,13 +73,14 @@ void dump_elf_header(ostream& out) {
   uint32_t p_type = 0x1;
   emit(p_type);
   // p_offset
-  emit(dummy32);
+  uint32_t p_offset = 0;
+  emit(p_offset);
   // p_vaddr
   emit(START);
   // p_paddr
   emit(START);
   // p_filesz
-  uint32_t size = (End_of_program-1) + /*size of ehdr*/52 + /*size of phdr*/32;
+  uint32_t size = (End_of_program-/*we're not using location 0*/1) + /*size of ehdr*/52 + /*size of phdr*/32;
   emit(size);
   // p_memsz
   emit(size);