This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 5/5][v2][BZ #15022] Remove dead DL_DST_REQ_STATIC code
- From: "Maciej W. Rozycki" <macro at codesourcery dot com>
- To: Roland McGrath <roland at hack dot frob dot com>
- Cc: <libc-alpha at sourceware dot org>
- Date: Sat, 22 Jun 2013 00:44:53 +0100
- Subject: Re: [PATCH 5/5][v2][BZ #15022] Remove dead DL_DST_REQ_STATIC code
- 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> <20130619234127 dot EF2602C0B4 at topped-with-meat dot com>
On Thu, 20 Jun 2013, Roland McGrath wrote:
> That is fine. It is not related to bug 15022 and does not depend on the
> previous patches in the series, so normal procedure would have been to post
> it separately from the series.
Yeah, I think you're right, this should have really been standalone,
sorry. Thanks for your review. I have applied this change now.
While double-checking that I haven't missed anything here I've spotted
another place where there's something odd about DL_DST_REQUIRED. It is a
reference in _dl_init_paths where we have this:
#ifdef SHARED
/* This points to the map of the main object. */
l = GL(dl_ns)[LM_ID_BASE]._ns_loaded;
if (l != NULL)
{
[...]
}
#endif /* SHARED */
[...]
#ifdef SHARED
[...]
/* Determine the length of the substituted string. */
size_t total = DL_DST_REQUIRED (l, llp, strlen (llp), cnt);
[...]
so clearly this code is somehow prepared for a missing main map in the
shared case even though DL_DST_REQUIRED has never been and will crash in
that case.
I can see in the sources that _dl_init_paths is only called from two
sites -- _dl_non_dynamic_init, that clearly doesn't apply here, and
dl_main. In the latter case the call is only made after the main map has
already been initialised. So perhaps that "if (l != NULL)" quoted above
can really be "assert (l != NULL)"? I'll send a patch proposal if so.
Maciej