How to tell which compiler was used?

Ian Lance Taylor iant@google.com
Wed May 30 04:01:00 GMT 2007


Yan Seiner <yan@seiner.com> writes:

> I have a set of binaries that were cross-compiled.  The manufacturer
> supplies 2 gcc- based toolchains.
> 
> I'd like to find out which toolchain was used to build the binaries.
> 
> One is based on gcc-3.3, the other is based on gcc-4.0.1.
> 
> Is there some way to tell which compiler was used to build a
> particular binary?

On GNU/Linux systems you can generally look at the contents of the
.comment section.  This can be printed using, e.g.,
    objdump -s -j .comment

If you have some other system, you need to tell us what it is.

Ian



More information about the Gcc-help mailing list