This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Should malloc-related functions be weak?
- From: Carlos O'Donell <carlos at redhat dot com>
- To: Tulio Magno Quites Machado Filho <tuliom at linux dot vnet dot ibm dot com>, Florian Weimer <fw at deneb dot enyo dot de>, DJ Delorie <dj at redhat dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Mon, 1 Aug 2016 16:36:26 -0400
- Subject: Re: Should malloc-related functions be weak?
- Authentication-results: sourceware.org; auth=none
- References: <87eg6cuwp7.fsf@totoro.br.ibm.com> <xnbn1ed1p8.fsf@greed.delorie.com> <87oa5d29xf.fsf@mid.deneb.enyo.de> <8760rkvcir.fsf@totoro.br.ibm.com>
On 08/01/2016 09:34 AM, Tulio Magno Quites Machado Filho wrote:
> Florian Weimer <fw@deneb.enyo.de> writes:
>
>> * DJ Delorie:
>>
>>> "Tulio Magno Quites Machado Filho" <tuliom@linux.vnet.ibm.com> writes:
>>>> Shouldn't they be weak functions?
>>>
>>> I can imagine the mess that would happen if someone overwrode malloc()
>>> but not free()...
>>
>> The problem is with the other symbols Tulio identified. I'll try to
>> see if providing weak stubs for them addresses the issue.
>
> Do you plan to change it for 2.24?
>
> Let me elaborate...
> Right now, both tcmalloc and jemalloc cannot link statically against glibc
> 2.24 and I'm trying to:
> - Make they link statically again.
> - Remove all references to __malloc_initialize_hook (even outdated source
> code comments).
> - Stop using all the other malloc hooks.
> - Improve documentation on this, so that we can provide an answer to the
> following open questions:
> - https://sourceware.org/bugzilla/show_bug.cgi?id=2765
> - https://sourceware.org/bugzilla/show_bug.cgi?id=16939
This should not hold up the glibc 2.24 release.
The use case of externally interposed mallocs and static linking is not a case
that should hold up the release. Interposed mallocs might always need to catch
up a bit. I think we should still fix this, but not hold up 2.24.
Therefore please continue to work on this and decide if a 2.24.1 is needed to
address the issue (moving around things internally without changing ABI/API).
--
Cheers,
Carlos.