6.2.2 Restrictions with link time optimization

Link time optimization has a few restrictions in Arm® Compiler 6. Future releases might have fewer restrictions and more features. The user interface to link time optimization might change in future releases.

No bitcode libraries

armlink only supports bitcode objects on the command line. It does not support bitcode objects coming from libraries. armlink gives an error message if it encounters a file containing bitcode while loading from a library.

Although armar silently accepts ELF files that are produced with armclang -flto, these files currently do not have a proper symbol table. Therefore, the generated archive has incorrect index information and armlink cannot find any symbols in this archive.

Partial linking
The armlink option --partial only works with ELF files. The linker gives an error message if it detects a file containing bitcode.

The output of the link time optimizer is a single ELF object file that by default is given a temporary filename. This ELF object file contains sections and symbols just like any other ELF object file, and these are matched by input section selectors as normal.

Use the armlink option --lto_intermediate_filename to name the ELF object file output. You can reference this ELF file name in the scatter file.

Arm recommends that link time optimization is only performed on code and data that does not require precise placement in the scatter file, with general input section selectors such as *(+RO) and .ANY(+RO) used to select sections generated by link time optimization.

It is not possible to match bitcode in .llvmbc sections by name in a scatter file.


The scatter-loading interface is subject to change in future versions of Arm Compiler 6.
Executable and library compatibility
The armclang executable and the libLTO library must come from the same Arm Compiler 6 installation. Any use of libLTO other than that supplied with Arm Compiler 6 is unsupported.
Other restrictions
  • You cannot currently use link time optimization for building ROPI/RWPI images.
  • Object files that are produced by the link time optimization contain build attributes that are the default for the target architecture. If you use the armlink options --cpu or --fpu when link time optimization is enabled, armlink can incorrectly report that the attributes in the file produced by the link time optimizer are incompatible with the provided attributes.
  • Link Time Optimization does not honor armclang options -ffunction-sections and -fdata-sections.
  • Link Time Optimization does not honor the armclang -mexecute-only option. If you use the armclang -flto or -Omax options, then the compiler cannot generate execute-only code and produces a warning.
  • Link Time Optimization does not work correctly when two bitcode files are compiled for different targets.
Non-ConfidentialPDF file icon PDF versionDUI0773J
Copyright © 2014–2017, 2019 Arm Limited or its affiliates. All rights reserved.