[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Description
BFD supports a number of different flavours of a.out format,
though the major differences are only the sizes of the
structures on disk, and the shape of the relocation
information.
The support is split into a basic support file aoutx.h
and other files which derive functions from the base. One
derivation file is aoutf1.h
(for a.out flavour 1), and
adds to the basic a.out functions support for sun3, sun4, 386
and 29k a.out files, to create a target jump vector for a
specific target.
This information is further split out into more specific files
for each machine, including sunos.c
for sun3 and sun4,
newsos3.c
for the Sony NEWS, and demo64.c
for a
demonstration of a 64 bit a.out format.
The base file aoutx.h
defines general mechanisms for
reading and writing records to and from disk, and various
other methods which BFD requires. It is included by
aout32.c
and aout64.c
to form the names
aout_32_swap_exec_header_in, aout_64_swap_exec_header_in, etc.
As an example, this is what goes on to make the back end for a
sun4, from aout32.c
#define ARCH_SIZE 32 #include "aoutx.h"
Which exports names:
... aout_32_canonicalize_reloc aout_32_find_nearest_line aout_32_get_lineno aout_32_get_reloc_upper_bound ...
from sunos.c
#define ARCH 32 #define TARGET_NAME "a.out-sunos-big" #define VECNAME sunos_big_vec #include "aoutf1.h"
requires all the names from aout32.c, and produces the jump vector
sunos_big_vec
The file host-aout.c is a special case. It is for a large set of hosts that use “more or less standard” a.out files, and for which cross-debugging is not interesting. It uses the standard 32-bit a.out support routines, but determines the file offsets and addresses of the text, data, and BSS sections, the machine architecture and machine type, and the entry point address, in a host-dependent manner. Once these values have been determined, generic code is used to handle the object file. When porting it to run on a new system, you must supply:
HOST_PAGE_SIZE HOST_SEGMENT_SIZE HOST_MACHINE_ARCH (optional) HOST_MACHINE_MACHINE (optional) HOST_TEXT_START_ADDR HOST_STACK_END_ADDR
in the file ../include/sys/h-XXX.h
(for your host). These
values, plus the structures and macros defined in a.out.h
on
your host system, will produce a BFD target that will access
ordinary a.out files on your host. To configure a new machine
to use host-aout.c
, specify:
TDEFAULTS = -DDEFAULT_VECTOR=host_aout_big_vec TDEPFILES= host-aout.o trad-core.o
in the config/mt-XXX
file, and modify configure.in to use the
mt-XXX
file (by setting "bfd_target=XXX
") when your
configuration is selected.
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Description
The file aoutx.h
caters for both the standard
and extended forms of a.out relocation records.
The standard records are characterised by containing only an
address, a symbol index and a type field. The extended records
(used on 29ks and sparcs) also have a full integer for an
addend.
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Description
aoutx.h
exports several routines for accessing the
contents of an a.out file, which are gathered and exported in
turn by various format specific files (eg sunos.c).
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
aout_<size>_swap_exec_header_in
Description
Swaps the information in an executable header taken from a raw
byte stream memory image, into the internal exec_header
structure.
void aout_<size>_swap_exec_header_in,
(bfd *abfd,
struct external_exec *raw_bytes,
struct internal_exec *execp);
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
aout_<size>_swap_exec_header_out
Description
Swaps the information in an internal exec header structure
into the supplied buffer ready for writing to disk.
void aout_<size>_swap_exec_header_out
(bfd *abfd,
struct internal_exec *execp,
struct external_exec *raw_bytes);
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
aout_<size>_some_aout_object_p
Description
Some A.OUT variant thinks that the file whose format we’re
checking is an a.out file. Do some more checking, and set up
for access if it really is. Call back to the calling
environments "finish up" function just before returning, to
handle any last-minute setup.
bfd_target *aout_<size>_some_aout_object_p
(bfd *abfd,
bfd_target *(*callback_to_real_object_p)());
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
aout_<size>_mkobject
Description
This routine initializes a BFD for use with a.out files.
boolean aout_<size>_mkobject, (bfd *);
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
aout_<size>_machine_type
Description
Keep track of machine architecture and machine type for
a.out’s. Return the machine_type for a particular
arch&machine, or M_UNKNOWN if that exact arch&machine can’t be
represented in a.out format.
If the architecture is understood, machine type 0 (default)
should always be understood.
enum machine_type aout_<size>_machine_type
(enum bfd_architecture arch,
unsigned long machine));
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
aout_<size>_set_arch_mach
Description
Sets the architecture and the machine of the BFD to those
values supplied. Verifies that the format can support the
architecture required.
boolean aout_<size>_set_arch_mach,
(bfd *,
enum bfd_architecture,
unsigned long machine));
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
aout_<size>new_section_hook
Description
Called by the BFD in response to a bfd_make_section
request.
boolean aout_<size>_new_section_hook,
(bfd *abfd,
asection *newsect));
[Top] | [Contents] | [Index] | [ ? ] |
This document was generated on December 11, 2024 using texi2html 5.0.
The buttons in the navigation panels have the following meaning:
Button | Name | Go to | From 1.2.3 go to |
---|---|---|---|
[ << ] | FastBack | Beginning of this chapter or previous chapter | 1 |
[ < ] | Back | Previous section in reading order | 1.2.2 |
[ Up ] | Up | Up section | 1.2 |
[ > ] | Forward | Next section in reading order | 1.2.4 |
[ >> ] | FastForward | Next chapter | 2 |
[Top] | Top | Cover (top) of document | |
[Contents] | Contents | Table of contents | |
[Index] | Index | Index | |
[ ? ] | About | About (help) |
where the Example assumes that the current position is at Subsubsection One-Two-Three of a document of the following structure:
This document was generated on December 11, 2024 using texi2html 5.0.