elf: fix caching of dynamic_elf?

This commit is contained in:
Cheng XU 2019-07-17 16:57:01 +08:00
parent a98bbbc644
commit 3ab93b6e2b
No known key found for this signature in database
GPG Key ID: B19F15830AB4E690

View File

@ -71,7 +71,7 @@ module ELFShim
def dynamic_elf?
return @dynamic_elf if defined? @dynamic_elf
if which "readelf"
@dynamic_elf = if which "readelf"
Utils.popen_read("readelf", "-l", to_path).include?(" DYNAMIC ")
elsif which "file"
!Utils.popen_read("file", "-L", "-b", to_path)[/dynamic|shared/].nil?