We don't ever want library-path searching for the probe module, but
that's what dlopen will do if there's no '/' in the filename.
* stapdyn/stapdyn.cxx (main): If the module has no path component, give
it the minimum "./" leader.
}
}
+ string module_str;
if (optind == argc - 1)
- module = argv[optind];
+ {
+ module_str = argv[optind];
+
+ // dlopen does a library-path search if the filename doesn't have any
+ // path components. We never want that, so give it a minimal ./ path.
+ if (module_str.find('/') == string::npos)
+ module_str.insert(0, "./");
+ module = module_str.c_str();
+ }
if (!module)
usage (1);