about summary refs log tree commit diff stats
path: root/subx/021translate.cc
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2018-07-14 10:40:26 -0700
committerKartik Agaram <vc@akkartik.com>2018-07-14 10:43:34 -0700
commitaa6c342af977b4638361b2e68c3f8cc6888cac24 (patch)
treeee7ac032d37796dc5949bd1a9a1a0c747d388428 /subx/021translate.cc
parent6f812e6ea125aadd2e0891b094902b34924dccd0 (diff)
downloadmu-aa6c342af977b4638361b2e68c3f8cc6888cac24.tar.gz
4343
Let's minimize the alignment requirements of each segment's offset.
It'll make binaries take less room later. Otherwise we may need to pad
lots of 0s for segments after the first.

Generated ELF binaries continue to work natively (except ex4, but that
was already not working).
Diffstat (limited to 'subx/021translate.cc')
-rw-r--r--subx/021translate.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/subx/021translate.cc b/subx/021translate.cc
index c3d780f1..d33755ab 100644
--- a/subx/021translate.cc
+++ b/subx/021translate.cc
@@ -114,7 +114,7 @@ void dump_elf_header(ostream& out) {
   uint32_t p_flags = 0x5;  // r-x
   emit(p_flags);
   // p_align
-  uint32_t p_align = 0x1000;
+  uint32_t p_align = 0x4;  // p_offset must be congruent to p_paddr/p_vaddr modulo p_align
   emit(p_align);
 #undef O
 #undef emit