home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / gnu / djgpp / src / binutils.2 / bfd / porting < prev    next >
Encoding:
Text File  |  1993-05-30  |  2.1 KB  |  71 lines

  1.     Preliminary Notes on Porting BFD
  2.     --------------------------------
  3.  
  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.
  7.  
  8. Porting to a new host
  9. ---------------------
  10. Pick a name for your host. Call that <host>.
  11. (<host> might be sun4, ...)
  12. Create a file hosts/h-<host>.
  13.  
  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>.
  18.  
  19. config/mt-<target> is a Makefile fragment.
  20. The following usually is enough:
  21. TDEFINES = -DDEFAULT_VECTOR=<target>_vec
  22.  
  23. The file <target>.c is the hard part.  It implements the
  24. bfd_target <target>_vec, which includes pointers to
  25. functions that do the actual <target>-specific methods.
  26.  
  27. Porting to a <target> that uses the a.out binary format
  28. -------------------------------------------------------
  29.  
  30. In this case, the include file aout-target.h probaby does most
  31. of what you need. The program gen-aout generates <target>.c for
  32. you automatically for many a.out systems.  Do:
  33.     make gen-aout
  34.     ./gen-aout <target> > <target>.c
  35. (This only works if you are building on the target ("native").
  36. If you must make a cross-port from scratch, copy  the most
  37. similar existing file that includes aout-target.h, and fix what is wrong.)
  38.  
  39. Check the parameters in <target>.c, and fix anything that is wrong.
  40. (Also let us know about it; perhaps we can improve gen-aout.c.)
  41.  
  42. TARGET_IS_BIG_ENDIAN_P
  43.     Should be defined if <target> is big-endian.
  44.  
  45. N_HEADER_IN_TEXT(x)
  46.     See discussion in ../include/aout/aout32.h.
  47.  
  48. BYTES_IN_WORD
  49.     Number of bytes per word. (Usually 4 but can be 8.)
  50.  
  51. ARCH
  52.     Number of bits per word.  (Usually 32, but can be 64.)
  53.  
  54. ENTRY_CAN_BE_ZERO
  55.     Define if the extry point (start address of an
  56.     executable program) can be 0x0.
  57.  
  58. TEXT_START_ADDR
  59.     The address of the start of the text segemnt in
  60.     virtual memory.  Normally, the same as the entry point.
  61.  
  62. PAGE_SIZE
  63.  
  64. SEGMENT_SIZE
  65.         Usually, the same as the PAGE_SIZE.
  66.         Alignment needed for the data segment.
  67.  
  68. TARGETNAME
  69.     The name of the target, for run-time lookups.
  70.     Usually "a.out-<target>"
  71.