Expressions

The following functions are recognized during expression evaluation. Their names are case-insensitive.

absolute(expr)

Given a section-relative offset value, absolute returns the absolute address by adding the address of the containing section to value. It is an error to use absolute outside of a section contents section.

addr(section)

Returns the memory address of the section named section.

sizeof(section)

Returns the current size of the section name section.

align(expr)

Returns the current position ('.') aligned to a value boundary. This is equivalent to:

(. + expr - 1) & ~(expr -1)

pack_or_align(expr)

This is generally only used as the start_expression for a section map. It returns the current position (.) aligned such that the section will not span a page boundary of size value. This is equivalent to:

(. % value) + sizeof(this_section) > value ? align(value) : .

min(value1,value2)

max(value1,value2)

Returns the minimum or maximum, respectively, of the two values supplied.

error("string")

Generates a linker error, displaying string, as well as the current section's name and address, and the current section offset.

isdefined(symbol)

Returns 1 if a global symbol exists and is defined, 0 otherwise.

final(finalexpression [,earlyexpression=0])


Previous

Next



Copyright © 1999, Green Hills Software. All rights reserved.