From: Meador Inge <meadori@codesourcery.com>
To: qemu-devel@nongnu.org
Cc: riku.voipio@iki.fi
Subject: [Qemu-devel] [RFC PATCH 1/1] linux-user: Probe the guest base for shared objects when needed
Date: Thu, 7 Jun 2012 15:59:02 -0500 [thread overview]
Message-ID: <1339102742-4584-2-git-send-email-meadori@codesourcery.com> (raw)
In-Reply-To: <1339102742-4584-1-git-send-email-meadori@codesourcery.com>
In some cases when running a shared library directly from QEMU
(e.g. ld.so) the guest base should still be probed so that
any images loaded later at fixed addresses by the target code
can still be mapped.
Signed-off-by: Meador Inge <meadori@codesourcery.com>
---
linux-user/elfload.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index f3b1552..c71c287 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -1443,6 +1443,7 @@ static void probe_guest_base(const char *image_name,
goto exit_errmsg;
}
}
+ have_guest_base = 1;
qemu_log("Relocating guest address space from 0x"
TARGET_ABI_FMT_lx " to 0x%lx\n",
loaddr, real_start);
@@ -1528,6 +1529,8 @@ static void load_elf_image(const char *image_name, int image_fd,
load_addr = loaddr;
if (ehdr->e_type == ET_DYN) {
+ if (loaddr < mmap_min_addr)
+ probe_guest_base(image_name, loaddr, hiaddr);
/* The image indicates that it can be loaded anywhere. Find a
location that can hold the memory space required. If the
image is pre-linked, LOADDR will be non-zero. Since we do
--
1.7.7.6
next prev parent reply other threads:[~2012-06-07 20:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-07 20:59 [Qemu-devel] [RFC PATCH 0/1] linux-user: Issue running applications through ld.so Meador Inge
2012-06-07 20:59 ` Meador Inge [this message]
2012-06-12 14:08 ` [Qemu-devel] [RFC PATCH 1/1] linux-user: Probe the guest base for shared objects when needed Richard Henderson
2012-06-12 18:44 ` Meador Inge
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1339102742-4584-2-git-send-email-meadori@codesourcery.com \
--to=meadori@codesourcery.com \
--cc=qemu-devel@nongnu.org \
--cc=riku.voipio@iki.fi \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).