1 Preliminary Notes on Porting BFD
2 --------------------------------
4 The 'host' is the system a tool runs *on*.
5 The 'target' is the system a tool runs *for*, i.e.
6 a tool can read/write the binaries of the target.
10 Pick a name for your host. Call that <host>.
11 (<host> might be sun4, ...)
12 Create a file hosts/h-<host>.
14 Porting to a new target
15 -----------------------
16 Pick a name for your target. Call that <target>.
17 You need to create <target>.c and config/mt-<target>.
19 config/mt-<target> is a Makefile fragment.
20 The following is usually enough:
21 DEFAULT_VECTOR=<target>_vec
22 SELECT_ARCHITECTURES=bfd_<cpu>_arch
24 See the list of cpu types in archures.c, or "ls cpu-*.c".
25 for more information about .mt and .mh files, see config/README.
27 The file <target>.c is the hard part. It implements the
28 bfd_target <target>_vec, which includes pointers to
29 functions that do the actual <target>-specific methods.
31 Porting to a <target> that uses the a.out binary format
32 -------------------------------------------------------
34 In this case, the include file aout-target.h probaby does most
35 of what you need. The program gen-aout generates <target>.c for
36 you automatically for many a.out systems. Do:
38 ./gen-aout <target> > <target>.c
39 (This only works if you are building on the target ("native").
40 If you must make a cross-port from scratch, copy the most
41 similar existing file that includes aout-target.h, and fix what is wrong.)
43 Check the parameters in <target>.c, and fix anything that is wrong.
44 (Also let us know about it; perhaps we can improve gen-aout.c.)
46 TARGET_IS_BIG_ENDIAN_P
47 Should be defined if <target> is big-endian.
50 See discussion in ../include/aout/aout32.h.
53 Number of bytes per word. (Usually 4 but can be 8.)
56 Number of bits per word. (Usually 32, but can be 64.)
59 Define if the extry point (start address of an
60 executable program) can be 0x0.
63 The address of the start of the text segemnt in
64 virtual memory. Normally, the same as the entry point.
69 Usually, the same as the PAGE_SIZE.
70 Alignment needed for the data segment.
73 The name of the target, for run-time lookups.
74 Usually "a.out-<target>"