This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: usage and breakage of dl-sbrk and dl-brk
- From: Roland McGrath <roland at frob dot com>
- To: Jeroen Dekkers <jeroen at dekkers dot cx>
- Cc: libc-alpha at sources dot redhat dot com
- Date: Sat, 11 May 2002 17:14:14 -0400 (EDT)
- Subject: Re: usage and breakage of dl-sbrk and dl-brk
I came across this too. I don't really see why those special brk and sbrk
are linked into ld.so at all. Their only purpose seems to be that __curbrk
not be exported from ld.so when the normal files get linked in. But the
only reason brk/sbrk get linked in at all is because of frob_brk in
sysdeps/unix/sysv/linux/dl-sysdep.c. I can't see any point to that call
except to set __curbrk--which is then never used by ld.so itself, so it's
pointless if it's not exported. Since the malloc in dl-minimal.c only uses
mmap and never brk/sbrk, ld.so never uses the break at all.
So, if there is any purpose to dl-brk/dl-sbrk at all, it's only because of
unix/sysv/linux/dl-sysdep.c and so those files ought to be linux-specific
rather than generic. But I cannot see any reason not to just remove both
them and linux/dl-sysdep.c entirely.
Am I missing something?