diff --git a/src/p_lx_elf.cpp b/src/p_lx_elf.cpp index aa3479ad..f47f2c11 100644 --- a/src/p_lx_elf.cpp +++ b/src/p_lx_elf.cpp @@ -519,7 +519,7 @@ off_t PackLinuxElf64::pack3(OutputFile *fo, Filter &ft) // So: pretend 4KiB pages. upx_uint64_t const pm = ( Elf64_Ehdr::EM_X86_64 ==e_machine - || Elf64_Ehdr::EM_AARCH64==e_machine + //|| Elf64_Ehdr::EM_AARCH64==e_machine //|| Elf64_Ehdr::EM_PPC64 ==e_machine /* DOES NOT WORK! */ ) ? ((~(upx_uint64_t)0)<<12) diff --git a/src/stub/src/amd64-linux.elf-main.c b/src/stub/src/amd64-linux.elf-main.c index a0d390a6..acf5f764 100644 --- a/src/stub/src/amd64-linux.elf-main.c +++ b/src/stub/src/amd64-linux.elf-main.c @@ -409,7 +409,9 @@ xfind_pages(unsigned mflags, Elf64_Phdr const *phdr, int phnum, } } DPRINTF(" addr=%%p lo=%%p hi=%%p\\n", addr, lo, hi); - addr = (Elf64_Addr)mmap((void *)addr, hi, PROT_NONE, mflags, -1, 0); + // PROT_WRITE allows testing of 64k pages on 4k Linux + addr = (Elf64_Addr)mmap((void *)addr, hi, (DEBUG ? PROT_WRITE : PROT_NONE), // FIXME XXX EVIL + mflags, -1, 0); DPRINTF(" addr=%%p\\n", addr); *p_brk = hi + addr; // the logical value of brk(0) return (Elf64_Addr)(addr - lo);