43
8.2. Errors in the Linker XLINK
If an error occurs while you are executing the linker XLINK, correct the project according to
the displayed messages.
The following describes the errors that are frequently encountered in the linker and the
corrective actions to be taken.
z Error[e16]
If data cannot all fit into a segment, XLINK outputs the following error.
Error[e16]: Segment
Segment
is too long for segment definition.
In this case, change the segment size or move the segment to another location. Note,
however, that the following segments cannot be moved out of page 0.
ZPAGE, Z_UDATA, Z_IDATA, C_ARGZ, EXPR_STACK, INT_EXPR_STACK
The Z_UDATA, Z_IDATA and C_ARGZ segments are the segments in which variables
are located. By attaching npage to any variable, you can move that variable to the
N_UDATA, N_IDATA or C_ARGZ segment. However, do not forget npage in the
external declaration of the function that references the variable and in the prototype
declaration as well.
z Error[e18]
If the data located in page N is accessed in zero-page addressing mode, the error shown
below occurs.
Error[e18]: Range error in (
module
), segment
segment
at address
address
. Value
value
, in tag
tag
, is out of bounds (0x0-0xff)
In this case, relocate the data in page N to page 0 or change the method by which the
data is referenced.
Method of relocating the data in page N to page 0:
In C sources, attach zpage when defining the location.
In assembler sources, make sure the relevant symbol will be located in page 0
Method of reference when located in page N:
In C sources, attach npage when defining the function externally. If npage is
specified in the argument to the function, npage is also required for the prototype
Comentários a estes Manuais