[PATCH] Cygwin: ldd: Also look for not found DLLs when exit status is non-zero

Jon Turney jon.turney@dronecode.org.uk
Thu Sep 10 12:27:40 GMT 2020

If the process exited with e.g. STATUS_DLL_NOT_FOUND, also process the
file to look for not found DLLs.

(We currently only do this when a STATUS_DLL_NOT_FOUND exception occurs,
which I haven't managed to observe)

This still isn't 100% correct, as it only examines the specified file
for missing DLLs, not recursively on the DLLs it depends upon.
 winsup/utils/ldd.cc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/winsup/utils/ldd.cc b/winsup/utils/ldd.cc
index e1af99e12..1e1863c1c 100644
--- a/winsup/utils/ldd.cc
+++ b/winsup/utils/ldd.cc
@@ -407,6 +407,8 @@ report (const char *in_fn, bool multiple)
+	  if (ev.u.ExitProcess.dwExitCode != 0)
+	    process_fn = fn_win;
 	  print_dlls (&dll_list, isdll ? fn_win : NULL, process_fn);
 	  exitnow = true;

More information about the Cygwin-patches mailing list