Home

Awesome

The Universal Loader

This loader provides a unified Go interface for loading shared libraries from memory on Windows, OSX, and Linux.

Also included is a cross-platform Call() implementation that lets you call into exported symbols from those libraries without stress.

Basic Usage

libraryPath set to lib.so for Linux, lib.dyld for OSX, or lib.DLL for Windows, then:

	image, err = ioutil.ReadFile(libraryPath)
	...

	loader, err := universal.NewLoader()
	...

	library, err := loader.LoadLibrary("main", &image)
	...

	val, err := library.Call("Runme", 7)
	...

Complete working examples of usage can be found in the examples/ folder in this repo.

Features and Limitations

Supported Architectures

If you try this on any untested platforms, whether it works or not, let me know!