This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Pending fixes for all-ABIs builds
On Wed, 9 Nov 2016, Florian Weimer wrote:
> On 11/09/2016 12:21 AM, Joseph Myers wrote:
> > On Tue, 8 Nov 2016, Florian Weimer wrote:
> >
> > > But there's one pre-existing issue I've been wondering about for a while
> > > (along with the s390 maintainers): I don't understand why we have PLT
> > > references to malloc & friends in ld.so. The malloc implementation there
> > > is
> > > not compliant with the C requirements. Why is it exported, and why do we
> > > use
> > > GOT indirection to call it?
> >
> > My understanding is that it's meant to be interposable by a user-provided
> > malloc implementation. See
> > <https://sourceware.org/ml/libc-alpha/2014-01/msg00719.html>, item 3.
>
> Does this mean the dynamic linker starts with it's GOT pointer as NULL,
> initializes that to point it to the malloc in elf/dl-minimal.c, and then, once
> libc.so.6 is relocated updates its GOT pointer to point to the malloc in
> libc.so.6?
I don't know the details (beyond what Roland explained, that early
allocations use ld.so's own malloc, but after interposition none of the
early allocations should ever be realloced or freed).
--
Joseph S. Myers
joseph@codesourcery.com