freebsd-dev/libexec
Alan Cox ea8577c712 Before calling mmap() on a shared library's text and data sections, rtld
first calls mmap() with the arguments PROT_NONE and MAP_ANON to reserve a
single, contiguous range of virtual addresses for the entire shared library.
Later, rtld calls mmap() with the the shared library's file descriptor
and the argument MAP_FIXED to place the text and data sections within the
reserved range.  The rationale for mapping shared libraries in this way is
explained in the commit message for Revision 190885.  However, this approach
does have an unintended, negative consequence.  Since the first call to
mmap() specifies MAP_ANON and not the shared library's file descriptor, the
kernel has no idea what alignment the vm object backing the file prefers.
As a result, the reserved range's alignment is unlikely to be the same as
the vm object's, and so mapping with superpages becomes impossible.  To
address this problem, this revision adds the argument MAP_ALIGNED_SUPER to
the first call to mmap() if the text section is larger than the smallest
superpage size.

To determine if the text section is larger than the smallest superpage
size, rtld must always fetch the page size information.  As a result, the
private code for fetching the base page size in rtld's builtin malloc is
redundant.  Eliminate it.  Requested by: kib

Tested by:	zbb (on arm)
Reviewed by:	kib (an earlier version)
Discussed with:	jhb
2014-04-11 16:55:25 +00:00
..
atf Make bsd.test.mk the only public mk fragment for the building of tests. 2014-03-14 08:56:19 +00:00
atrun Add the name of the file that could not be opened to the error message 2013-06-11 18:46:46 +00:00
bootpd Re-format the license to conform to our BSD license template as much 2014-03-13 23:31:05 +00:00
casper Please welcome casperd daemon. It (and its services) will be responsible for 2013-12-02 08:21:28 +00:00
comsat Remove the 3rd clause ("advertising clause") of the BSD license as 2014-02-17 22:27:32 +00:00
dma Lower warning level when built with gcc 2014-02-21 14:14:48 +00:00
dma-mbox-create Add dma-mbox-create forgotten in the previous commit 2014-02-21 09:42:50 +00:00
fingerd Remove the 3rd clause ("advertising clause") of the BSD license as 2014-02-17 22:27:32 +00:00
ftpd Remove the 3rd clause ("advertising clause") of the BSD license as 2014-02-17 22:27:32 +00:00
getty ttys(5): Pseudo-terminals are not listed and the network keyword is obsolete. 2014-03-09 22:38:11 +00:00
mail.local Since clang 3.2 now has an option to suppress warnings about implicitly 2013-02-16 20:17:31 +00:00
mknetid Remove the 3rd clause ("advertising clause") of the BSD license as 2014-02-17 22:27:32 +00:00
pppoed In libexec/pppoed/pppoed.c, use the correct printf length modifier for a 2011-12-16 16:07:39 +00:00
rbootd Remove the 3rd clause ("advertising clause") of the BSD license as 2014-02-17 22:27:32 +00:00
revnetgroup Remove the 3rd clause ("advertising clause") of the BSD license as 2014-02-17 22:27:32 +00:00
rlogind Remove the 3rd clause ("advertising clause") of the BSD license as 2014-02-17 22:27:32 +00:00
rpc.rquotad The NFS quota-reporting RPC uses 32-bit sized fields. We approximate 2010-04-25 00:05:51 +00:00
rpc.rstatd Remove the 3rd clause ("advertising clause") of the BSD license as 2014-02-17 22:27:32 +00:00
rpc.rusersd Remove the 3rd clause ("advertising clause") of the BSD license as 2014-02-17 22:27:32 +00:00
rpc.rwalld Remove the 3rd clause ("advertising clause") of the BSD license as 2014-02-17 22:27:32 +00:00
rpc.sprayd Make WARNS=6 the default for libexec/. 2010-01-02 09:50:19 +00:00
rshd Remove the 3rd clause ("advertising clause") of the BSD license as 2014-02-17 22:27:32 +00:00
rtld-aout More -Wmissing-variable-declarations fixes. 2012-10-19 14:49:42 +00:00
rtld-elf Before calling mmap() on a shared library's text and data sections, rtld 2014-04-11 16:55:25 +00:00
save-entropy 1. Use install -d to create the entropy_dir if missing so that we can do it 2012-09-04 16:00:51 +00:00
smrsh Since clang 3.2 now has an option to suppress warnings about implicitly 2013-02-16 20:17:31 +00:00
talkd Remove the 3rd clause ("advertising clause") of the BSD license as 2014-02-17 22:27:32 +00:00
tcpd Make WARNS=6 the default for libexec/. 2010-01-02 09:50:19 +00:00
telnetd Convert telnetd(8) to use posix_openpt(2). 2008-11-13 19:05:27 +00:00
tests Build and install the atf tests. 2013-11-08 14:33:41 +00:00
tftp-proxy Make WARNS=6 the default for libexec/. 2010-01-02 09:50:19 +00:00
tftpd Remove the 3rd clause ("advertising clause") of the BSD license as 2014-02-17 22:27:32 +00:00
ulog-helper Do a better job at determining the username of the login session. 2012-04-19 21:12:08 +00:00
ypxfr Consistently set RPCGEN_CPP when running rpcgen, so the C preprocessor 2012-02-07 09:27:07 +00:00
Makefile Rename WITHOUT_DMA into WITHOUT_DMAGENT to avoid confusion 2014-02-22 13:05:23 +00:00
Makefile.inc Make WARNS=6 the default for libexec/. 2010-01-02 09:50:19 +00:00