qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC PATCH 0/1] linux-user: Issue running applications through ld.so
@ 2012-06-07 20:59 Meador Inge
  2012-06-07 20:59 ` [Qemu-devel] [RFC PATCH 1/1] linux-user: Probe the guest base for shared objects when needed Meador Inge
  0 siblings, 1 reply; 4+ messages in thread
From: Meador Inge @ 2012-06-07 20:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: riku.voipio

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-06-12 18:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [Qemu-devel] [RFC PATCH 1/1] linux-user: Probe the guest base for shared objects when needed Meador Inge
2012-06-12 14:08   ` Richard Henderson
2012-06-12 18:44     ` Meador Inge

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).