From e32288d4ea9a808f5cb532800af879e8012a459c Mon Sep 17 00:00:00 2001 From: Justine Tunney Date: Sat, 11 Jun 2022 05:11:36 -0700 Subject: [PATCH] Fix WSL regression with APE loader Microsoft's version of Linux requires that the ELF program headers say that the executable has 4096 byte alignment. However, it doesn't force us to pad the binary with NOPs to a page-aligned size. --- ape/loader-elf.S | 4 ++-- build/bootstrap/ape.elf | Bin 4224 -> 4224 bytes 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ape/loader-elf.S b/ape/loader-elf.S index cbde38956..7ba774525 100644 --- a/ape/loader-elf.S +++ b/ape/loader-elf.S @@ -55,7 +55,7 @@ phdrs: .long PT_LOAD # p_type .quad ehdr # p_paddr .quad filesz # p_filesz .quad filesz # p_memsz - .quad 64 # p_align + .quad PAGESIZE # p_align .long PT_LOAD # p_type .long PF_R|PF_W # p_flags @@ -64,7 +64,7 @@ phdrs: .long PT_LOAD # p_type .quad bss # p_paddr .quad 0 # p_filesz .quad bsssize # p_memsz - .quad 64 # p_align + .quad PAGESIZE # p_align .long PT_GNU_STACK # p_type .long PF_R|PF_W # p_flags diff --git a/build/bootstrap/ape.elf b/build/bootstrap/ape.elf index b6da8fcb391abaffac38ac42011abfd7f9f9823a..acdb60d3f91b8893478f6f9345b6778d986b8277 100755 GIT binary patch delta 19 ZcmZorY*3s~z{DUhvB(TaZd`SZ9{@N81>gVx delta 19 ZcmZorY*3s~z~sO%vB(TaZd`SZ9{@Xs20#D+