|
From: <sv...@va...> - 2005-11-02 19:41:26
|
Author: sewardj
Date: 2005-11-02 19:41:21 +0000 (Wed, 02 Nov 2005)
New Revision: 4993
Log:
Don't try to honour the ELF interpreter's load address if it is zero.
Modified:
trunk/coregrind/m_ume.c
Modified: trunk/coregrind/m_ume.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_ume.c 2005-11-02 16:15:55 UTC (rev 4992)
+++ trunk/coregrind/m_ume.c 2005-11-02 19:41:21 UTC (rev 4993)
@@ -447,11 +447,29 @@
mapelf(), which in turn asks aspacem to do some fixed maps at
the specified address. This is a bit of hack, but it should
work because there should be no intervening transactions with
- aspacem which could cause those fixed maps to fail. */
- mreq.rkind =3D MHint;
- mreq.start =3D interp_addr;
- mreq.len =3D interp_size;
+ aspacem which could cause those fixed maps to fail.
+
+ Placement policy is:
+
+ if the interpreter asks to be loaded at zero
+ ignore that and put it wherever we like (mappings at zero=20
+ are bad news)
+ else
+ try and put it where it asks for, but if that doesn't work,
+ just put it anywhere.
+ */
+ if (interp_addr =3D=3D 0) {
+ mreq.rkind =3D MAny;
+ mreq.start =3D 0;
+ mreq.len =3D interp_size;
+ } else {
+ mreq.rkind =3D MHint;
+ mreq.start =3D interp_addr;
+ mreq.len =3D interp_size;
+ }
+
advised =3D VG_(am_get_advisory)( &mreq, True/*client*/, &ok );
+
if (!ok) {
/* bomb out */
SysRes res =3D VG_(mk_SysRes_Error)(VKI_EINVAL);
|