Enables link time optimization, and outputs bitcode wrapped in an ELF file for link time optimization.
The primary use for files containing bitcode is for link time optimization. See Optimizing across modules with link time optimization in the Software Development Guide for more information about link time optimization.
The compiler creates one file for each source file, with a
.o file extension replacing the file extension on the
input source file.
-flto option passes the
--lto option to
armlink to enable link time optimization, unless the
-c option is specified.
-flto is automatically enabled when
you specify the
NoteObject files produced with
-fltocontain bitcode, which cannot be disassembled into meaningful disassembly using the
-Soption or the
CAUTION:Object files generated using the
-fltooption are not suitable for creating static libraries, or ROPI or RWPI images.
CAUTION:Link Time Optimization performs aggressive optimizations. Sometimes this can result in large chunks of code being removed.
NoteLink Time Optimization does not honor the
-mexecute-onlyoption. If you use the
-Omaxoptions, then the compiler cannot generate execute-only code.