MCPcopy Create free account
hub / github.com/dmtcp/dmtcp / isStaticallyLinked

Method isStaticallyLinked

src/util_exec.cpp:316–340  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

314}
315
316bool
317Util::isStaticallyLinked(const char *filename)
318{
319 bool isElf, is32bitElf;
320 char pathname[PATH_MAX];
321
322 expandPathname(filename, pathname, sizeof(pathname));
323 elfType(pathname, &isElf, &is32bitElf);
324
325 int version = 2;
326 string cmd;
327 do {
328 cmd = ld_linux_so_path(version, is32bitElf);
329 version++;
330 } while (!jalib::Filesystem::FileExists(cmd) && version < 10);
331
332 cmd = cmd + " --verify " + pathname + " > /dev/null";
333
334 // FIXME: When tested on dmtcp/test/pty.c, 'ld.so -verify' returns
335 // nonzero status. Why is this? It's dynamically linked.
336 if (isElf && safeSystem(cmd.c_str())) {
337 return true;
338 }
339 return false;
340}
341
342static string
343getScreenDir()

Callers

nothing calls this directly

Calls 1

ld_linux_so_pathFunction · 0.85

Tested by

no test coverage detected