On 13/06/2010 16:01, Ilya K wrote:

> And who is generating the binary file from the asm file? Does gcc call
> the external program? What the name of this program? Or the sources I
> need can be found inside the gcc directory?

  Gcc calls out to the assembler that it detects (or is instructed to use) at
configure time; generally that would be GAS from binutils, but GCC also works
with the native assembler on several platforms.


> I think that if there are no such instruction-code table inside gcc, I
> can build my own version of it inside my pass. But I need the sources
> of some utility which knows how to convert "nop" string into the
> binary number. Where can I get it?

  Well, binutils (http://sourceware.org/binutils) has assemblers for most
targets, but it would be a *big* job building parts of it into GCC.  Even
then, you might have a problem; what if your builtin assembler chooses
different prefixes or encodings compared to the external one, or optimises
differently in some way?

  What exact use would it be to you having the opcode bytes known during an
optimisation pass?  There may be a better/easier way to do whatever it is
you're trying to do.

    cheers,
      DaveK

Reply via email to