11.1 Restrictions on the use of scatter files with the Base Platform model

The Base Platform model supports scatter files, with some restrictions.

Although there are no restrictions on the keywords you can use in a scatter file, there are restrictions on the types of scatter files you can use:

  • A load region marked with the RELOC attribute must contain only execution regions with a relative base address of +offset. The following examples show valid and invalid scatter files using the RELOC attribute and +offset relative base address:

    Valid scatter file example using
    # This is valid. All execution regions have +offset addresses.
    LR1 0x8000 RELOC
    {
        ER_RELATIVE +0
        {
            *(+RO)
        }
    }
    Invalid scatter file example using
    # This is not valid. One execution region has an absolute base address.
    LR1 0x8000 RELOC
    {
        ER_RELATIVE +0
        {
            *(+RO)
        }
        ER_ABSOLUTE 0x1000
        {
            *(+RW)
        }
    }
  • Any load region that requires a PLT section must contain at least one execution region containing code, that is not marked OVERLAY. This execution region holds the PLT section. An OVERLAY region cannot be used as the PLT must remain in memory at all times. The following examples show valid and invalid scatter files that define execution regions requiring a PLT section:

    Valid scatter file example for a load region that requires a PLT section
    # This is valid. ER_1 contains code and is not OVERLAY.
    LR_NEEDING_PLT 0x8000
    {
        ER_1 +0
        {
            *(+RO)
        }
    }
    Invalid scatter file example for a load region that requires a PLT section
    # This is not valid. All execution regions containing code are marked OVERLAY.
    LR_NEEDING_PLT 0x8000
    {
        ER_1 +0 OVERLAY
        {
            *(+RO)
        }
        ER_2 +0
        {
            *(+RW)
        }
    }
  • If a load region requires a PLT section, then the PLT section must be placed within the load region. By default, if a load region requires a PLT section, the linker places the PLT section in the first execution region containing code. You can override this choice with a scatter-loading selector.

    If there is more than one load region containing code, the PLT section for a load region with name name is .plt_name. If there is only one load region containing code, the PLT section is called .plt.

    The following examples show valid and invalid scatter files that place a PLT section:

    Valid scatter file example for placing a PLT section
    #This is valid. The PLT section for LR1 is placed in LR1.
    LR1 0x8000
    {
        ER1 +0
        {
            *(+RO)
        }
        ER2 +0
        {
            *(.plt_LR1)
        } 
    }
    LR2 0x10000
    {
        ER1 +0
        {
            *(other_code)
        }
    }
    Invalid scatter file example for placing a PLT section
    #This is not valid. The PLT section of LR1 has been placed in LR2.
    LR1 0x8000
    {
        ER1 +0
        {
            *(+RO)
        }
    }
    LR2 0x10000
    {
        ER1 +0
        {
            *(.plt_LR1)
        }
    }
Non-ConfidentialPDF file icon PDF versionARM DUI0474M
Copyright © 2010-2016 ARM Limited or its affiliates. All rights reserved.