[PATCH] elf: Avoid nested functions in the loader (all ports) [BZ #27220]
Fāng-ruì Sòng
maskray@google.com
Mon Sep 13 16:36:01 GMT 2021
ping
On Fri, Sep 3, 2021 at 8:52 PM Fangrui Song <maskray@google.com> wrote:
>
> On 2021-09-03, Florian Weimer wrote:
> >* Fangrui Song via Libc-alpha:
> >
> >> [Alternative to https://sourceware.org/pipermail/libc-alpha/2021-August/130340.html
> >> This version fixes all ports and doesn't add NESTING dispatches.]
> >>
> >> dynamic-link.h is included more than once in some elf/ files (rtld.c,
> >> dl-conflict.c, dl-reloc.c, dl-reloc-static-pie.c) and uses GCC nested
> >> functions. This harms readability and the nested functions usage
> >> is the biggest obstacle prevents CC=clang (which doesn't support the
> >> feature).
> >
> >This patch causes elf/tst-nodelete to fail on x86_64, powerpc64,
> >powerpc64le at least:
> >
> >| Unique symbols test failed
> >
> >I assume something is wrong with the initialization of the new global
> >variables.
>
> I unintentionally missed DL_LOOKUP_FOR_RELOCATE
> (fcb04b9aed26a737159ef7be9c5a6ad0994437dc ("Introduce
> DL_LOOKUP_FOR_RELOCATE flag for _dl_lookup_symbol_x")) when rebasing the
> multi-line macro RESOLVE_MAP.
>
> Fixed in
> https://sourceware.org/git/?p=glibc.git;a=shortlog;h=refs/heads/maskray/unnest
>
> (Sorry about my negligence. On my Debian, master has 14 FAIL, and I
> probably missed that tst-nodelete additionally failed.)
More information about the Libc-alpha
mailing list