This is the mail archive of the binutils@sources.redhat.com 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]

Re: New port


Hi Patrick,

> a) what's the "best" existing port to duplicate and modify - I'd
> like something that's clean and straightforward, without too much
> legacy of non-BFD code etc.

I would suggest you look at the IA64 port, which is new and pretty
clean.  It is a 64-bit port, so beware of that.  You might also look
at the MCore and TIC54x ports which are relatively recent 32-bit COFF
ports.

> b) what are the main new files I need to add? Some kind of a guide
> to what the minimum required for a given tool would be very helpful.

You basically need to create these files for all tools:

   include/coff/clipper.h
   opcodes/clipper-opc.c
   opcodes/clipper-dis.c
   bfd/coff-clipper.c
   bfd/cpu-clipper.c

Then for the assembler you need to add:

   gas/config/tc-clipper.c
   gas/config/tc-clipper.h

And for the linker:

   ld/emulparams/clippercoff.sh
   ld/scripttemp/clippercoff.sc
   ld/emultempl/clippercoff.em

Plus if you are going to port GDB and the Simulator you will need to
create more files for them.

Plus you will need to edit the various configure.in files to add your
new target, and the bfd/reloc.c bfd/archures.c files to add your bfd
target vector.

> As far as I can tell, the best place to start might be with ld,
> which should not require any new code (perhaps apart from the magic
> number), due to the standard target format?

Actually I would recommend starting with GAS and then working towards
LD.  Without an assembler you cannnot create object files to test the
linker, but you can still test GAS without a linker.


> PS: Can someone explain to me the difference between a.out and COFF?
> Do I have it right that the a.out format is simply the format for an
> executable as opposed to a linkable object?

No.  AOUT is a binary file format, just as COFF is.  Thus you can have
AOUT format object files as well as AOUT format executables.  By,
unfortunate, historical precedent the default name for an executable
created by the linker on a UNIX derived OS is a.out.  This does not 
mean that the executable is in AOUT format.

Cheers
        Nick


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