Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Mac OS Runtime Architectures /
Chapter 8 - PEF Structure / The Loader Section


Imported Libraries and Symbols

The loader section must describe every import library required by the fragment and the symbols imported from those libraries. The following two sections describe the format of these descriptions.

Imported Library Descriptions

An imported library description, which contains information about a required import library, is of fixed size (24 bytes) and has the form shown in Listing 8-4.

Listing 8-4 Imported library description data structure

struct PEFImportedLibrary {
   UInt32nameOffset;     
   UInt32oldImpVersion;  
   UInt32currentVersion; 
   UInt32importedSymbolCount; 
   UInt32firstImportedSymbol; 
   UInt8 options;        
   UInt8 reservedA;      
   UInt16reservedB;      
};
The fields of the description are as follows:

The Imported Symbol Table

The imported symbol table is an array of imported symbol entries. Symbols imported from the same library are grouped together in the table, but they may appear in any order within that grouping. A table entry is of fixed size (4 bytes) and has the form shown in Figure 8-7.

Figure 8-7 An imported symbol table entry

The elements of the table entry are as follows:

The symbol class byte of an imported symbol entry is structured as shown in Figure 8-8.

Figure 8-8 A symbol class field

For imported symbols, the high-order flag bit (mask 0x80) indicates whether the symbol is weak. When this bit is set, the imported symbol does not have to be present at fragment preparation time in order for execution to continue. However, your code must check that the imported symbol exists before attempting to use it. The other flag bits are currently reserved.

The symbol classes are defined in Table 8-3. The symbol classes are used for annotation only.
Table 8-3 Symbol classes
Class nameValueDescription
kPEFCodeSymbol0A code address
kPEFDataSymbol1A data address
kPEFTVectSymbol2A standard procedure pointer
kPEFTOCSymbol3A direct data area (Table of Contents ) symbol
kPEFGlueSymbol4A linker-inserted glue symbol


Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 MARCH 1997