This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]