Crossware

Table of Contents        Previous topic       Next topic       

LINKER->Linker Command Line Options->Specify Segment Addresses and Order (/CODE /XDATA /IDATA /DATA /BIT)

These options allow the location addresses of specific segments to be specified and for segments in the same address space to be placed in a particular order relative to each other.  The format for the options is:

/[address space]([segment list])

where [address space] is one of CODE, XDATA, IDATA DATA or BIT

[segment list] is a comma separated list specifying the segment name and optionally the required location address in the following format:

[segment name]([base address])
The base address should be specified in hexadecimal.

If the base address is omitted, the segment is placed immediately following the preceding segment in the list.  If none of the segments in the list specify a base address, then the option serves to order the segments and the linker will place then a convenient location.

As an example of the use of these options, suppose the target system has 256 bytes of battery backed-up ram located at decimal address 1024.  XDATA relocatable segments named as BBR1, BBR2 and BBR3 can be forced to use this ram space via the option:

/XDATA(BBR1(400),BBR2,BBR3)

Segment BBR1 will begin at external ram address 400 hex.  Segment BB2 will be located immediately above segment BBR1 and segment BBR3 will be placed immediately above segment BBR2.

The link map can be examined to ensure that the combined size of these three segments does not exceed 256 bytes.

When using the /BIT option, the base address should specify the bit address.

These options allow fine tuning for specific target board configurations.  They are not normally required when using the C compiler when the /ROM, /XRAM and /IRAM options usually give sufficient control.

To specify segment locations from within the Crossware Embedded Development Studio, select settings from the Build menu.  Select the Linker tab and click on the Advanced button.  You can then enter segment location and ordering information into the tree structure that appears.