[PATCH] usertools/pmdinfo: remove dependency to ldd
Olivier Matz
olivier.matz at 6wind.com
Fri Oct 14 16:02:00 CEST 2022
Hi Robin,
On Thu, Oct 13, 2022 at 03:41:25PM +0200, Robin Jarry wrote:
> Some environments (buildroot) do not have the ldd utility installed by
> default. However, ldd is often only a wrapper shell script that actually
> checks that the arguments are valid ELF files and executes them with
> the LD_TRACE_LOADED_OBJECTS=1 variable set in the environment.
>
> Since ld.so is the actual ELF interpreter which is loaded first when
> executing a program, executing any dynamic ELF program/library with that
> variable set will cause all dependent dynamic libraries to be printed
> and ld.so will exit before even running main.
>
> Excerpt from ld.so(7) man page:
>
> LD_TRACE_LOADED_OBJECTS
> If set (to any value), causes the program to list its dynamic
> dependencies, as if run by ldd(1), instead of running normally.
>
> Change dpdk-pmdinfo.py to actually "execute" the files provided on the
> command line with LD_TRACE_LOADED_OBJECTS=1 set. Ensure that the files
> are valid dynamically executable ELF programs to avoid obscure and
> confusing errors.
>
> Reported-by: Olivier Matz <olivier.matz at 6wind.com>
> Signed-off-by: Robin Jarry <rjarry at redhat.com>
Tested on buildroot without ldd.
Reviewed-by: Olivier Matz <olivier.matz at 6wind.com>
More information about the dev
mailing list