SPRUIG8J January 2018 – March 2024
The linker determines where output sections are allocated into memory; it must have a model of target memory to accomplish this. The MEMORY directive allows you to specify a model of target memory so that you can define the types of memory your system contains and the address ranges they occupy. The linker maintains the model as it allocates output sections and uses it to determine which memory locations can be used for object code.
The memory configurations of C7000 systems differ from application to application. The MEMORY directive allows you to specify a variety of configurations. After you use MEMORY to define a memory model, you can use the SECTIONS directive to allocate output sections into defined memory. For more information, see Section 8.4.
The C7000 compiler requires that all code and data lie within 2 GB of virtual address space. Use a linker command file to place your code and data within this 2 GB virtual address region. The C7000 compiler produces code that uses position-independent addressing to obtain the addresses of functions (in some cases) and to access statically allocated data in memory. Instructions that use position-independent addressing have limited reach. For further information, see the C7000 Embedded Application Binary Interface (EABI) Reference Guide (SPRUIG4), specifically the sections on “Computing Code Addresses” and “Data Allocation and Addressing”.