From dd299dc2a76662551eb96fede37ba370367c9ba8 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 8 Jan 2016 16:12:01 +0100 Subject: Don't use dynamic page size This mostly reverts 08050dd5e3701b29e5628e1ec7d37c1cd6529c57 (#54) because the page size of the host is not necessarily the same as the page size of the binary. For a proper fix, we'll need some way to determine the page size of the binary, but ELF doesn't readily provide this information. Fixes #69. --- src/patchelf.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/patchelf.cc b/src/patchelf.cc index 4d299e9..ddde0c1 100644 --- a/src/patchelf.cc +++ b/src/patchelf.cc @@ -40,9 +40,10 @@ unsigned char * contents = 0; static unsigned int getPageSize(){ -#if (defined HAVE_SYSCONF) - // if present, use sysconf to get kernel page size - return sysconf(_SC_PAGESIZE); +#ifdef MIPSEL + /* The lemote fuloong 2f kernel defconfig sets a page size of + 16KB. */ + return 4096 * 4; #else return 4096; #endif -- cgit v0.12