From aa6c342af977b4638361b2e68c3f8cc6888cac24 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Sat, 14 Jul 2018 10:40:26 -0700 Subject: 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). --- subx/021translate.cc | 2 +- subx/ex1 | Bin 96 -> 96 bytes subx/ex2 | Bin 102 -> 102 bytes subx/ex3 | Bin 119 -> 119 bytes subx/ex4 | Bin 113 -> 113 bytes 5 files changed, 1 insertion(+), 1 deletion(-) 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 diff --git a/subx/ex1 b/subx/ex1 index f3c9730d..c4114dfd 100755 Binary files a/subx/ex1 and b/subx/ex1 differ diff --git a/subx/ex2 b/subx/ex2 index 3bbd979b..38520d38 100755 Binary files a/subx/ex2 and b/subx/ex2 differ diff --git a/subx/ex3 b/subx/ex3 index aa209b92..9c1f9a92 100755 Binary files a/subx/ex3 and b/subx/ex3 differ diff --git a/subx/ex4 b/subx/ex4 index b20490ad..21f7118b 100755 Binary files a/subx/ex4 and b/subx/ex4 differ -- cgit 1.4.1-2-gfad0