DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
COFF link editor

Incremental link editing

As previously mentioned, the output of ld can be used as an input file to subsequent ld runs provided that the relocation information is retained in the initial run by using the -r option. With large applications, it may be desirable to partition the C programs into subsystems, link each subsystem independently, and then link edit the entire application.

The first two steps in the following example are described by giving an ld command line followed by the file of COFF ld directives that was used in that command. The third step is the final link edit.

   ld -r  -o outfile1  ifile1 infile1.o
   

/* ifile1 */ SECTIONS { ss1: { f1.o f2.o ... fn.o } }

Step 2:
   ld -r  -o outfile2  ifile2  infile2.o
   

/* ifile2 */ SECTIONS { ss2: { g1.o g2.o ... gn.o } }

Step 3:
   ld -o final.out outfile1 outfile2
By judiciously forming subsystems, applications may achieve a form of incremental link editing whereby it is necessary to relink only a portion of the total link edit when a few files are recompiled.

There are two simple rules to follow when applying this technique to incrementally link COFF files:


Next topic: DSECT, COPY, NOLOAD, INFO, and OVERLAY sections
Previous topic: Allocation algorithm

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003