ldd

package
v0.14.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2024 License: BSD-3-Clause Imports: 6 Imported by: 118

Documentation

Overview

ldd returns library dependencies of an executable.

The way this is done on GNU-based systems is interesting. For each ELF, one finds the .interp section. If there is no interpreter there's not much to do.

If there is an interpreter, we run it with the --list option and the file as an argument. We need to parse the output. For all lines with => as the 2nd field, we take the 3rd field as a dependency.

On many Unix kernels, the kernel ABI is stable. On OSX, the stability is held in the library interface; the kernel ABI is explicitly not stable. The ldd package on OSX will only return the files passed to it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FList added in v0.12.0

func FList(names ...string) ([]string, error)

FList returns a list of all library dependencies for a set of files, including following symlinks.

If a file has no dependencies, that is not an error. The only possible error is if a file does not exist, or it says it has an interpreter but we can't read it, or we are not able to run its interpreter.

It's not an error for a file to not be an ELF.

func GetInterp

func GetInterp(file string) (string, error)

func LdSo

func LdSo(bit64 bool) (string, error)

LdSo finds the loader binary.

func List

func List(names ...string) ([]string, error)

List returns a list of all library dependencies for a set of files.

If a file has no dependencies, that is not an error. The only possible error is if a file does not exist, or it says it has an interpreter but we can't read it, or we are not able to run its interpreter.

It's not an error for a file to not be an ELF.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL