[PATCH] ld.so: ldd crashes when __LDSO_SEARCH_INTERP_PATH__ is not #defined
Rob Landley
rob at landley.net
Mon Nov 22 04:32:49 UTC 2010
On Monday 15 November 2010 15:50:38 Bernhard Reutner-Fischer wrote:
> On Mon, Nov 15, 2010 at 02:14:00PM -0500, Mark Mentovai wrote:
> >Poke?
> >
> >This is a simple fix to a reproducible crash. I’m surprised it hasn’t been
> > committed, or if there’s a problem with the patch, that it hasn’t been
> > raised.
>
> I didn't look in detail yet but it sounds like it penalized
> LDSO_SEARCH_INTERP_PATH more than it ought to (i.e. there must be a
> better way).
Um, the patch is inside if (trace_loaded_objects) and prints out crap to
stdout:
> >> if (trace_loaded_objects) {
> >> - _dl_dprintf(1, "\t%s => %s (%x)\n",
> >> - rpnt->dyn->libname + _dl_strlen(_dl_ldsopath) + 1,
> >> - rpnt->dyn->libname, DL_LOADADDR_BASE(rpnt->dyn->loadaddr));
> >> + /* glibc ld.so/ldd would just do
> >> + * _dl_dprintf(1, "\t%s (%x)\n", rpnt->dyn->libname,
> >> + * DL_LOADADDR_BASE(rpnt->dyn->loadaddr));
> >> + * but uClibc has always used the => format. */
> >> + char *ptmp = _dl_strrchr(rpnt->dyn->libname, '/');
> >> + if (ptmp != rpnt->dyn->libname)
> >> + ++ptmp;
> >> + _dl_dprintf(1, "\t%s => %s (%x)\n", ptmp, rpnt->dyn->libname,
> >> + DL_LOADADDR_BASE(rpnt->dyn->loadaddr));
> >> _dl_exit(0);
> >> }
> >> #endif
This is a performance-critical codepath?
Rob
--
GPLv3: as worthy a successor as The Phantom Menace, as timely as Duke Nukem
Forever, and as welcome as New Coke.
More information about the uClibc
mailing list