This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
glibc initialization question
- From: Steve Ellcey <sellcey at cavium dot com>
- To: libc-help at sourceware dot org
- Date: Mon, 17 Sep 2018 16:09:36 -0700
- Subject: glibc initialization question
- Reply-to: sellcey at cavium dot com
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