This is the mail archive of the 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]

How to add a new target in binutils ?

Hi, All:
I'm new to binutils and I want to port a linker to a new architecture. What I need is just a very basic linker , which can link static elf object files or static libraries into executables, no functionality for shared library or dynamic link.
I tried the Gold first, but found it has been bounded to the binutils, and can't be compiled separately. so I tried to port the bintuils as a whole.
I have read the "Binutils Porting Guide To A New Target Architecture" written by, which seems to be very helpful for me. But I 'm stucking in some details now.
First I want to get a full functional configure& compile system for this port, say "mpu". I begin with reviewing the example port "cr16" in the tutorial. Here is what I have done:
1. Download binutils-2.22.tar.gz
2. copy follow file and change the name from "cr16" to "mpu"
3. add corresponding entry in the following configuration files:
a) bfd/Makefile.amb
b) bfd/archures.c
c) bfd/bfd-in2.h
d) bfd/config.bfd
e) bfd/
f) bfd/libbfd.h
g) bfd/targets.c
h) binutils/readelf.c
i) config.sub
j) gas/
k) gas/configure.tgt
l) include/dis-asm.h
m) include/elf/common.h
n) ld/
o) ld/configure.tgt
p) opcodes/
q) opcodes/
r) opcodes/disassemble.c

     3)configure the script with following command:
        ~/Work/binutils/binutils-mpu-2.22/configure  \
        --prefix=/home/xiesl/Tools/binutils                \
        --target=mpu-elf                                          \

4). run make , but error occurs:
configure: error: *** unknown target vector bfd_elf32_mpu_vec
make[1]: *** [configure-bfd] error 1
make[1]:leaving directory `/tmp/build'
make: *** [all] error 2
I really hope someone can give me some advice , for porting the linker, or this error message. Thanks.


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