ldd: also use exec mode for -a

The -a option also requires passing specific environment variables to
instance of rtld doing tracing.

PR:	259069
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
This commit is contained in:
Konstantin Belousov 2021-11-15 22:45:51 +02:00
parent 3f9acedb02
commit 7d20a08076

View File

@ -236,7 +236,7 @@ main(int argc, char *argv[])
if (is_shlib == 0) {
execl(*argv, *argv, (char *)NULL);
warn("%s", *argv);
} else if (fmt1 == NULL && fmt2 == NULL) {
} else if (fmt1 == NULL && fmt2 == NULL && !aflag) {
dlopen(*argv, RTLD_TRACE);
warnx("%s: %s", *argv, dlerror());
} else {