This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 1/5][v2][BZ #15022] Avoid repeated calls to DL_STATIC_INIT
- From: Roland McGrath <roland at hack dot frob dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: "Maciej W. Rozycki" <macro at codesourcery dot com>, GNU C Library <libc-alpha at sourceware dot org>
- Date: Thu, 20 Jun 2013 13:47:40 -0700 (PDT)
- Subject: Re: [PATCH 1/5][v2][BZ #15022] Avoid repeated calls to DL_STATIC_INIT
- References: <alpine dot DEB dot 1 dot 10 dot 1301152056590 dot 4834 at tp dot orcam dot me dot uk> <20130116215545 dot 7A37A2C0B0 at topped-with-meat dot com> <alpine dot DEB dot 1 dot 10 dot 1301240655220 dot 4834 at tp dot orcam dot me dot uk> <20130531200059 dot C94C02C077 at topped-with-meat dot com> <alpine dot DEB dot 1 dot 10 dot 1306140202520 dot 16287 at tp dot orcam dot me dot uk> <20130619233103 dot A913F2C0A6 at topped-with-meat dot com> <CAMe9rOpR6OGW6CfrG5NN2HPM_=tW-1om4Y_dFVXmUk2h5xg6sQ at mail dot gmail dot com>
> The difference between calling from dl_open_worker
> and _dl_open is nested locks, which may be a problem.
That's a good point to raise. But it looks like it's not actually a
problem. Both _dl_static_init implementations have their own private
lock (though it's not clear to me why they actually need one at all).
They call _dl_lookup_symbol_x directly, which does not do any locking
of its own (it expects its callers to have serialized access to the
data structures it uses).
So I think we can go ahead with macro's change unless anybody else
sees a concrete problem.
Thanks,
Roland