This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: [patch] Variable page size support for MIPS/Linux
- From: "Maciej W. Rozycki" <macro at ds2 dot pg dot gda dot pl>
- To: Roland McGrath <roland at redhat dot com>
- Cc: libc-alpha at sources dot redhat dot com, Ralf Baechle <ralf at linux-mips dot org>
- Date: Mon, 5 Jan 2004 17:04:57 +0100 (CET)
- Subject: Re: [patch] Variable page size support for MIPS/Linux
- Organization: Technical University of Gdansk
- References: <200312280359.hBS3xpDS018719@magilla.sf.frob.com>
On Sat, 27 Dec 2003, Roland McGrath wrote:
> What makes you think changes are required?
> _dl_non_dynamic_init takes care of this already.
As Linux uses the auxiliary vector to report the page size,
_dl_non_dynamic_init() is not used for initializing _dl_pagesize;
_dl_aux_init() is used instead. Then _dl_aux_init() is only called for a
statically linked executable (as is _dl_non_dynamic_init()). When such a
binary calls dlopen() and ld.so is loaded as a result, then this loader's
_dl_pagesize remains uninitialized, because its _dl_sysdep_start()
function (which is the one to initialize _dl_pagesize from the auxiliary
vector for ld.so) isn't called. At this point the auxiliary vector might
have already been overwritten (as its located at the process's stack), so
there is no point trying to fetch any values from it. So the page size
needs to be read from the static executable's _dl_pagesize and explicitly
passed to ld.so being loaded. This is what the code does. This is
nothing discovering -- IA64 uses the same approach.
Maciej
--
+ Maciej W. Rozycki, Technical University of Gdansk, Poland +
+--------------------------------------------------------------+
+ e-mail: macro@ds2.pg.gda.pl, PGP key available +