RealView® Compilation Tools Linker User Guide

Version 4.0

Table of Contents

About this book
Intended audience
Using this book
Typographical conventions
Further reading
Feedback on RealView Compilation Tools
Feedback on this book
1. Introduction
1.1. About the ARM linker
1.1.1. Input to the ARM linker
1.1.2. Output from the ARM linker
1.2. Compatibility with legacy objects and libraries
2. Getting Started with the ARM Linker
2.1. Linking models
2.1.1. Bare-metal linking model
2.1.2. Partial linking model
2.1.3. Concepts common to both BPABI and SysV linking models
2.1.4. Base Platform Application Binary Interface (BPABI) linking model
2.1.5. Base Platform linking model
2.1.6. SysV linking model
2.2. Using command-line options
2.2.1. Invoking the ARM linker
2.2.2. Ordering command-line options
2.2.3. Specifying command-line options with an environment variable
2.2.4. Reading command-line options from a file
3. Using the Basic Linker Functionality
3.1. The image structure
3.1.1. Input sections, output sections, regions, and Program Segments
3.1.2. Load view and execution view of an image
3.1.3. Specifying an image memory map
3.1.4. Image entry points
3.2. Section placement
3.2.1. Handling unassigned sections
3.2.2. Using FIRST and LAST to place sections
3.2.3. Aligning sections
3.2.4. Ordering execution regions containing Thumb code
3.3. Section elimination
3.3.1. Common debug section elimination
3.3.2. Common group or section elimination
3.3.3. Unused section elimination
3.3.4. Unused virtual function elimination
3.4. Feedback
3.4.1. Example of linker feedback
3.5. RW data compression
3.5.1. Choosing a compressor
3.5.2. How is compression applied?
3.5.3. Working with RW data compression
3.6. Veneers
3.6.1. Veneer sharing
3.6.2. Veneer variants
3.6.3. PI to absolute veneers
3.6.4. Reuse of veneers with overlay execution regions
3.7. Inlining
3.7.1. Factors that influence inlining
3.7.2. Handling tail calling sections
3.8. About merging comment sections
3.8.1. See also
3.9. Using command-line options to create simple images
3.9.1. Type 1, one load region and contiguous execution regions
3.9.2. Type 2, one load region and non-contiguous execution regions
3.9.3. Type 3, two load regions and non-contiguous execution regions
3.10. Using command-line options to handle C++ exceptions
3.11. About weak references and definitions
3.11.1. Example of a weak reference
3.11.2. Example of a weak definition
3.12. Getting information about images
3.12.1. Using image-related information
3.13. Library searching, selection, and scanning
3.13.1. Searching for ARM libraries
3.13.2. Searching for user libraries
3.13.3. Scanning the libraries
4. Accessing Image Symbols
4.1. About mapping symbols
4.2. ARM/Thumb synonyms (deprecated in RVCT v4.0)
4.3. Accessing linker-defined symbols
4.3.1. Region-related symbols
4.3.2. Section-related symbols
4.4. Accessing symbols in another image
4.4.1. Creating a symdefs file
4.4.2. Reading a symdefs file
4.4.3. Symdefs file format
4.5. Hiding and renaming global symbols
4.5.1. Steering file format
4.6. Using $Super$$ and $Sub$$ to override symbol definitions
4.7. Symbol versioning
4.7.1. Version
4.7.2. Default version
4.7.3. Creating versioned symbols
5. Using Scatter-loading Description Files
5.1. About scatter-loading
5.1.1. When to use scatter-loading
5.1.2. Symbols defined for scatter-loading
5.1.3. Specifying stack and heap using the scatter-loading description file
5.1.4. Scatter-loading command-line option
5.1.5. Images with a simple memory map
5.1.6. Images with a complex memory map
5.2. Examples of specifying region and section addresses
5.2.1. Selecting veneer input sections in scatter-loading descriptions
5.2.2. Creating root execution regions
5.2.3. Placing unassigned sections with the .ANY module selector
5.2.4. Examples of using placement algorithms for .ANY sections
5.2.5. Example of next_fit algorithm showing behavior of full regions, selectors, and priority
5.2.6. Examples of using sorting algorithms for .ANY sections
5.2.7. Using overlays to place sections
5.2.8. Assigning sections to a root region
5.2.9. Reserving an empty region
5.2.10. Placing ARM C library code
5.2.11. Placing ARM C++ library code
5.2.12. Creating regions on page boundaries
5.2.13. Using preprocessing directives
5.3. Equivalent scatter-loading descriptions for simple images
5.3.1. Type 1, one load region and contiguous execution regions
5.3.2. Type 2, one load region and non-contiguous execution regions
5.3.3. Type 3, two load regions and non-contiguous execution regions

Proprietary Notice

Words and logos marked with ® or ™ are registered trademarks or trademarks of ARM® Limited 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 Limited 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.

Unrestricted Access is an ARM internal classification.

Product Status

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

Revision History
Revision AAugust 2002Release 1.2
Revision BJanuary 2003Release 2.0
Revision CSeptember 2003Release 2.0.1 for ARM® RealView® Developer Suite
Revision DJanuary 2004Release 2.1 for RealView Developer Suite
Revision EDecember 2004Release 2.2 for RealView Developer Suite
Revision FMay 2005Release 2.2 SP1 for RealView Development Suite
Revision GMarch 2006Release 3.0 for RealView Development Suite
Revision HMarch 2007Release 3.1 for RealView Development Suite
Revision ISeptember 2008Release 4.0 for RealView Development Suite
Revision I23 January 2009Update 1 for RealView Development Suite v4.0
Revision J10 December 2010Update 2 for RealView Development Suite v4.0
Copyright © 2002-2010 ARM. All rights reserved.ARM DUI 0206J