Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/ffi/dynamic_library.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def self.try_load(libname, flags, errors)

# LoadError for C ext & JRuby, RuntimeError for TruffleRuby
rescue LoadError, RuntimeError => ex
if ex.message =~ /(([^ \t()])+\.so([^ \t:()])*):([ \t])*(invalid ELF header|file too short|invalid file format)/
if ex.message =~ /(([^ \t()'])+\.so([^ \t:()'])*)[:']([ \t\(])*(invalid ELF header|file too short|invalid file format|not a mach-o file)/
if File.binread($1) =~ /(?:GROUP|INPUT) *\( *([^ \)]+)/
return try_load($1, flags, errors)
end
Expand Down
2 changes: 1 addition & 1 deletion spec/ffi/library_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class StructUCDP < FFI::Struct
}.to raise_error(LoadError)
end

it "interprets INPUT() in loader scripts", unless: FFI::Platform.windows? do
it "interprets INPUT() in linker scripts", unless: FFI::Platform.windows? do
path = File.dirname(TestLibrary::PATH)
file = File.basename(TestLibrary::PATH)
script = File.join(path, "ldscript.so")
Expand Down