extend dl-minimal malloc implementation
Florian Weimer
fweimer@redhat.com
Thu Aug 17 16:22:00 GMT 2017
On 08/16/2017 07:39 PM, DJ Delorie wrote:
>
> "Carlos O'Donell" <carlos@redhat.com> writes:
>> (b) Eliminate all alloca by moving to malloc (requires (a)).
>
> I will point out the obvious, for the record, that doing (b) may be
> arbitrarily non-trivial.
>
> I've looked at some of the alloca code in ld.so and the original
> programmers (rightly) took advantage of the auto-cleanup, resulting in
> code that might be difficult to convert.
Most alloca uses are in fact straightforward to convert. I have patches.
There is an alloca in the dlclose path, and that needs some data
structure changes to get rid off, though. We cannot allocate during
dlclose because we cannot deal with allocation failures in this place,
so we need to reserve all scratch data dlclose might need when dlopen is
called.
Thanks,
Florian
More information about the Libc-alpha
mailing list