Keil™, An ARM® Company

RealView Linker and Utilities Guide

Library searching, selection, and scanning

6.2. Library searching, selection, and scanning

The differences between the way the linker adds object files to the image and the way it adds libraries to the image are:

  • 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, or if the linker is explicitly instructed to add it.

    Note

    If a library member is explicitly requested in the input file list, it 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.

Unused sections are subsequently eliminated unless ‑‑no_remove is used.

Unresolved references to weak symbols do not cause library members to be loaded.

Note

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.

Therefore, the linker creates a 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.

Copyright © 2007 ARM Limited. All rights reserved.ARM DUI 0377A