Shared libraries support

shared_library.rb is a copy from exectuable.rb, they need a refactoring to reuse code.