17.01.2015 Views

Relocatable Object Module Format (OMF) Specification

Relocatable Object Module Format (OMF) Specification

Relocatable Object Module Format (OMF) Specification

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Relocatable</strong> <strong>Object</strong> <strong>Module</strong> <strong>Format</strong><br />

8CH EXTDEF—External Names Definition Record<br />

Description<br />

The EXTDEF record contains a list of symbolic external references—that is, references to symbols defined in<br />

other object modules. The linker resolves external references by matching the symbols declared in EXTDEF<br />

records with symbols declared in PUBDEF records.<br />

History<br />

In the Intel specification and older linkers, the Type Index field was used as an index into TYPDEF records. This<br />

is no longer true; the field now encodes Microsoft symbol and type information (see Appendix 1 for details.) Many<br />

linkers ignore the old style TYPDEF.<br />

Record <strong>Format</strong><br />

1 2 1 1 or 2 1<br />

8C Record String External Type Index Checksum<br />

Length Length Name String<br />

This record provides a list of unresolved references, identified by name and with optional associated type<br />

information. The external names are ordered by occurrence jointly with the COMDEF and LEXTDEF records, and<br />

referenced by an index in other records (FIXUPP records); the name may not be null. Indexes start from 1.<br />

String Length is a 1-byte field containing the length of the name field that follows it.<br />

The Type Index field is encoded as an index field and contains debug information.<br />

Notes<br />

For Microsoft compilers, all referenced functions of global scope and all referenced variables explicitly<br />

declared "extern" will generate an EXTDEF record.<br />

Many linkers impose a limit of 1023 external names and restrict the name length to a value between 1<br />

and 7FH.<br />

Any EXTDEF records in an object module must appear before the FIXUPP records that reference<br />

them.<br />

Resolution of an external reference is by name match (case sensitive) and symbol type match. The<br />

search looks for a matching name in the following sequence:<br />

1. Searches PUBDEF and COMDEF records.<br />

2. If linking a segmented executable, searches imported names (IMPDEF).<br />

3. If linking a segmented executable and not a DLL, searches for an exported name (EXPDEF) with the same<br />

name—a self-imported alias.<br />

4. Searches for the symbol name among undefined symbols. If the reference is to a weak extern, the default<br />

resolution is used. If the reference is to a strong extern, it's an undefined external, and the linker generates<br />

an error.<br />

28 <strong>OMF</strong> <strong>Specification</strong>, Version 1.1 Tool Interface Standards (TIS)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!