Date: Mon, 14 Jul 2008 12:23:16 +0200 From: Marcin Cieslak <saper@system.pl> To: freebsd-emulation@freebsd.org Subject: Re: linux emulation: Preliminary support for more auxvec's [patch] Message-ID: <487B2914.9020409@system.pl> In-Reply-To: <20080714104352.14951o38351fjnpc@webmail.leidinger.net> References: <g57h1u$5od$1@ger.gmane.org> <20080711115436.GZ17123@deviant.kiev.zoral.com.ua> <4877BAB8.1030804@system.pl> <20080714104352.14951o38351fjnpc@webmail.leidinger.net>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --] Alexander Leidinger wrote: > Quoting Marcin Cieslak <saper@system.pl> (from Fri, 11 Jul 2008 21:55:36 > +0200): > >> The patch is here: >> >> http://akson.sgh.waw.pl/~saper/FreeBSD/linux/auxvec.diff > > > -#define AT_COUNT 15 /* Count of defined aux entry types. */ > +#define AT_COUNT 18 /* Count of defined aux entry types. */ > ---snip--- > > I would expect that count is 24, not 18. But what happens if we increase > it to 24, is it expected to have some valid data by some automatism > based upon AT_COUNT then? What's in 18-22? Well, the count is the count - it's number of slots in the table. It is used for the allocation of the structure space. As Kostik Belousov pointed, rtld uses this (incorrectly) in libexec/rtld-elf/rtld.c in _rtld() an array of AT_COUNT elements is created and only items with values (0..AT_COUNT) are included in the table. This should be probably be changed to something in similar to lib/libc/gen/tls.c (see _init_tls() at the very end). Solaris sys/auxv.h comments explain the 18-22 shift (Linux collided with PPC ABI values): http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/uts/common/sys/auxv.h You can also here that Solaris defines quite large AT_* values, so an approach taken by rtld is not practical in the long term. I think in the long term (upstream, not in the linuxolator) we should allow ELF stack fixup routine to dynamically allocate user stack and get rid of AT_COUNT completely. I guess this could be done by extending (struct sysentvec *) and changing the code around 457 of kern_exec.c to separate "copy out strings" and "separate stack base" functions. This work-in-progress patch (http://people.freebsd.org/~kib/misc/rtld-origin.1.patch) also requires some allocation on the user stack. --Marcin [-- Attachment #2 --] -----BEGIN PGP SIGNATURE----- iQCVAwUBSHspGT2W2v2wY27ZAQNsQgP+NWw6xaaJPYHU7bO+jBBcngM2N7alYgHH xuwI8PBZtYzI85doxbTJngUGCzxi/jkVtnPmkbuAU8/MOwu9a2f6dHvWHxxQVgeW YG7zWDqLatOorc0m9yxlk6nZY7Rh/gQeJzJMlBi+OGPa+mt0GBZHE0QygoH8ATS7 0C+/b6GYjGY= =636Q -----END PGP SIGNATURE-----home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?487B2914.9020409>
