Re: Different object code generated each time file is compiled

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

 



Burt Bicksler wrote:

> It is only two source files that we see this difference with and it is
> always 4 bytes in each object file that is different.
> 
> Has anyone encountered anything like this before?

There are several things that can cause this.  The most common is the
use of the __TIME__ or __DATE__ macros, however this doesn't seem
applicable in your case if you are compiling preprocessed source since
the expansion will have already occurred.

Another less obvious source of differences are anonymous namespaces. 
Because the standard says that they must be unique to each translation
unit, the compiler has to add some random strings to their mangled names
to uniquify them so that no two can clash.  The -frandom-seed option is
provided as a way for the user to specify their own uniquifier string:
<http://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html#index-frandom_002dstring-571>

If that doesn't cover your problem then you'll probably have to
investigate further.  Try diffing the assembler output (-S) of two runs
and the source of the difference should jump out at you.

Brian

[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