Documentation
¶
Index ¶
- type DynamicSymbolsLoader
- type HostSymbolsLoader
- func (soLoader *HostSymbolsLoader) GetDynamicSymbols(soInfo ObjInfo) (map[string]bool, error)
- func (soLoader *HostSymbolsLoader) GetExportedSymbols(soInfo ObjInfo) (map[string]bool, error)
- func (soLoader *HostSymbolsLoader) GetImportedSymbols(soInfo ObjInfo) (map[string]bool, error)
- func (soLoader *HostSymbolsLoader) GetLocalSymbols(soInfo ObjInfo) (map[string]bool, error)
- type ObjID
- type ObjInfo
- type SymbolCategory
- type Symbols
- type UnsupportedFileError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DynamicSymbolsLoader ¶
type HostSymbolsLoader ¶
type HostSymbolsLoader struct {
// contains filtered or unexported fields
}
HostSymbolsLoader is responsible for efficient reading of shared object's symbols. The logic of the loader here is used on absolute paths, so container relative paths won't work here. This object operation requires the CAP_DAC_OVERRIDE to access files across the system.
func InitHostSymbolsLoader ¶
func InitHostSymbolsLoader(cacheSize int) *HostSymbolsLoader
func (*HostSymbolsLoader) GetDynamicSymbols ¶
func (soLoader *HostSymbolsLoader) GetDynamicSymbols(soInfo ObjInfo) (map[string]bool, error)
GetDynamicSymbols returns the union of imported and exported symbols of the shared object. The returned map is freshly allocated on every call and is safe for the caller to mutate.
func (*HostSymbolsLoader) GetExportedSymbols ¶
func (soLoader *HostSymbolsLoader) GetExportedSymbols(soInfo ObjInfo) (map[string]bool, error)
GetExportedSymbols returns the exported symbols of the shared object.
The returned map is freshly built per call from the cached internal store; callers may freely retain or mutate it.
func (*HostSymbolsLoader) GetImportedSymbols ¶
func (soLoader *HostSymbolsLoader) GetImportedSymbols(soInfo ObjInfo) (map[string]bool, error)
GetImportedSymbols returns the imported symbols of the shared object.
The returned map is freshly built per call from the cached internal store; callers may freely retain or mutate it.
func (*HostSymbolsLoader) GetLocalSymbols ¶
func (soLoader *HostSymbolsLoader) GetLocalSymbols(soInfo ObjInfo) (map[string]bool, error)
GetLocalSymbols returns the local symbols of the shared object.
The returned map is freshly built per call from the cached internal store; callers may freely retain or mutate it.
type SymbolCategory ¶
type SymbolCategory uint8
SymbolCategory is a bitmask describing how a symbol participates in a shared object: it may be Local, Imported, Exported, or any combination.
Using a bitmask keeps a single map entry per symbol name even when the same name belongs to multiple categories (e.g. an Exported symbol is also Local). Storing one entry instead of three independent map entries is the primary memory win behind the redesign tracked by issue #4761.
const ( CategoryLocal SymbolCategory = 1 << iota CategoryImported CategoryExported // CategoryDynamic is a convenience mask matching anything that appears in // the dynamic symbol table: imports plus exports. CategoryDynamic = CategoryImported | CategoryExported )
type Symbols ¶
type Symbols struct {
// contains filtered or unexported fields
}
Symbols holds the classified symbols of a single shared object.
Internally each unique symbol name maps to a SymbolCategory bitmask. Views onto a specific category (Local / Imported / Exported / Dynamic) are materialized on demand via View and are owned by the caller.
func (*Symbols) Has ¶
func (s *Symbols) Has(name string, mask SymbolCategory) bool
Has reports whether name matches any of the bits in mask.
func (*Symbols) View ¶
func (s *Symbols) View(mask SymbolCategory) map[string]bool
View returns a fresh map[string]bool of all names matching any of the bits in mask. The returned map is owned by the caller and is safe to mutate; it is recomputed on every call.
View allocates a fresh map on every call by design. The layout collapses three parallel maps (Local / Imported / Exported) into one bitmask-backed store, saving two map headers and bucket arrays per cached Symbols. Callers that iterate the same category repeatedly should cache the returned map.
type UnsupportedFileError ¶
type UnsupportedFileError struct {
// contains filtered or unexported fields
}
func InitUnsupportedFileError ¶
func InitUnsupportedFileError(err error) *UnsupportedFileError
func (*UnsupportedFileError) Error ¶
func (fileTypeErr *UnsupportedFileError) Error() string
func (*UnsupportedFileError) Unwrap ¶
func (fileTypeErr *UnsupportedFileError) Unwrap() error