Received: from eggs.gnu.org ([208.118.235.92]:49548) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ScjnR-0002u3-Oq for qemu-devel@nongnu.org; Thu, 07 Jun 2012 16:59:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ScjnQ-0006Og-6Y for qemu-devel@nongnu.org; Thu, 07 Jun 2012 16:59:09 -0400 Received: from relay1.mentorg.com ([192.94.38.131]:59164) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ScjnP-0006O2-WD for qemu-devel@nongnu.org; Thu, 07 Jun 2012 16:59:08 -0400 From: Meador Inge Date: Thu, 7 Jun 2012 15:59:01 -0500 Message-ID: <1339102742-4584-1-git-send-email-meadori@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [RFC PATCH 0/1] linux-user: Issue running applications through ld.so List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: riku.voipio@iki.fi Hi All, I am running into an issue where QEMU fails to map a target executable due to hitting the lower limit on /proc/sys/vm/mmap_min_addr. This normally just works because of all the nice guest base probing we have in place: $ cat /proc/sys/vm/mmap_min_addr 4096 $ qemu-arm ./hello.out Hello, World! In cases where the executable is run through the glibc loader we are not so lucky: $ qemu-arm /path/to/lib/ld-2.15.so --library-path /path/to/lib/ ./hello.out ./hello.out: error while loading shared libraries: ./hello.out: failed to map segment from shared object: Permission denied The reason is that we successfully load the loader (since it can be put anywhere), but later ld.so goes to map in hello.out at a fixed address and fails because that fixed address is bellow mmap_min_addr and it is too late to fixup the guest base. I am able to fix the issue by probing for the guest base when needed for shared objects. This worked for all the test cases I threw at it (including running the gcc and glibc test suites through QEMU). However, I am not all that familiar with the Linux usermode pieces and would like some feedback. Thoughts? Meador Inge (1): linux-user: Probe the guest base for shared objects when needed linux-user/elfload.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) -- 1.7.7.6