Download TR0105 TSK51x/TSK52x Embedded Tools Reference

Transcript
Linker Script Language
7.3.5
Built−in Functions
function_call
::=
|
|
|
|
|
absolute ( expr )
addressof ( addr_id )
exists ( section_name )
max ( expr , expr )
min ( expr , expr )
sizeof ( size_id )
addr_id
::= sect : section_name
| group : group_name
size_id
::= sect : section_name
| group : group_name
| mem : mem_name
• Every space, bus, memory, section or group your refer to, must be defined in the LSL file.
• The addressof() and sizeof() functions with the group or sect argument can only be used in the right hand side of an
assignment. The sizeof() function with the mem argument can be used anywhere in section layouts.
You can use the following built−in functions in expressions. All functions return a numerical value. This value is a 64−bit signed
integer.
absolute()
int absolute( expr )
Converts the value of expr to a positive integer.
absolute( "labelA"−"labelB" )
addressof()
int addressof( addr_id )
Returns the address of addr_id, which is a named section or group. To get the offset of the section with the name asect:
addressof( sect: "asect")
This function only works in assignments.
exists()
int exists( section_name )
The function returns 1 if the section section_name exists in one or more object file, 0 otherwise. If the section is not present in
input object files, but generated from LSL, the result of this function is undefined.
To check whether the section mysection exists in one of the object files that is specified to the linker:
exists( "mysection" )
max()
int max( expr, expr )
Returns the value of the expression that has the largest value. To get the highest value of two symbols:
max( "sym1" , "sym2")
7−5