Keil Logo

Technical Support

On-Line Manuals

Linker User Guide

Preface Overview of the Linker Linking Models Supported by armlink Image Structure and Generation The structure of an ARM ELF image Views of the image at each link stage Input sections, output sections, regions, and prog Load view and execution view of an image Methods of specifying an image memory map with the Image entry points Simple images Types of simple image Type 1 image structure, one load region and contig Type 2 image structure, one load region and non-co Type 3 image structure, multiple load regions and Section placement with the linker Default section placement Section placement with the FIRST and LAST attribut Section alignment with the linker Linker support for creating demand-paged files Linker reordering of execution regions containing Linker-generated veneers What is a veneer? Veneer sharing Veneer types Generation of position independent to absolute ven Reuse of veneers when scatter-loading Command-line options used to control the generatio Weak references and definitions How the linker performs library searching, selecti How the linker searches for the ARM standard libra Specifying user libraries when linking How the linker resolves references The strict family of linker options Linker Optimization Features Getting Image Details Accessing and Managing Symbols with armlink Scatter-loading Features Scatter File Syntax Linker Command-line Options Linker Steering File Command Reference Via File Syntax

How the linker performs library searching, selection, and scanning

3.9 How the linker performs library searching, selection, and scanning

The linker always searches user libraries before the ARM libraries.

If you specify the --no_scanlib command-line option, the linker does not search for the default ARM libraries and uses only those libraries that are specified in the input file list to resolve references.
The linker creates an internal list of libraries as follows:
  1. Any libraries explicitly specified in the input file list are added to the list.
  2. The user-specified search path is examined to identify ARM standard libraries to satisfy requests embedded in the input objects.
    The best-suited library variants are chosen from the searched directories and their subdirectories. Libraries supplied by ARM have multiple variants that are named according to the attributes of their members.
Be aware of the following differences between the way the linker adds object files to the image and the way it adds libraries to the image:
  • Each object file in the input list is added to the output image unconditionally, whether or not anything refers to it. At least one object must be specified.
  • A member from a library is included in the output only if:
    • An object file or an already-included library member makes a non-weak reference to it.
    • The linker is explicitly instructed to add it.


    If a library member is explicitly requested in the input file list, the member is loaded even if it does not resolve any current references. In this case, an explicitly requested member is treated as if it is an ordinary object.
Unresolved references to weak symbols do not cause library members to be loaded.
Non-ConfidentialPDF file icon PDF versionARM DUI0377H
Copyright © 2007, 2008, 2011, 2012, 2014-2016 ARM. All rights reserved. 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.