[PATCH 2/3] Revert "[AArch64][BZ #17711] Fix extern protected data handling"

H.J. Lu hjl.tools@gmail.com
Tue May 31 02:03:24 GMT 2022


On Fri, May 27, 2022 at 5:43 AM Florian Weimer <fweimer@redhat.com> wrote:
>
> * Wilco Dijkstra:
>
> > Hi Florian,
> >
> > Sure, something basic like this shows the issues:
> >
> > int x;
> > int f(void) { return ++x; }
> > int main(void) { return f(); }
> >
> > compile with -O2 -fPIC -flto -shared:
> >
> > 00000000000004f0 <f@plt>:
> >  4f0:   b0000090        adrp    x16, 11000 <__cxa_finalize@GLIBC_2.17>
> >  4f4:   f9400611        ldr     x17, [x16, #8]
> >  4f8:   91002210        add     x16, x16, #0x8
> >  4fc:   d61f0220        br      x17
> >
> > 0000000000000510 <main>:
> >  510:   17fffff8        b       4f0 <f@plt>
> >
> > 0000000000000600 <f>:
> >  600:   90000081        adrp    x1, 10000 <__FRAME_END__+0xf8f8>
> >  604:   f947e821        ldr     x1, [x1, #4048]
> >  608:   b9400020        ldr     w0, [x1]
> >  60c:   11000400        add     w0, w0, #0x1
> >  610:   b9000020        str     w0, [x1]
> >  614:   d65f03c0        ret
>
> Can you link with a version script?
>
> { local: *; global: main; };
>
> Exporting symbols inhibits some optimizations even if interposition is
> assumed not to happen because the behavior of public entry points needs
> to be preserved.  With a version script, the set of entry points can be
> greatly reduced, enabling further optimizations.
>
> Thanks,
> Florian
>

Should -fno-semantic-interposition imply -fvisibility=protected
-mno-direct-extern-access?

-- 
H.J.


More information about the Libc-alpha mailing list