This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gcc binary output differs whether it is built from *.o or *.a


beaugy.a@free.fr wrote:
Hi all,
So, to put it in a nutshell, all my generated objects file are
identical on dev1 and dev2 and object files contained in my
convenience libraries are all identical. The only difference
remaining, before I generate my binary, resides in the generated
convenience libraries which are not identical, but their contents
are. So AFAK, this slight difference shall not make the difference. So
"why does gcc output (MD5 checksum) differs when I build a binary
using the project object files (*.o) or the project convenience
libraries (*.a)?" and "what can I do to fix that?".

Your *.o files are proceeded in a different order when on the command line and on the .a archive, putting symbols on different addresses, so obviously different binaries are produced.

Even if you do:
gcc 1.o 2.o
And:
gcc 2.o 1.o
you get binaries with different md5.

My 0.02 euros.
CÃdric.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]