[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: porting gas (&gcc)
From: |
Nick Clifton |
Subject: |
Re: porting gas (&gcc) |
Date: |
25 Oct 2001 15:18:58 +0100 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 |
Hi Alun,
> I've been searching for some documentation on the porting of gas,
> similar to that for gcc, but with no luck.
>
> Are there any documents that you can direct me to, to guide the
> process of writing a new backend for out processor?
Sadly there is very little documentation at all. :-( Of course if
you feel like writing up your experiences and starting some
documentation that would be great.
You should look at the files in gas/doc. In particular as.texinfo
covers the basics of the interface that GAS provides to the world and
internals.texi is *supposed* to be a porting guide, but it is rather
out of date.
Most people work by copying an already existing port and then
modifying it to suit their needs. Since yours in a 16bit processor I
would suggest looking at the SH port which is also 16bit.
Basically you will need to create these files. (Replace FOO with the
name of your chip):
gas/config/tc-FOO.h - Customisation of generic parts of the
assembler
gas/config/tc-FOO.c - Port specific parts of the assembler
include/{coff|elf}/FOO.h - Port specific header file
include/opcodes/FOO.h - Port specific ISA encoding
opcodes/FOO-dis.c - Port specific disassembler routines
opcodes/FOO-opc.c - Port specific ISA encoding
bfd/{elf32|coff}-FOO.c - Port specific relocation handlers
bfd/cpu-FOO.c - Port specific description of the CPU
ld/scripttempl/FOO.sc - Port specific linker template file
ld/emulparam/FOO.sh - Port specific linker customisation
You will also need to add support for your chip to the various
configuration files:
gas/configure.in
opcodes/configure.in
bfd/configure.in
bfd/config.bfd
bfd/archures.c
bfd/reloc.c
ld/configure.in
ld/configure.tgt
include/dis-asm.h
You might like to consider using the CGEN program which is capable of
generating most of the assembler, disassembler and simulator from a
single cpu description file. The sources for this program are
included in the binutils CVS repository. The directory cgen/doc
contains documentation for this program.
Cheers
Nick
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: porting gas (&gcc),
Nick Clifton <=