06.02.2013 Views

ARM Compiler toolchain Using the Linker - ARM Information Center

ARM Compiler toolchain Using the Linker - ARM Information Center

ARM Compiler toolchain Using the Linker - ARM Information Center

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Features of <strong>the</strong> Base Platform linking model<br />

11.3 Placement of PLT sequences with <strong>the</strong> Base Platform model<br />

11.3.1 See also<br />

The linker supports Procedure Linkage Table (PLT) generation for multiple load regions<br />

containing code when in Base Platform mode (--base_platform).<br />

To turn on PLT generation when in Base Platform mode use --pltgot=option that generates<br />

PLT sequences. You can use <strong>the</strong> option --pltgot_opts=crosslr to add entries in <strong>the</strong> PLT for calls<br />

between RELOC load-regions. PLT generation for multiple Load Regions is only supported for<br />

--pltgot=direct.<br />

The --pltgot_opts=crosslr option is useful when you have multiple load regions that might be<br />

moved relative to each o<strong>the</strong>r when <strong>the</strong> image is dynamically loaded. The linker generates a PLT<br />

for each load region so that calls do not have to be extended to reach a distant PLT.<br />

Placement of linker generated PLT sections:<br />

• When <strong>the</strong>re is only one load region <strong>the</strong>re is one PLT. The linker creates a section called<br />

.plt with an object anon$$obj.o.<br />

• When <strong>the</strong>re are multiple load regions, a PLT section is created for each load region that<br />

requires one. By default, <strong>the</strong> linker places <strong>the</strong> PLT section in <strong>the</strong> first execution region<br />

containing code. You can override this by specifying <strong>the</strong> exact PLT section name in <strong>the</strong><br />

scatter file.<br />

For example, a load region with name LR Name <strong>the</strong> PLT section is called .plt_LR_NAME with<br />

an object of anon$$obj.o. To precisely name this PLT section in a scatter file, use <strong>the</strong><br />

selector:<br />

anon$$obj.o(.plt_LR_NAME)<br />

Be aware of <strong>the</strong> following:<br />

• The linker gives an error message if <strong>the</strong> PLT for load region LR_NAME is moved out of load<br />

region LR_NAME.<br />

• The linker gives an error message if load region LR_NAME contains a mixture of RELOC and<br />

non-RELOC execution regions. This is because it cannot guarantee that <strong>the</strong> RELOC execution<br />

regions are able to reach <strong>the</strong> PLT at run-time.<br />

• --pltgot=indirect and --pltgot=sbrel are not supported for multiple load regions.<br />

Concepts<br />

• Base Platform linking model on page 3-6.<br />

Reference<br />

<strong>Linker</strong> Reference:<br />

• --base_platform on page 2-18<br />

• --pltgot=type on page 2-121<br />

• --pltgot_opts=mode on page 2-122.<br />

<strong>ARM</strong> DUI 0474C Copyright © 2010-2011 <strong>ARM</strong>. All rights reserved. 11-7<br />

ID080411 Non-Confidential

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!