You copied the Doc URL to your clipboard.

--lto, --no_lto

Enables link time optimization.


Link Time Optimization performs aggressive optimizations. Sometimes this can result in large chunks of code being removed.


When you specify the -flto option, armclang produces ELF files that contain bitcode in a .llvmbc section.

With the --no_lto option, armlink gives an error message if it encounters any .llvmbc sections.


The default is --no_lto.


Link time optimization requires the dependent library libLTO.

Table 11-4 Link time optimization dependencies

Dependency Windows filename Linux filename
libLTO LTO.dll

By default, the dependent library libLTO is present in the same directory as armlink.

The search order for these dependencies is as follows.


  1. The same directory as the armlink executable.
  2. The directories in the current directory search path.

  1. The same directory as the armlink executable.
  2. The directories in the LD_LIBRARY_PATH environment variable.
  3. The cache file /etc/
  4. The directories /lib and /usr/lib.

    These directories might have the suffix 64 on some 64-bit Linux systems. For example, on 64-bit Red Hat Enterprise Linux the directories are /lib64 and /usr/lib64.


The armclang executables 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.


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.