An output file that has been linked can be linked again with additional modules. This is known as partial linking or incremental linking. Partial linking allows you to partition large applications, link each part separately, and then link all the parts together to create the final executable program.
Follow these guidelines for producing a file that you will relink:
Since the ELF object file format is used, input sections are not combined into output sections during a partial link unless a matching SECTIONS directive is specified in the link step command file.
The following example shows how you can use partial linking:
Step 1: | Link the file file1.com; use the --relocatable option to retain relocation information in the output file tempout1.out.
cl6x --run_linker --relocatable --output_file=tempout1 file1.com
file1.com contains:
SECTIONS
|
Step 2: | Link the file file2.com; use the --relocatable option to retain relocation information in the output file tempout2.out.
cl6x --run_linker --relocatable --output_file=tempout2 file2.com
file2.com contains:
SECTIONS
|
Step 3: | Link tempout1.out and tempout2.out.
cl6x --run_linker --map_file=final.map --output_file=final.out tempout1.out tempout2.out
|