Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ ldr_lookup_package(3) — OSF/1 SILVER Baselevel 4 rev36

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

load(3)

ldr_xlookup_package(3)

ldr_lookup_package(3)  —  Subroutines

OSF

NAME

ldr_lookup_package −  Returns the address of a symbol name in a package

LIBRARY

Standard C Library (libc.a)

SYNOPSIS

#include <loader.h>
void ∗ldr_lookup_package(
char∗package,
char ∗symbol_name);

PARAMETERS

packageSpecifies the name of the package that contains the symbol name. 

symbol_name
Specifies the name of the symbol whose address is required.

DESCRIPTION

The ldr_lookup_package() function returns the address of the specified symbol name within the specified package. 

NOTES

The loader employs a two-dimensional hierarchical symbol name space in which each symbol is represented by a package name, symbol name pair.  Packages are an abstraction that allows symbol resolution at the granularity of a library or fraction of a library without having to bind symbols to library names. 

Package names are attached to symbols at link time.  The set of symbols exported by a library is divided among one or more packages.  By default, a package name is derived from a library name, so that all symbols exported by a given library belong to the same package.  However, the programmer can attach symbols to arbitrary package names to create multiple packages within a library. 

When a module is linked against a library, the linker can derive the package name for each imported symbol from the package name associated with the corresponding exported symbol.  The programmer, however, can also assign arbitrary package names to imported symbols at link time. 

The package scheme avoids symbol name conflicts when more than one library exports the same symbol.  It assumes that each symbol name is unique within its package and that each package name is unique across the system.  Since each imported symbol includes a package name, the symbol name can be resolved unambiguously to the correct exported symbol. 

RETURN VALUES

Upon successful completion, the address of the specified symbol is returned.  Otherwise, null is returned and errno is set to indicate the error. 

ERRORS

If the ldr_lookup_package() function fails, errno may be set to one of the following values:

[ENOSYM]The specified package does not contain the specified symbol name. 

[ERANGE]The symbol value cannot be represented as an absolute value. 

[ENOPKG]The specified package name is not known in this process. 

RELATED INFORMATION

Functions: load(3), ldr_xlookup_package(3)

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026