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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

10.13 Addressing modes in <strong>the</strong> SysV memory model<br />

10.13.1 Position independent code<br />

10.13.2 See also<br />

BPABI and SysV shared libraries and executables<br />

System V (SysV) has a defined model for accessing <strong>the</strong> program and imported data and code<br />

from o<strong>the</strong>r models. If required, <strong>the</strong> linker automatically generates <strong>the</strong> required Procedure<br />

Linkage Table (PLT) and Global Offset Table (GOT) sections.<br />

SysV shared libraries are compiled with position independent code using <strong>the</strong> --apcs=/fpic<br />

compiler command-line option.<br />

The linker command-line option --fpic must also be used to declare that a shared library is<br />

position independent because this affects <strong>the</strong> construction of <strong>the</strong> PLT and GOT sections.<br />

Note<br />

By default, <strong>the</strong> linker produces an error message if <strong>the</strong> command-line option --shared is given<br />

without <strong>the</strong> --fpic options. If you must create a shared library that is not position independent,<br />

you can turn <strong>the</strong> error message off by using --diag_suppress=6403.<br />

Concepts<br />

• <strong>Linker</strong> options for SysV models on page 10-13<br />

• Automatic dynamic symbol table rules in <strong>the</strong> SysV memory model on page 10-15<br />

• Addressing modes in <strong>the</strong> SysV memory model<br />

• Thread local storage in <strong>the</strong> SysV memory model on page 10-18<br />

• Related linker command-line options for <strong>the</strong> SysV memory model on page 10-19.<br />

Reference<br />

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

• --diag_suppress=tag[,tag,...] on page 2-47<br />

• --fpic on page 2-74<br />

• --import_unresolved, --no_import_unresolved on page 2-79<br />

• --shared on page 2-146.<br />

<strong>Compiler</strong> Reference:<br />

• --apcs=qualifer...qualifier on page 3-11.<br />

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

ID080411 Non-Confidential

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

Saved successfully!

Ooh no, something went wrong!