Placement of PLT sequences with the Base Platform model
The linker supports Procedure Linkage Table (PLT) generation for multiple load regions containing code when linking in Base Platform mode.
To turn on PLT generation when in Base Platform mode (
--pltgot= that generates PLT sequences. You can use the option
--pltgot_opts=crosslr to add entries in the PLT for calls from
RELOC load-regions. PLT generation for multiple Load
Regions is only supported for
--pltgot_opts=crosslr option is useful when you have multiple load
regions that might be moved relative to each other when the image is dynamically loaded. The
linker generates a PLT for each load region so that calls do not have to be extended to
reach a distant PLT.
Placement of linker generated PLT sections:
When there is only one load region there is one PLT. The linker creates a section called
.pltwith an object
When there are multiple load regions, a PLT section is created for each load region that requires one. By default, the linker places the PLT section in the first execution region containing code. You can override this by specifying the exact PLT section name in the scatter file.
For example, a load region with name
the PLT section is called
.plt_with an object of
anon$$obj.o. To precisely name this PLT section in a scatter file, use the selector:
Be aware of the following:
The linker gives an error message if the PLT for load region
is moved out of load region
The linker gives an error message if load region
contains a mixture of
RELOCexecution regions. This is because it cannot guarantee that the
RELOCexecution regions are able to reach the PLT at run-time.
--pltgot=sbrelare not supported for multiple load regions.