[PATCH 1/3] x86: Initialize CPU info via IFUNC relocation [BZ 26203]

Florian Weimer fweimer@redhat.com
Fri Sep 18 13:59:45 GMT 2020


* H. J. Lu:

> On Fri, Sep 18, 2020 at 1:06 AM Florian Weimer <fweimer@redhat.com> wrote:
>>
>> * H. J. Lu via Libc-alpha:
>>
>> > X86 CPU features in ld.so are initialized by init_cpu_features, which is
>> > invoked by DL_PLATFORM_INIT from _dl_sysdep_start.  But when ld.so is
>> > loaded by static executable, DL_PLATFORM_INIT is never called.
>>
>> I don't think that's accurate.  It's called from elf/dl-support.c in the
>> static case.  But I agree that it's too late in this case.
>
> I was referring to the ld.so case.  elf/dl-support.c isn't used for ld.so.

I missed that.

You cannot use ld.so in a static executable because it is
uninitialized/dormant.

If you need functionality after static dlopen, it has to reside in
libc.so.6, not the dynamic loader.

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