aboutsummaryrefslogtreecommitdiff
path: root/bfd/PORTING
diff options
context:
space:
mode:
authorDavid MacKenzie <djm@cygnus>1993-08-07 22:38:22 +0000
committerDavid MacKenzie <djm@cygnus>1993-08-07 22:38:22 +0000
commit5f9a2245d8cbdac6cf6f3da81099e68d224e6256 (patch)
tree88a74c1fc3f8f3724027acea3597defa5780d684 /bfd/PORTING
parent379dd9658225106674625254fa36004958819b47 (diff)
downloadgdb-5f9a2245d8cbdac6cf6f3da81099e68d224e6256.zip
gdb-5f9a2245d8cbdac6cf6f3da81099e68d224e6256.tar.gz
gdb-5f9a2245d8cbdac6cf6f3da81099e68d224e6256.tar.bz2
make target selection fully configurable
Diffstat (limited to 'bfd/PORTING')
-rw-r--r--bfd/PORTING73
1 files changed, 73 insertions, 0 deletions
diff --git a/bfd/PORTING b/bfd/PORTING
new file mode 100644
index 0000000..d2d49110
--- /dev/null
+++ b/bfd/PORTING
@@ -0,0 +1,73 @@
+ Preliminary Notes on Porting BFD
+ --------------------------------
+
+The 'host' is the system a tool runs *on*.
+The 'target' is the system a tool runs *for*, i.e.
+a tool can read/write the binaries of the target.
+
+Porting to a new host
+---------------------
+Pick a name for your host. Call that <host>.
+(<host> might be sun4, ...)
+Create a file hosts/h-<host>.
+
+Porting to a new target
+-----------------------
+Pick a name for your target. Call that <target>.
+You need to create <target>.c and config/mt-<target>.
+
+config/mt-<target> is a Makefile fragment.
+The following is usually enough:
+DEFAULT_VECTOR=<target>_vec
+SELECT_ARCHITECTURES=bfd_<cpu>_arch
+
+See the list of cpu types in archures.c, or "ls cpu-*.c".
+
+The file <target>.c is the hard part. It implements the
+bfd_target <target>_vec, which includes pointers to
+functions that do the actual <target>-specific methods.
+
+Porting to a <target> that uses the a.out binary format
+-------------------------------------------------------
+
+In this case, the include file aout-target.h probaby does most
+of what you need. The program gen-aout generates <target>.c for
+you automatically for many a.out systems. Do:
+ make gen-aout
+ ./gen-aout <target> > <target>.c
+(This only works if you are building on the target ("native").
+If you must make a cross-port from scratch, copy the most
+similar existing file that includes aout-target.h, and fix what is wrong.)
+
+Check the parameters in <target>.c, and fix anything that is wrong.
+(Also let us know about it; perhaps we can improve gen-aout.c.)
+
+TARGET_IS_BIG_ENDIAN_P
+ Should be defined if <target> is big-endian.
+
+N_HEADER_IN_TEXT(x)
+ See discussion in ../include/aout/aout32.h.
+
+BYTES_IN_WORD
+ Number of bytes per word. (Usually 4 but can be 8.)
+
+ARCH
+ Number of bits per word. (Usually 32, but can be 64.)
+
+ENTRY_CAN_BE_ZERO
+ Define if the extry point (start address of an
+ executable program) can be 0x0.
+
+TEXT_START_ADDR
+ The address of the start of the text segemnt in
+ virtual memory. Normally, the same as the entry point.
+
+PAGE_SIZE
+
+SEGMENT_SIZE
+ Usually, the same as the PAGE_SIZE.
+ Alignment needed for the data segment.
+
+TARGETNAME
+ The name of the target, for run-time lookups.
+ Usually "a.out-<target>"