| |||
| Home > Features of the Base Platform linking model > Placement of PLT sequences with the Base Platform model | |||
The linker supports Procedure Linkage Table (PLT)
generation for multiple load regions containing code when in Base
Platform mode (--base_platform).
To turn on PLT generation when in Base Platform mode use --pltgot=. You can use the option option that
generates PLT sequences--pltgot_opts=crosslr to
add entries in the PLT for calls between RELOC load-regions.
PLT generation for multiple Load Regions is only supported for --pltgot=direct.
The --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 .plt with
an object anon$$obj.o.
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 LR
Name.plt_ with an
object of LR_NAMEanon$$obj.o. To precisely name this
PLT section in a scatter file, use the selector:
anon$$obj.o(.plt_LR_NAME)
Be aware of the following:
The
linker gives an error message if the PLT for load region is
moved out of load region LR_NAME.LR_NAME
The linker gives an error message if load region contains
a mixture of LR_NAMERELOC and non-RELOC execution
regions. This is because it cannot guarantee that the RELOC execution regions
are able to reach the PLT at run-time.
--pltgot=indirect and --pltgot=sbrel are
not supported for multiple load regions.
Linker Reference: