From d785c8d144e15ebe78c0265f94d6e43edf0199e7 Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Sat, 14 May 2011 10:50:54 -0400 Subject: [PATCH] --ldd: turn bad-interpreter findings into warnings 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 | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/dwflpp.cxx b/dwflpp.cxx index 4b5387d09..4315d9f03 100644 --- a/dwflpp.cxx +++ b/dwflpp.cxx @@ -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 ldd_command; ldd_command.push_back("/usr/bin/env"); -- 2.43.5