From 9ef010738f501ba55a468dbbe0cde785915cfb1a Mon Sep 17 00:00:00 2001 From: Shaun Jackman Date: Wed, 2 Jan 2019 10:25:10 -0800 Subject: [PATCH] needed_libraries: Fix cannot find section .dynamic Fix the error `cannot find section .dynamic` when needed_libraries is called on a static ELF executable. --- Library/Homebrew/os/linux/elf.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Library/Homebrew/os/linux/elf.rb b/Library/Homebrew/os/linux/elf.rb index 82789cb570..e73f8154a2 100644 --- a/Library/Homebrew/os/linux/elf.rb +++ b/Library/Homebrew/os/linux/elf.rb @@ -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]