http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53282
Jan Hubicka <hubicka at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hubicka at gcc dot gnu.org --- Comment #3 from Jan Hubicka <hubicka at gcc dot gnu.org> 2012-05-08 16:35:57 UTC --- LTO works in a way that it first collect whole program and promote all symbols that are not externally visible static. After doing whole program optimization the program is decomposed again into ltrans unit and compiled independently. Symbols used from multiple ltrans unit are made hidden, so the units can refer to it. In your program apparently only those few symbols are crossing boundary of ltrans. So this is really independent thing. You can try to compile with -flto-partition=none. It will take longer but should avoid the hidden symbols. File order independency of partitioning is possible, but I doubt it is desirable design goal. In fact keeping things approximately in the order it was passed to linker makes sense unless compiler knows better. Honza