[Top][All Lists]

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

Re: [Tinycc-devel] asmtest.S?

From: David A. Wheeler
Subject: Re: [Tinycc-devel] asmtest.S?
Date: Mon, 07 May 2007 13:42:29 -0400 (EDT)

I said:
> > But when I ran asmtest.S through tcc, 'as', and gcc in the "obvious" way,
> > they ALL produced DIFFERENT disassembled results (!!).  ...  what's 
> > mind-boggling is
> > that the disassembled assembly from 'as' and gcc differ (!) - not just in
> > the ELF header, but the actual disassembled code!

Rob Landley: 
> Modern assemblers are a long way from the 1-1 translators of old.  The output 
> differing doesn't worry me, as long as the result does what it's supposed to.

But gcc is just a front-end that calls 'as'! I did this:
 strace -f -F -e trace=process gcc -c -o asmtest.gcc.o asmtest.S
and as I expected, I found that gcc called 'as'. I also found that "-Qy" is 
being passed to 'as'.   But the output of gcc is STILL different than that of 
calling 'as' directly when I give 'as' the "-Qy" option. It _appears_ to me 
that gcc modifies the .o file that 'as' produces, including the generated code 
(!), which is rather interesting.

I don't see any evidence that asmtest.S is supposed to do anything USEFUL, so 
you may only be able to use asmtest.S as a test to see that the assembly 
language parser at least doesn't barf on some legal inputs.

--- David A. Wheeler

reply via email to

[Prev in Thread] Current Thread [Next in Thread]