freebsd-skq/lib/libc/i386/Symbol.map
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

66 lines
887 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;
alloca;
fabs;
__flt_rounds;
__nan;
__infinity;
makecontext;
rfork_thread;
setjmp;
longjmp;
sigsetjmp;
siglongjmp;
htonl;
htons;
ntohl;
ntohs;
vfork;
brk;
i386_clr_watch;
i386_get_fsbase;
i386_get_gsbase;
i386_get_ioperm;
i386_get_ldt;
i386_set_fsbase;
i386_set_gsbase;
i386_set_ioperm;
i386_set_ldt;
i386_set_watch;
i386_vm86;
sbrk;
___tls_get_addr;
};
FBSDprivate_1.0 {
/* PSEUDO syscalls */
__sys_getlogin;
_getlogin;
__sys_exit;
_set_tp;
___longjmp;
__makecontext;
__longjmp;
__signalcontext;
signalcontext;
__siglongjmp;
__sys_vfork;
_vfork;
_brk;
};