How do I identify code compiled with LTO?

Is there a way to detect if the code is compiled with -flto?

Example: classic library or Linux executable compiled with GCC (4.9.1), no debugging.

+3


source to share


1 answer


Given that LTO information is stored in multiple ELF sections inside object files (see sections of the LTO file ), you can try and see what it readelf

returns (as used in, for example, this answer ).



Find records .gnu.lto_.xxx

.

+4


source







All Articles