9.6.7.5 Defined Built-in Function
The
DEFINED(symbol)
built-in function
return 1 if symbol
is in the linker global symbol table
and is defined; otherwise it returns 0. You can use this function to provide default values
for symbols. For example, the following script fragment shows how to set a global symbol
begin
to the first location in the .text
section, but if a symbol called begin
already existed, its value is
preserved:SECTIONS { ...
.text : {
begin = DEFINED(begin) ? begin : . ;
...
}
...
}