The object module format used by the Microsoft languages contains a
record type that is used to bind symbol definitions to symbol
references in other modules. This record is known as a "fixup." As
defined by Intel, the fixup record type contains no information as to
the type of data that is to be fixed up. Under certain circumstances,
this can cause unexpected and undesired binding at link time. The code
below demonstrates such an instance:
/*----- FILE1.C -----*/
void bar( void );
void main( void )
{
bar();
}
/*----- FILE2.C -----*/
int bar;
These files both compile without error. When compiled for a model with
a single code segment, linker error L2003 is produced saying that an
intersegment self-relative fixup was attempted. If a multiple code
segment model is used, no link errors are produced. Although a clean
link can be obtained, the resultant EXE does not perform as expected
due to the fact that the function reference of bar in FILE1.C has been
bound to the integer definition of bar in FILE2.C.
The linker has no way of determining the types of the reference to,
and definition of, bar. This is a limitation of the object file
format. If an include file was used to prototype bar and was then
included in both files, the compiler could have detected the
redefinition of bar.
This information applies to all versions of LINK.