Date: Sun, 1 Mar 2009 22:48:18 +0000 (UTC) From: Robert Watson <rwatson@FreeBSD.org> To: cvs-src-old@freebsd.org Subject: cvs commit: src/sys/kern imgact_elf.c Message-ID: <200903012248.n21MmXlc004437@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
rwatson 2009-03-01 22:48:18 UTC FreeBSD src repository Modified files: (Branch: RELENG_7) sys/kern imgact_elf.c Log: SVN rev 189255 on 2009-03-01 22:48:18Z by rwatson Merge r187686 from head to stable/7: When a statically linked binary is executed (or at least, one without an interpreter definition in its program header), set the auxiliary ELF argument AT_BASE to 0 rather than to the address that we would have mapped the interpreter at if there had been one. The ELF ABI specifications appear to be ambiguous as to the desired behavior in this situation, as they define AT_BASE as the base address of the interpreter, but do not mention what to do if there is none. On Solaris, AT_BASE will be set to the base address of the static binary if there is no interpreter, and on Linux, AT_BASE is set to 0. We go with the Linux semantics as they are of more immediate utility and allow the early runtime environment to know that the kernel has not mapped an interpreter, but because AT_PHDR points at the ELF header for the running binary, it is still possible to retrieve all required mapping information when the process starts should it be required. Either approach would be preferable to our current behavior of passing a pointer to an unmapped region of user memory as AT_BASE. Sponsored by: Google Revision Changes Path 1.178.2.5 +2 -1 src/sys/kern/imgact_elf.c
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200903012248.n21MmXlc004437>