Chapter 6 Using Linker

6.4.3Operation Examples

The following are examples of section layouts using the OVL option for the five relocatable object files, main.rf, sub.rf, prog1.rf, prog2.rf, and prog3.rf, in the current directory. All files contain multiple CODE and DATA sections.

Assigning to different addresses in instruction RAM

ld103 -T @CODE=80000000 -T @DATA=1000 main.rf sub.rf

-OVL 1:_TEXT=40001000 prog1.rf -OVL 2:_TEXT=40002000 prog2.rf

-OVL 3:_TEXT=40003000 prog3.rf

The linker first places all sections with the CODE attribute from main.rf and sub.rf in the order that they appear in the input files, beginning at the address 80000000 (hex.). It places all sections with the DATA attribute from all input files beginning at the address 1000 (hex.).

The linker places all sections other than those named _TEXT after the same sections in main.rf and sub.rf according to the -T option placement rules. (See Section 6.3.3.)

The linker resolves all internal references within the _TEXT sections of prog1.rf, prog2.rf, and prog3.rf so that the sections are ready to run in the specified instruction RAM addresses above 40000000 (hex.), but places the sections in the order that they appear in the input files, beginning at the address following the end of the sections with the CODE attribute as placed with the T option.

Finally, at the address following the end of all segments in external memory with the CODE option, the linker creates the instruction RAM program management table used by the routine for copying sections to instruction RAM.

Assignment to the same address in instruction RAM

ld103 -T @CODE=80000000 -T@DATA=1000 main.rf sub.rf

-OVL 1:_TEXT=40000000 prog1.rf -OVL 2:_TEXT=40000000 prog2.rf

-OVL 3:_TEXT=40000000 prog3.rf

The linker first places all sections with the CODE attribute from main.rf and sub.rf in the order that they appear in the input files, beginning at the address 80000000 (hex.). It places all sections with the DATA attribute from all input files beginning at the address 1000 (hex.).

The linker places all sections other than those named _TEXT after the same sections in main.rf and sub.rf according to the T option placement rules. (See Section 6.3.3.)

The linker resolves all internal references within the _TEXT sections of prog1.rf, prog2.rf, and prog3.rf so that the sections are ready to run at the instruction RAM address 40000000 (hex.), but places the sections in the order that they appear in the input files, beginning at the address following the end of the sections with the CODE attribute as placed with the T option.

Finally, at the address following the end of all segments in external memory with the CODE option, the linker creates the instruction RAM program management table used by the routine for copying sections to instruction RAM.

114 Instruction RAM Support

Page 126
Image 126
Panasonic MN1030 user manual Operation Examples, Assigning to different addresses in instruction RAM