[comp.sources.d] Easy way to tell if something's compiled with gcc?

murf@oakhill.UUCP (Steve Murphy) (07/14/90)

There is one way to quickly ascertain if gcc was used to compile a binary.

Try:

grep gcc_compiled  executable-name


gcc does drop a string "gcc_compiled" into object compiled with it.
I'm sure that a clever person could turn this off.

But Stallman himself said that compiling with gcc doesn't make it public
domain. Using libg++ would. But I don't think most sites have access to
the C library under development by the GNU project yet. I don't. Based on
my own limited experience, I'd have to say that usage of it in the networld
must be fairly limited, because it's not distributed yet.

Or am I way behind the times?

murf
-- 
murf:   Steve Murphy, 	Motorola, Inc.  <My postings are from me, not Motorola>
        6501 William Cannon Drive West, MS OE37
        Austin, TX 78735          (512)891-2276
        <WORLD>!oakhill!murf or murf@oakhill.sps.mot.com

josef@nixpbe.UUCP (Moellers) (07/16/90)

In <3527@dingus.oakhill.UUCP> murf@oakhill.UUCP (Steve Murphy) writes:

>There is one way to quickly ascertain if gcc was used to compile a binary.

>Try:

>grep gcc_compiled  executable-name


>gcc does drop a string "gcc_compiled" into object compiled with it.
>I'm sure that a clever person could turn this off.

As far as I know it's defined as an assember symbol, so it should be in
the symbol table. If You "strip" the object (perhaps using GNU strip),
then that trace is gone.

--
| Josef Moellers		|	c/o Nixdorf Computer AG	|
|  USA: mollers.pad@nixbur.uucp	|	Abt. PXD-S14		|
| !USA: mollers.pad@nixpbe.uucp	|	Heinz-Nixdorf-Ring	|
| Phone: (+49) 5251 104662	|	D-4790 Paderborn	|

I.G.Batten@fulcrum.bt.co.uk (Ian G Batten) (07/16/90)

murf@oakhill.UUCP (Steve Murphy) writes:
> There is one way to quickly ascertain if gcc was used to compile a binary.
> 
> Try:
> 
> grep gcc_compiled  executable-name

Only with a.out, I believe.  I don't think the default COFF ports put it
in.

ian