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