5.7.7.28 Lto Option
This -flto option runs the standard link-time optimizer. This
feature can only be enabled when using a licensed compiler.
When invoked with source code, the compiler adds an internal bytecode representation of the code to special sections in the object file. When the object files are linked together, all the function bodies are read from these sections and instantiated as if they had been part of the same translation unit. Link time optimizations do not require the presence of the whole program to operate.
-flto both at compile time and during the final link. For example:xc32-gcc -c -O3 -flto -mprocessor=32MZ2048ECH100
-mdfp="Microchip/Microchip.PIC32MZ-EC_DFP.1.4.150" foo.c
xc32-gcc -c -O3 -flto -mprocessor=32MZ2048ECH100
-mdfp="Microchip/Microchip.PIC32MZ-EC_DFP.1.4.150" bar.c
xc32-gcc -o myprog.elf -flto -O3 -mprocessor=32MZ2048ECH100
-mdfp="Microchip/Microchip.PIC32MZ-EC_DFP.1.4.150" foo.o bar.oxc32-gcc -o myprog.elf -flto -O3 -mprocessor=32MZ2048ECH100
-mdfp="Microchip/Microchip.PIC32MZ-EC_DFP.1.4.150" foo.c bar.cThe -fno-lto form of this option does not run the standard link-time optimizer. This is the default action if this option is not specified.
