ADDR

Returns the address of the named section or memory segment.

  ADDR (sectionName | segmentName)  
Parameters

sectionName

Identifier for a file section.

segmentName

Identifier for a memory segment

Example

The code of the following listing uses the ADDR function to assign the address of ROOT to the symbol __rootbasecode.

Listing: ADDR() Function
MEMORY{
    ROOT  (RWX) : ORIGIN = 0x80000400, LENGTH = 0

}

SECTIONS{

  .code :

  {

  __rootbasecode = ADDR(ROOT);

     *.(text);

  } > ROOT



}