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: Same binary, different md5sums


> > > > I realize that this is a fairly broad question, but I would like to know 
> > > > if there is anything in particular I should take into account when 
> > > > trying to generate binaries with the same checksum.
> > >
> > >There could be all manner of reasons.  To begin with, diff the
> > >assembly language source produced by g++ -save-temps.  That'll get us
> > >started.
> > 
> > Is this bigger project made of single or multiple source files? If you're
> > talking about the linked object file it could also be that the linker doesn't
> > always put the modules in the same order (no need to).
>
>Why not?  It's not as if the linker randomizes its inputs.  Different
>linkers might do things differently, sure, but I'm assuming the OP
>isn't doing anything really silly such as using different linkers.

My case may have nothing to do with the OP's problem. But we use
gcc/as/ld for our embedded boards. Even with the completely same
environment (we only have few anyway) the linked endresult can
differ when compiled on different machines. It may have to do with
the fact that we collect some modules in libraries and feed these
to the linker. The order of the modules inside the libraries may not
necessarily be the same as we delete/add/update the libraries,
depending on the changed source files. But even a complete
rebuild doesn't always output the same file, the changes are
obvious in the according map file. But as I said that may have
nothing to do with the original problem, just a fact that we have
experienced.

bye  Fabi



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