[PATCH] Mark __libc_freeres_fn as used [# 27002]

Florian Weimer fweimer@redhat.com
Thu Dec 3 09:39:02 GMT 2020


* H. J. Lu via Libc-alpha:

> GCC 11 with
>
> commit 6fbec038f7a7ddf29f074943611b53210d17c40c
> Author: H.J. Lu <hjl.tools@gmail.com>
> Date:   Mon Feb 3 11:55:43 2020 -0800
>
>     Use SHF_GNU_RETAIN to preserve symbol definitions
>
> places used symbols in SECTION_RETAIN sections if assembler supports it.
> Mark __libc_freeres_fn as used to avoid
>
> In file included from <command-line>:
> gconv_dl.c: In function 'free_mem':
> gconv_dl.c:202:18: error: 'free_mem' causes a section type conflict with 'do_release_all'
>   202 | libc_freeres_fn (free_mem)
>       |                  ^~~~~~~~
> ./../include/libc-symbols.h:316:15: note: in definition of macro 'libc_freeres_fn'
>   316 |   static void name (void)
>       |               ^~~~
> gconv_dl.c:191:1: note: 'do_release_all' was declared here
>   191 | do_release_all (void *nodep)
>       | ^~~~~~~~~~~~~~
>
> where free_mem is marked as used.

Why isn't this a GCC 11 bug?  Using SHF_GNU_RETAIN for existing code is
surprising.

Thanks,
Florian
-- 
Red Hat GmbH, https://de.redhat.com/ , Registered seat: Grasbrunn,
Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Charles Cachera, Brian Klemm, Laurie Krebs, Michael O'Neill



More information about the Libc-alpha mailing list