needed_libraries: Fix cannot find section .dynamic

Fix the error `cannot find section .dynamic` when needed_libraries is
called on a static ELF executable.
This commit is contained in:
Shaun Jackman 2019-01-02 10:25:10 -08:00
parent 74b0adeb3f
commit 9ef010738f

View File

@ -117,6 +117,8 @@ module ELFShim
end
def needed_libraries_using_patchelf(path)
return [nil, []] unless path.dynamic_elf?
patchelf = DevelopmentTools.locate "patchelf"
if path.dylib?
command = [patchelf, "--print-soname", path.expand_path.to_s]