freebsd-dev/lib/libc/tests
Mark Johnston 9f9c9b22ec Reimplement brk() and sbrk() to avoid the use of _end.
Previously, libc.so would initialize its notion of the break address
using _end, a special symbol emitted by the static linker following
the bss section.  Compatibility issues between lld and ld.bfd could
cause the wrong definition of _end (libc.so's definition rather than
that of the executable) to be used, breaking the brk()/sbrk()
interface.

Avoid this problem and future interoperability issues by simply not
relying on _end.  Instead, modify the break() system call to return
the kernel's view of the current break address, and have libc
initialize its state using an extra syscall upon the first use of the
interface.  As a side effect, this appears to fix brk()/sbrk() usage
in executables run with rtld direct exec, since the kernel and libc.so
no longer maintain separate views of the process' break address.

PR:		228574
Reviewed by:	kib (previous version)
MFC after:	2 months
Differential Revision:	https://reviews.freebsd.org/D15663
2018-06-04 19:35:15 +00:00
..
c063 DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
db DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
gen getentropy(3): Fallback to kern.arandom sysctl on older kernels 2018-03-21 23:52:37 +00:00
hash DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
iconv Remove 'All rights reserved' from my files 2018-05-09 20:12:59 +00:00
inet DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
locale DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
net DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
nss DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
regex Add libregex, connect it to the build 2018-01-22 02:44:41 +00:00
resolv DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
rpc DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
setjmp DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
ssp DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
stdio Conform to Berne Convention. 2018-05-22 06:22:58 +00:00
stdlib DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
string DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
sys Reimplement brk() and sbrk() to avoid the use of _end. 2018-06-04 19:35:15 +00:00
termios DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
time DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
tls DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
tls_dso DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
ttyio DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
Makefile Only build lib/libc/tests/iconv if MK_ICONV != no 2016-10-21 04:54:43 +00:00
Makefile.depend DIRDEPS_BUILD: Connect MK_TESTS. 2016-03-09 22:46:01 +00:00
Makefile.netbsd-tests Change WARNS to 2 across the board with all the libc testcases 2015-11-15 05:21:58 +00:00