glibc initialization question

Steve Ellcey sellcey@cavium.com
Mon Sep 17 23:09:00 GMT 2018



I have a question about how ARCH_INIT_CPU_FEATURE is called in a
shared vs. non-shared glibc.  I think I knew this once but I can't
remember how it worked.  When SHARED is not set and we are
building a static glibc, LIBC_START_MAIN calls ARCH_INIT_CPU_FEATURE
to do the various initialization.  What I can't figure out is how 
ARCH_INIT_CPU_FEATURE is called for a shared glibc.  I am assuming
that a static constructor function is put into the shared glibc
somewhere and that calls ARCH_INIT_CPU_FEATURE, but I can't find
where that would be happening.  Can someone point me to the right
place or explain how it works if it isn't done via a static
constructor?  I see the comment in LIBC_START_MAIN about _dl_start_user
but I don't see how _dl_start or _dl_start_user gets me to
ARCH_INIT_CPU_FEATURE.

Steve Ellcey
sellcey@cavium.com



More information about the Libc-help mailing list