| |||
| Home > Linking models supported by armlink > Base Platform linking model | |||
Base Platform enables you to create dynamically linkable images that do not have the memory map enforced by the System V (SysV) or Base Platform Application Binary Interface (BPABI) linking models. It enables you to:
Create images with a memory map described in a scatter file.
Have dynamic relocations so the images can be dynamically linked. The dynamic relocations can also target within the same image.
The BPABI specification places constraints on the memory model that can be violated using scatter-loading. However, because Base Platform is a superset of BPABI, it is possible to create a BPABI conformant image with Base Platform.
To link with the Base Platform model, use the --base_platform command-line
option.
If you specify this option, the linker acts as if you specified --bpabi,
with the following exceptions:
Scatter-loading
is available with --scatter, in addition to the
following options:
--dll
--force_so_throw, --no_force_so_throw
--pltgot= is
restricted to types typenone or direct
--ro_base=address
--rosplit
--rw_base=address
--rwpi.
The default value of the --pltgot option
is different to that for --bpabi:
for --base_platform,
the default is --pltgot=none
for --bpabi the default is --pltgot=direct.
If you do not use a scatter file, the linker can ensure that the Procedure Linkage Table (PLT) section is placed correctly, and contains entries for calls only to imported symbols. If you specify a scatter file, the linker might not be able to find a suitable location to place the PLT.
Each load region containing code might require a PLT section
to indirect calls from the load region to functions where the address
is not known at static link time. The PLT section for a load region LR must
be placed in LR and be accessible at all times
to code within LR.
To ensure calls between relocated load regions ar run-time:
Use the --pltgot=direct option
to turn on PLT generation.
Use the --pltgot_opts=crosslr option
to add entries in the PLT for calls between RELOC load
regions. The linker generates a PLT for each load region so that
calls do not have to be extended to reach a distant PLT.
Be aware of the following:
The model assumes that shared objects cannot throw a C++ exception.
Symbol versioning must be used to ensure that all the required symbols are available at load time.
There are restrictions on the type of scatter files you can use.