Re: program broke after turn on the option -flto

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 15/09/2020 09:07, mx via Gcc-help wrote:
> The program run in a embedded system. I turn on -flto option to
> optimize the size of my program. However the program broke in
> runtime. Is it normal?
> 

You are giving very little information here, but it is certainly normal
that you need to take some care if you want to use LTO in an embedded
system.

In particular, it's easy to end up with a system that is missing
interrupt functions, non-code flash sections (vector tables,
configuration options, etc.), and other code that is vital but not
directly reachable from main().  Some gcc toolchains for
microcontrollers come with a fair amount of this set up already, others
do not.

Basically, don't try using LTO unless you are happy to read the
documentation for the option, read (and modify) your linker scripts, use
gcc attributes, study map files, and dig into the details of what is
going wrong.




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux