Dynamic Linking with the ARM Compiler toolchain

Application Note 242

Table of Contents

1. Conventions and feedback
2. Introduction
2.1. Purpose
2.2. Additional material
3. Linking overview and background
3.1. Linking background
3.2. Symbol definitions and references
3.3. Static linking and relocations
4. How is dynamic linking different to static linking?
4.1. Dynamic linking concepts
4.2. Dynamic linking benefits
4.3. Disadvantages of dynamic linking
5. Alternatives to dynamic linking
5.1. Symbol definition files
5.2. Jump tables
5.3. Overlays
6. ELF overview and background
6.1. Introduction
6.2. ELF file structure
6.2.1. ELF headers
6.2.2. ELF sections
7. Technical overview of dynamic linking
7.1. Dynamic linker
7.2. What does the dynamic linker need to do?
7.2.1. BPABI and post-linking
7.3. Locating dynamic content
7.4. Dynamic relocations
7.4.1. BPABI relocation example
7.5. Handling function calls between modules
7.5.1. Direct PLTs
7.5.2. Indirect PLTs
7.6. Handling data accesses between modules
8. Controlling what symbols can be dynamically linked
8.1. Symbol visibility
8.1.1. Setting symbol visibility
8.2. Populating the dynamic symbol table
8.3. Symbol preemption
8.3.1. SysV symbol preemption example
8.4. Symbol versioning
9. Dynamic linking models
9.1. Bare-metal
9.2. DLL-like
9.2.1. Base Platform Application Binary Interface (BPABI) linking model
9.2.2. The base platform linking model
9.3. SysV
9.3.1. Building SysV executables
9.3.2. Building shared objects
9.3.3. Symbol visibility rules
9.4. Choosing an appropriate model
9.4.1. Single address space versus multiple address spaces
9.4.2. SysV versus BPABI
9.4.3. BPABI versus base platform
10. Dynamic linking with the ARM Compiler toolchain
10.1. Controlling symbol visibility in the ARM Compiler toolchain
10.1.1. Compiler (armcc)
10.1.2. Assembler (armasm)
10.1.3. Linker (armlink)
10.1.4. Steering files
10.1.5. Dynamic symbol table rules
10.1.6. ELF reader and converter (fromelf)
10.1.7. Other dynamic image related linker (armlink) options
10.2. Controlling dynamic section contents

Proprietary Notice

Words and logos marked with or are registered trademarks or trademarks of ARM in the EU and other countries, except as otherwise stated below in this proprietary notice. Other brands and names mentioned herein may be the trademarks of their respective owners.

Neither the whole nor any part of the information contained in, or the product described in, this document may be adapted or reproduced in any material form except with the prior written permission of the copyright holder.

The product described in this document is subject to continuous developments and improvements. All particulars of the product and its use contained in this document are given by ARM in good faith. However, all warranties implied or expressed, including but not limited to implied warranties of merchantability, or fitness for purpose, are excluded.

This document is intended only to assist the reader in the use of the product. ARM shall not be liable for any loss or damage arising from the use of any information in this document, or any error or omission in such information, or any incorrect use of the product.

Where the term ARM is used it means "ARM or any of its subsidiaries as appropriate".

Confidentiality Status

This document is Non-Confidential. The right to use, copy and disclose this document may be subject to license restrictions in accordance with the terms of the agreement entered into by ARM and the party that ARM delivered this document to.

Product Status

The information in this document is final, that is for a developed product.

Revision History
Revision ADecember 2010First release
Copyright © 2010 ARM. All rights reserved.ARM DAI 0242A