This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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: How does one define a custom architecture to as and ld


Hi Robert,

We here at Boeing have a need to assemble code for an ancient processor
> Teledyne TDY-43 - that is no longer supported by anybody.

Oh you are going to have such fun...

I have not been able to discover how to define this processor to either as or ld.

(Assuming that you want to use the binutils) You are going to have add support for this architecture yourself. Anthony has already suggested using cgen, which is a good idea. Alternatively you can have a go at adding the support by hand. There is no documentation on how to do this however. It is a case of learning by doing, and by copying what has already been done before.


The simplest way to approach this is to identify a supported CPU that is similar to your own and then copy-and-then-modify the files that support this other CPU. For example you might like to look at the code that supports the Z80 or the D10V.

You are going to need to create the files:

   gas/config/tc-tdy.c
   gas/config/tc-tdy.h
   bfd/aout-tdy.c
   bfd/cpu-tdy.c
   include/aout/tdy.h

(I am assuming that you will have to use the AOUT binary file format. This may not be true. If you have the choice, I would recommend using the ELF file format).

You will also need to modify (at a minimum) these files:

  gas/configure.tgt
  bfd/config.bfd
  bfd/targets.c
  ld/configure.tgt

If you are not familiar with the binutils sources then I would first recommend that you build the tools for a more familiar processor (eg the x86) and then experiment with them for a little bit, maybe adding a fake instruction, so that you get some familiarity with them before you start trying to add support for an entirely new target.

Cheers
  Nick


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