]> sourceware.org Git - systemtap.git/commitdiff
--ldd: turn bad-interpreter findings into warnings
authorFrank Ch. Eigler <fche@redhat.com>
Sat, 14 May 2011 14:50:54 +0000 (10:50 -0400)
committerFrank Ch. Eigler <fche@redhat.com>
Sat, 14 May 2011 14:50:54 +0000 (10:50 -0400)
A semantic_error is too heavy.  We can just skip the --ldd processing
for these binaries and move on.

* dwflpp.cxx (iterate_over_libraries): Print (suppressible) warning
  instead of throwing a semantic_error if the module interpreter is
  not in our whitelist.

dwflpp.cxx

index 4b5387d0932dad1c61de8ccf93be0a1ad699ad64..4315d9f032d4c98832e41efc16cc69b40fe2573a 100644 (file)
@@ -1082,13 +1082,18 @@ dwflpp::iterate_over_libraries (void (*callback)(void *object, const char *arg),
   // If it gets cumbersome to maintain this whitelist, we could just check for
   // startswith("/lib/ld") || startswith("/lib64/ld"), and trust that no admin
   // would install untrustworthy loaders in those paths.
-  if (interpreter != "/lib/ld.so.1"     // ppc / s390
-      && interpreter != "/lib64/ld64.so.1"
-      && interpreter != "/lib/ld-linux-ia64.so.2" // ia64
-      && interpreter != "/emul/ia32-linux/lib/ld-linux.so.2"
-      && interpreter != "/lib64/ld-linux-x86-64.so.2"   // x8664
-      && interpreter !=  "/lib/ld-linux.so.2")          // x86
-    throw semantic_error(_F("unsupported interpreter: %s", interpreter.c_str()));
+  if ((interpreter != "/lib/ld.so.1"     // ppc / s390
+       && interpreter != "/lib64/ld64.so.1"
+       && interpreter != "/lib/ld-linux-ia64.so.2" // ia64
+       && interpreter != "/emul/ia32-linux/lib/ld-linux.so.2"
+       && interpreter != "/lib64/ld-linux-x86-64.so.2"   // x8664
+       && interpreter !=  "/lib/ld-linux.so.2"))          // x86
+    {
+      if (! sess.suppress_warnings)
+        sess.print_warning (_F("module %s --ldd skipped: unsupported interpreter: %s",
+                               module_name.c_str(), interpreter.c_str()));
+      return;
+    }
 
   vector<string> ldd_command;
   ldd_command.push_back("/usr/bin/env");
This page took 0.030887 seconds and 5 git commands to generate.