How to add a new target in BFD?

Nick Clifton nickc@redhat.com
Thu May 8 07:36:00 GMT 2003


Hi Yu Mao,

> ./configure --target=arca1 --prefix=/ARCA
> 
> configure failed with error message
> 
> "*** BFD does not support target arca1-arca-linux-gnu.
> *** Look in bfd/config.bfd for supported targets.

> How can I add a new target in BFD? Or is there any workaround?

There is no workaround.  The binutils do not currently support the
ARCA target so you will have to add the support yourself.

In order to add a new target you are going to have to create several
files and modify some others.  At a minimum you will need to create at
least the following files:

  include/elf/arca.h
  bfd/elf32-arca.c
  bfd/cpu-arca.c
  gas/config/tc-arca.h
  gas/config/tc-arca.c
  ld/emulparams/elfarca.sh

Have a look at already existing files in these directories for
examples of what the new files ought to contain.  (I have assumed that
you are using the ELF file format).

You will also need to create files in the opcodes/ directory, but you
may want to use the CGEN tool in order to do this:

  http://sources.redhat.com/cgen/

You will also need to modify some configuration and source files as
well:

  config.sub
  bfd/config.bfd
  bfd/configure.in
  bfd/reloc.c
  bfd/target.c
  bfd/Makefile.am
  ld/configure.tgt
  ld/Makefile.am
  opcodes/configure.in
  opcodes/Makefile.am
  opcodes/disassemble.c
  gas/configure.in
  gas/Makefile.am

You should also make sure that you configure your toolchain with the
--enable-maintainer-mode switch so that automatically generated files
(eg */configure */Makefile.in) are regenerated correctly.

Cheers
        Nick



More information about the Binutils mailing list