From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:54383) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SeRli-0004z8-30 for qemu-devel@nongnu.org; Tue, 12 Jun 2012 10:08:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SeRlb-0002NC-SH for qemu-devel@nongnu.org; Tue, 12 Jun 2012 10:08:25 -0400 Received: from mail-gh0-f173.google.com ([209.85.160.173]:44734) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SeRlb-0002MP-LL for qemu-devel@nongnu.org; Tue, 12 Jun 2012 10:08:19 -0400 Received: by ghrr14 with SMTP id r14so3867136ghr.4 for ; Tue, 12 Jun 2012 07:08:17 -0700 (PDT) Sender: Richard Henderson Message-ID: <4FD74D4D.8060104@twiddle.net> Date: Tue, 12 Jun 2012 07:08:13 -0700 From: Richard Henderson MIME-Version: 1.0 References: <1339102742-4584-1-git-send-email-meadori@codesourcery.com> <1339102742-4584-2-git-send-email-meadori@codesourcery.com> In-Reply-To: <1339102742-4584-2-git-send-email-meadori@codesourcery.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH 1/1] linux-user: Probe the guest base for shared objects when needed List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Meador Inge Cc: riku.voipio@iki.fi, qemu-devel@nongnu.org On 2012-06-07 13:59, Meador Inge wrote: > load_addr = loaddr; > if (ehdr->e_type == ET_DYN) { > + if (loaddr < mmap_min_addr) > + probe_guest_base(image_name, loaddr, hiaddr); This doesn't make any sense. loaddr is almost certainly 0, unless you've pre-linked the ld.so image. But the next statement is letting the system pick the address at which the image will be loaded. What you're actually wanting is to probe the address ranges of the "real" program, which since this is essentially a program running a program is not visible to us at all. I think this is one of those cases where the -B or -R options (or QEMU_GUEST_BASE and QEMU_RESERVED_VA env variables) are the best way forward for whatever cpu you're emulating. That or a change to the target's default ld script, not to link real executables quite so low in the address space. r~