[PATCH v6] usertools: rewrite pmdinfo

Bruce Richardson bruce.richardson at intel.com
Wed Sep 28 12:53:04 CEST 2022


On Wed, Sep 28, 2022 at 08:51:39AM +0200, Robin Jarry wrote:
> Bruce Richardson, Sep 26, 2022 at 17:17:
> > > * fixed typo: /etc/ld.so.conf/*.conf -> /etc/ld.so.conf.d/*.conf
> >
> > I am a little uncertain about doing this parsing, and worried it may be a
> > bit fragile. The main file for ld.so still is ld.so.conf, which, on my
> > system anyway, does indeed just have an include for *.conf in the .d
> > directory. However, is it possible that there are systems out there that
> > still have entries in ld.so.conf and possibly elsewhere?
> >
> > I think my preference would still be to shell out to ldconfig and query its
> > database, or to shell out to ldd to get the dependencies of a .so from
> > there. I just think it may be more robust, but at the cost of running some
> > shell commands.
> >
> > However, I don't feel strongly about this, so if others prefer the
> > pure-python ld.so.conf parsing approach better, I'm ok with that.
> 
> I was also concerned with parsing ld.so.conf files. However, I did not
> find a way to get ldconfig simply to print the folders that are to be
> analyzed. This would require some regexp parsing of ldconfig output:
> 
>   ldconfig -vNX 2>/dev/null | sed -nre 's,^(/.*): \(from .*\)$,\1,p'
> 
> I don't know which way is the least hacky.
>
How about "ldconfig -p" and just using the list of libraries given to match
against those requested in the elf file, rather than worrying about
directories at all?


More information about the dev mailing list