URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-old/] [gdb-7.1/] [bfd/] [PORTING] - Rev 843
Go to most recent revision | Compare with Previous | Blame | View Log
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/<host>.mh.Porting to a new target-----------------------Pick a name for your target. Call that <target>.Call the name for your CPU architecture <cpu>.You need to create <target>.c and config/<target>.mt,and add a case for it to a case statements in bfd/configure.host andbfd/config.bfd, which associates each canonical host type with a BFDhost type (used as the base of the makefile fragment names), and to thetable in bfd/configure.in which associates each target vector withthe .o files it uses.config/<target>.mt is a Makefile fragment.The following is usually enough:DEFAULT_VECTOR=<target>_vecSELECT_ARCHITECTURES=bfd_<cpu>_archSee the list of cpu types in archures.c, or "ls cpu-*.c".If your architecture is new, you need to add it to the tablesin bfd/archures.c, opcodes/configure.in, and binutils/objdump.c.For more information about .mt and .mh files, see config/README.The file <target>.c is the hard part. It implements thebfd_target <target>_vec, which includes pointers tofunctions 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 mostof what you need. The program gen-aout generates <target>.c foryou 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 mostsimilar 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_PShould be defined if <target> is big-endian.N_HEADER_IN_TEXT(x)See discussion in ../include/aout/aout64.h.BYTES_IN_WORDNumber of bytes per word. (Usually 4 but can be 8.)ARCHNumber of bits per word. (Usually 32, but can be 64.)ENTRY_CAN_BE_ZERODefine if the extry point (start address of anexecutable program) can be 0x0.TEXT_START_ADDRThe address of the start of the text segemnt invirtual memory. Normally, the same as the entry point.TARGET_PAGE_SIZESEGMENT_SIZEUsually, the same as the TARGET_PAGE_SIZE.Alignment needed for the data segment.TARGETNAMEThe name of the target, for run-time lookups.Usually "a.out-<target>"
Go to most recent revision | Compare with Previous | Blame | View Log
