9d9fd255d6
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
69 lines
876 B
Plaintext
69 lines
876 B
Plaintext
/*
|
|
* $FreeBSD$
|
|
*/
|
|
|
|
/*
|
|
* This only needs to contain symbols that are not listed in
|
|
* symbol maps from other parts of libc (i.e., not found in
|
|
* stdlib/Symbol.map, string/Symbol.map, sys/Symbol.map, ...).
|
|
*/
|
|
FBSD_1.0 {
|
|
/* PSEUDO syscalls */
|
|
_exit;
|
|
|
|
.mcount;
|
|
_setjmp;
|
|
_longjmp;
|
|
fabs;
|
|
__flt_rounds;
|
|
fpgetmask;
|
|
fpgetprec;
|
|
fpgetround;
|
|
fpgetsticky;
|
|
fpsetmask;
|
|
fpsetprec;
|
|
fpsetround;
|
|
__infinity;
|
|
__nan;
|
|
makecontext;
|
|
rfork_thread;
|
|
setjmp;
|
|
longjmp;
|
|
sigsetjmp;
|
|
siglongjmp;
|
|
htonl;
|
|
htons;
|
|
ntohl;
|
|
ntohs;
|
|
amd64_get_fsbase;
|
|
amd64_get_gsbase;
|
|
amd64_set_fsbase;
|
|
amd64_set_gsbase;
|
|
brk;
|
|
sbrk;
|
|
vfork;
|
|
};
|
|
|
|
/*
|
|
*
|
|
* FreeBSD private ABI
|
|
*
|
|
*/
|
|
FBSDprivate_1.0 {
|
|
/* PSEUDO syscalls */
|
|
__sys_getlogin;
|
|
_getlogin;
|
|
__sys_exit;
|
|
|
|
_set_tp;
|
|
___longjmp;
|
|
__makecontext;
|
|
__longjmp;
|
|
__signalcontext;
|
|
signalcontext;
|
|
__siglongjmp;
|
|
_brk;
|
|
__sys_vfork;
|
|
_vfork;
|
|
};
|