static binary, dlopen, and ifunc
H.J. Lu
hjl.tools@gmail.com
Fri Nov 13 12:28:22 GMT 2020
On Fri, Nov 13, 2020 at 3:29 AM Florian Weimer via Libc-alpha
<libc-alpha@sourceware.org> wrote:
>
> * Samuel Thibault via Libc-alpha:
>
> > Samuel Thibault, le ven. 13 nov. 2020 01:00:51 +0100, a ecrit:
> >> It happens that the output of the program is
> >>
> >> info: C locale tests
> >> info: en_US.ISO-8859-1 locale tests
> >> tst-idna_name_classify: Relink `/usr/src/glibc-upstream/build/mach/libmachuser.so.1' with `/usr/src/glibc-upstream/build/libc.so.0.3' for IFUNC symbol `__stpncpy'
> >> Segmentation fault
> >>
> >> Is that perhaps what triggers the ifunc selection unexpectedly early?
> >
> > I realize something: libc.so "NEED"s libmachuser.so for the RPC stubs.
> > So I guess the linker is here relocating libmachuser.so first, and here
> > trying to select for __stpncpy before libc.so is relocated. I guess I
> > need a way to make libmachuser.so only use non-ifunc functions so its
> > relocation can proceed before that of libc.so.
>
> Yes, this what I worried about when we discussed storing CPU features in
> _rtld_global_ro. I still think it's the wrong approach, but I haven't
> had the time yet to clean it up.
>
It is not about libc.so. It is about ld.so. We need to relocate ld.so before
any other shared object. Can you find out why it doesn't happen on
Hurd?
--
H.J.
More information about the Libc-alpha
mailing list