Index: GenLibDeps.pl
===================================================================
--- GenLibDeps.pl	(revision 79423)
+++ GenLibDeps.pl	(working copy)
@@ -117,9 +117,9 @@
       }
     }
   }
-  close UNDEFS or die "nm failed";
   unless(keys %DepLibs) {
     # above failed
+    close UNDEFS;
     open UNDEFS, "$nmPath -u $Directory/$lib |";
     while (<UNDEFS>) {
       # to bypass non-working sed
@@ -142,8 +142,8 @@
         }
       }
     }
-    close UNDEFS or die "nm failed";
   }
+  close UNDEFS or die "nm failed";
 
   for my $key (sort keys %DepLibs) {
     if ($FLAT) {
