[PATCH v2] ld/gold: Use mallinfo2 over mallinfo if available

Khem Raj raj.khem@gmail.com
Fri Mar 19 22:17:06 GMT 2021


On Fri, Mar 19, 2021 at 2:33 PM Cary Coutant <ccoutant@gmail.com> wrote:
>
> > mallinfo has been deprecated in recently glibc releases raising
> > deprecated-declarations when used, mallinfo2 has been introduced instead
> > which could be used ahead of mallinfo provided platform supports it
>
> Thanks. I've committed the following patch, based on the original one
> sent by Duncan Simpson.
>
> The deprecation warnings, while appreciated (I've encountered the
> overflow in the arena field quite often), seem premature, as my
> (fairly recent) debian distro still does not have mallinfo2() in
> glibc. I wouldn't suggest deprecating an old interface until the new
> one is widely available.
>
> 2021-03-19  Duncan Simpson <dr.duncan.p.simpson@gmail.com>
>
> gold/
>         PR gold/26585
>         * configure.ac: Add check for mallinfo2.
>         * configure: Regenerate.
>         * main.cc (main): Use mallinfo2 if available.
>
> -cary


This patch is not correctly handling the issue where its using

      struct mallinfo m = mallinfo2();

it should have been

     struct mallinfo2 m = mallinfo2();

Would you mind taking the patch I posted and review the delta and
apply it to fix it ?


More information about the Binutils mailing list