Documentation ¶
Overview ¶
Package dynlib provides routines for interacting with the glibc ld.so dynamic linker/loader.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // Debugf is a hook used for redirecting debug output. Debugf func(string, ...interface{}) )
Functions ¶
func FindLdSo ¶
FindLdSo returns the path to the `ld.so` dynamic linker for the current architecture, which is usually a symlink
func GetOsVersion ¶ added in v0.2201.9
GetOsVersion returns the operating system version (major, minor, pl).
func IsSupported ¶
func IsSupported() bool
IsSupported returns true if the architecture/os combination has dynlib support.
func ValidateLibraryClass ¶
ValidateLibraryClass ensures that the library matches the current architecture.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache is a representation of the `ld.so.cache` file.
func LoadCache ¶
LoadCache creates a new system shared library cache usually by loading and parsing the `/etc/ld.so.cache` file.
See `sysdeps/generic/dl-cache.h` in the glibc source tree for details regarding the format.
func (*Cache) GetLibraryPath ¶
GetLibraryPath returns the path to the given library, if any. This routine makes no attempt to disambiguate multiple libraries (eg: via hwcap/search path).
func (*Cache) ResolveLibraries ¶
func (c *Cache) ResolveLibraries(binaries []string, extraLibs []string, ldLibraryPath, fallbackSearchPath string, filterFn FilterFunc) (map[string][]string, error)
ResolveLibraries returns a map of library paths and their aliases for a given set of binaries, based off the ld.so.cache, libraries known to be internal, and a search path.
type FilterFunc ¶
FilterFunc is a function that implements a filter to allow rejecting dependencies when resolving libraries.