You copied the Doc URL to your clipboard.
The ScatterAssert(
function
can be used at the top level, or within a load region. It is evaluated
after the link has completed and gives an error message if expression
)
evaluates
to false.expression
The load address related functions can only be used within
the ScatterAssert
function. They map to the three
linker defined symbol values:
Function | Linker defined symbol value |
---|---|
LoadBase( |
Load$$ |
LoadLength( |
Load$$ |
LoadLimit( |
Load$$ |
The parameter
can
be either a load or an execution region name. Forward references are
not permitted. The region_name
can
only refer to load or execution regions that have already been defined.region_name
The following example shows how to use the ScatterAssert
function
to write more complex size checks than those permitted by the
of
the region:max_size
LR1 0x8000 { ER0 +0 { *(+RO) } ER1 +0 { file1.o(+RW) } ER2 +0 { file2.o(+RW) } ScatterAssert((LoadLength(ER1) + LoadLength(ER2)) < 0x1000) ; LoadLength is compressed size ScatterAssert((ImageLength(ER1) + ImageLength(ER2)) < 0x2000) ; ImageLength is uncompressed size } ScatterAssert(ImageLength(LR1) < 0x3000) ; Check uncompressed size of LoadRegion
- Concepts
- Reference
Using the Linker: