From 287c4364e2bc41b8a52304a5382253088c0342ac Mon Sep 17 00:00:00 2001 From: Hal Clark Date: Thu, 4 Aug 2022 14:50:25 -0700 Subject: [PATCH] Filter out VDSO obj and interpreter --- src/core/elf_file.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/core/elf_file.cpp b/src/core/elf_file.cpp index 170ff05..bcacc55 100644 --- a/src/core/elf_file.cpp +++ b/src/core/elf_file.cpp @@ -217,7 +217,23 @@ namespace linuxdeploy { const boost::regex expr(R"(\s*(.+)\s+\=>\s+(.+)\s+\((.+)\)\s*)"); boost::smatch what; - for (const auto& line : util::splitLines(result.stdout_string())) { + auto lddLines = util::splitLines(result.stdout_string()); + + // filter known-problematic, known-unneeded lines + // see https://github.com/linuxdeploy/linuxdeploy/issues/210 + lddLines.erase( + std::remove_if(lddLines.begin(), lddLines.end(), [&lddLines](auto line) { + if (util::stringContains(line, "linux-vdso.so") || util::stringContains(line, "ld-linux-")) { + ldLog() << LD_DEBUG << "skipping linker related object" << line << std::endl; + return true; + } + + return false; + }), + lddLines.end() + ); + + for (const auto& line : lddLines) { if (boost::regex_search(line, what, expr)) { auto libraryPath = what[2].str(); util::trim(libraryPath);