[PATCH] ld.so: Support showing target info in ldd output
Yury Khrustalev
yury.khrustalev@arm.com
Thu Nov 19 10:42:06 GMT 2026
On Wed, Nov 18, 2026 at 08:33:08AM -0300, Adhemerval Zanella Netto wrote:
>
> ...
>
> > This is good point. The options that I suggest:
> >
> > a. Change LD_TRACE_LOADED_OBJECTS=1 to 2 in the ldd script if --verbose is used.
> > b. Add new ldd option to set LD_TRACE_LOADED_OBJECTS=2 (e.g. --program).
> > c. Leave it as is since this is documented behaviour of LD_TRACE_LOADED_OBJECTS.
>
> I would make it part of the new option you propose below, which is (b).
> That way 'ldd -v' output does not change either.
The help message for the '-v' option is:
-v, --verbose print all information
So we probably have to change output for '-v' as well.
> >
> > ...
> >
> > What do you think?
> >
> > ldd --target-info ./some/path/to/program
> >
> > would be the same as
> >
> > LD_TRACE_LOADED_OBJECTS=2 \
> > LD_TARGET_INFO=1 \
> > /path/to/elf/ld.so ./some/path/to/program
> >
> > With non-empty LD_TARGET_INFO triggering printing of the properties.
> >
> I agree a new ldd option is better than -v, since it leaves both the default and
> the -v output unchanged. But I would prefer not to add a new LD_* variable
> for this, though.
Do you mean a new command line option for 'ld.so' rather than 'ldd'?
Without either a new env variable or a new command line option, how
would 'ld.so' know that it needs to print extra target information?
More information about the Libc-alpha
mailing list