9f9c9b22ec
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
20 lines
576 B
Makefile
20 lines
576 B
Makefile
# from: Makefile.inc,v 1.1 1993/09/03 19:04:23 jtc Exp
|
|
# $FreeBSD$
|
|
|
|
.if !defined(COMPAT_32BIT)
|
|
SRCS+= i386_clr_watch.c i386_set_watch.c i386_vm86.c
|
|
.endif
|
|
SRCS+= i386_get_fsbase.c i386_get_gsbase.c i386_get_ioperm.c i386_get_ldt.c \
|
|
i386_set_fsbase.c i386_set_gsbase.c i386_set_ioperm.c i386_set_ldt.c
|
|
|
|
MDASM= Ovfork.S cerror.S getcontext.S syscall.S
|
|
|
|
NOASM+= sbrk.o vfork.o
|
|
|
|
MAN+= i386_get_ioperm.2 i386_get_ldt.2 i386_vm86.2
|
|
MAN+= i386_set_watch.3
|
|
|
|
MLINKS+=i386_get_ioperm.2 i386_set_ioperm.2
|
|
MLINKS+=i386_get_ldt.2 i386_set_ldt.2
|
|
MLINKS+=i386_set_watch.3 i386_clr_watch.3
|