From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:45197) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SeW4v-0003ye-Om for qemu-devel@nongnu.org; Tue, 12 Jun 2012 14:44:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SeW4t-0000Hf-Ny for qemu-devel@nongnu.org; Tue, 12 Jun 2012 14:44:33 -0400 Received: from relay1.mentorg.com ([192.94.38.131]:35521) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SeW4t-0000GA-Ii for qemu-devel@nongnu.org; Tue, 12 Jun 2012 14:44:31 -0400 Message-ID: <4FD78E08.8040900@codesourcery.com> Date: Tue, 12 Jun 2012 13:44:24 -0500 From: Meador Inge MIME-Version: 1.0 References: <1339102742-4584-1-git-send-email-meadori@codesourcery.com> <1339102742-4584-2-git-send-email-meadori@codesourcery.com> <4FD74D4D.8060104@twiddle.net> In-Reply-To: <4FD74D4D.8060104@twiddle.net> 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: Richard Henderson Cc: riku.voipio@iki.fi, qemu-devel@nongnu.org On 06/12/2012 09:08 AM, Richard Henderson wrote: > 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. It usually is. I just want guest_base to be computed to something that will work for cases where a fixed address image is later loaded (at which point it is too late to compute the guest_base). Always probing is one way I found to do that, but as I originally said I don't know this code very well so maybe that is not a good method. > 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. Hmmm, OK. I was really hoping to have something more automatic. Perhaps I will have to use the options. Thanks for the review. -- Meador Inge CodeSourcery / Mentor Embedded http://www.mentor.com/embedded-software