OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gdb-6.8/] [bfd/] [PORTING] - Diff between revs 827 and 840

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 827 Rev 840
        Preliminary Notes on Porting BFD
        Preliminary Notes on Porting BFD
        --------------------------------
        --------------------------------
The 'host' is the system a tool runs *on*.
The 'host' is the system a tool runs *on*.
The 'target' is the system a tool runs *for*, i.e.
The 'target' is the system a tool runs *for*, i.e.
a tool can read/write the binaries of the target.
a tool can read/write the binaries of the target.
Porting to a new host
Porting to a new host
---------------------
---------------------
Pick a name for your host. Call that .
Pick a name for your host. Call that .
( might be sun4, ...)
( might be sun4, ...)
Create a file hosts/.mh.
Create a file hosts/.mh.
Porting to a new target
Porting to a new target
-----------------------
-----------------------
Pick a name for your target. Call that .
Pick a name for your target. Call that .
Call the name for your CPU architecture .
Call the name for your CPU architecture .
You need to create .c and config/.mt,
You need to create .c and config/.mt,
and add a case for it to a case statements in bfd/configure.host and
and add a case for it to a case statements in bfd/configure.host and
bfd/config.bfd, which associates each canonical host type with a BFD
bfd/config.bfd, which associates each canonical host type with a BFD
host type (used as the base of the makefile fragment names), and to the
host type (used as the base of the makefile fragment names), and to the
table in bfd/configure.in which associates each target vector with
table in bfd/configure.in which associates each target vector with
the .o files it uses.
the .o files it uses.
config/.mt is a Makefile fragment.
config/.mt is a Makefile fragment.
The following is usually enough:
The following is usually enough:
DEFAULT_VECTOR=_vec
DEFAULT_VECTOR=_vec
SELECT_ARCHITECTURES=bfd__arch
SELECT_ARCHITECTURES=bfd__arch
See the list of cpu types in archures.c, or "ls cpu-*.c".
See the list of cpu types in archures.c, or "ls cpu-*.c".
If your architecture is new, you need to add it to the tables
If your architecture is new, you need to add it to the tables
in bfd/archures.c, opcodes/configure.in, and binutils/objdump.c.
in bfd/archures.c, opcodes/configure.in, and binutils/objdump.c.
For more information about .mt and .mh files, see config/README.
For more information about .mt and .mh files, see config/README.
The file .c is the hard part.  It implements the
The file .c is the hard part.  It implements the
bfd_target _vec, which includes pointers to
bfd_target _vec, which includes pointers to
functions that do the actual -specific methods.
functions that do the actual -specific methods.
Porting to a  that uses the a.out binary format
Porting to a  that uses the a.out binary format
-------------------------------------------------------
-------------------------------------------------------
In this case, the include file aout-target.h probaby does most
In this case, the include file aout-target.h probaby does most
of what you need. The program gen-aout generates .c for
of what you need. The program gen-aout generates .c for
you automatically for many a.out systems.  Do:
you automatically for many a.out systems.  Do:
        make gen-aout
        make gen-aout
        ./gen-aout  > .c
        ./gen-aout  > .c
(This only works if you are building on the target ("native").
(This only works if you are building on the target ("native").
If you must make a cross-port from scratch, copy the most
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.)
similar existing file that includes aout-target.h, and fix what is wrong.)
Check the parameters in .c, and fix anything that is wrong.
Check the parameters in .c, and fix anything that is wrong.
(Also let us know about it; perhaps we can improve gen-aout.c.)
(Also let us know about it; perhaps we can improve gen-aout.c.)
TARGET_IS_BIG_ENDIAN_P
TARGET_IS_BIG_ENDIAN_P
        Should be defined if  is big-endian.
        Should be defined if  is big-endian.
N_HEADER_IN_TEXT(x)
N_HEADER_IN_TEXT(x)
        See discussion in ../include/aout/aout64.h.
        See discussion in ../include/aout/aout64.h.
BYTES_IN_WORD
BYTES_IN_WORD
        Number of bytes per word. (Usually 4 but can be 8.)
        Number of bytes per word. (Usually 4 but can be 8.)
ARCH
ARCH
        Number of bits per word.  (Usually 32, but can be 64.)
        Number of bits per word.  (Usually 32, but can be 64.)
ENTRY_CAN_BE_ZERO
ENTRY_CAN_BE_ZERO
        Define if the extry point (start address of an
        Define if the extry point (start address of an
        executable program) can be 0x0.
        executable program) can be 0x0.
TEXT_START_ADDR
TEXT_START_ADDR
        The address of the start of the text segemnt in
        The address of the start of the text segemnt in
        virtual memory.  Normally, the same as the entry point.
        virtual memory.  Normally, the same as the entry point.
TARGET_PAGE_SIZE
TARGET_PAGE_SIZE
SEGMENT_SIZE
SEGMENT_SIZE
        Usually, the same as the TARGET_PAGE_SIZE.
        Usually, the same as the TARGET_PAGE_SIZE.
        Alignment needed for the data segment.
        Alignment needed for the data segment.
TARGETNAME
TARGETNAME
        The name of the target, for run-time lookups.
        The name of the target, for run-time lookups.
        Usually "a.out-"
        Usually "a.out-"
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.