REFERENCE_TYPE

To support the lazy binding of undefined symbols in the dynamic link-editor, the undefined symbols in the symbol table (the nlist structures) are marked with the indication if the undefined reference is a lazy reference or non-lazy reference. If both a non-lazy reference and a lazy reference is made to the same symbol the non-lazy reference takes precedence. A reference is lazy only when all references to that symbol are made through a symbol pointer in a lazy symbol pointer section.

The implementation of marking nlist structures in the symbol table for undefined symbols will be to use some of the bits of the n_desc field as a reference type. The mask REFERENCE_TYPE will be applied to the n_desc field of an nlist structure for an undefined symbol to determine the type of undefined reference (lazy or non-lazy).

The constants for the REFERENCE FLAGS are propagated to the reference table in a shared library file. In that case the constant for a defined symbol, REFERENCE_FLAG_DEFINED, is also used.

Values

ValueMeaning
REFERENCE_TYPE0x7

Reference type bits of the n_desc field of undefined symbols

REFERENCE_FLAG_UNDEFINED_NON_LAZY0

types of references

REFERENCE_FLAG_UNDEFINED_LAZY1

Ditto

REFERENCE_FLAG_DEFINED2

Ditto

REFERENCE_FLAG_PRIVATE_DEFINED3

Ditto

REFERENCE_FLAG_PRIVATE_UNDEFINED_NON_LAZY4

Ditto

REFERENCE_FLAG_PRIVATE_UNDEFINED_LAZY5

Ditto

REFERENCED_DYNAMICALLY0x0010

To simplify stripping of objects that use are used with the dynamic link editor, the static link editor marks the symbols defined an object that are referenced by a dynamicly bound object (dynamic shared libraries, bundles). With this marking strip knows not to strip these symbols.

Meta