You copied the Doc URL to your clipboard.

Example scatter file for the Base Platform linking model

This example shows the use of a scatter file with the Base Platform linking model.

The standard Base Platform Application Binary Interface (BPABI) memory model in scatter file format, with relocatable load regions is:

LR1 0x8000 RELOC
{
    ER_RO +0
    {
        *(+RO)
    }
}

LR2 0x0 RELOC
{
    ER_RW +0
    {
        *(+RW)
    }
    ER_ZI +0
    {
        *(+ZI)
    }
}

This example conforms to the BPABI, because it has the same two-region format as the BPABI specification.

The next example shows two load regions LR1 and LR2 that are not relocatable.

LR1 0x8000
{
    ER_RO +0
    {
        *(+RO)
    }
    ER_RW +0
    {
        *(+RW)
    }
    ER_ZI +0
    {
        *(+ZI)
    }
}

LR2 0x10000
{
    ER_KNOWN_ADDRESS +0
    {
        *(fixedsection)
    }
}

LR3 0x20000 RELOC
{
    ER_RELOCATABLE +0
    {
        *(floatingsection)
    }
}

The linker does not have to generate dynamic relocations between LR1 and LR2 because they have fixed addresses. However, the RELOC load region LR3 might be widely separated from load regions LR1 and LR2 in the address space. Therefore, dynamic relocations are required between LR1 and LR3, and LR2 and LR3.

Use the options --pltgot=direct --pltgot_opts=crosslr to ensure a PLT is generated for each load region.

Was this page helpful? Yes No