3.3 Format type dependent functions
Every target vector has three arrays of function pointers which are
indexed by the BFD format type. The BFD format types are as follows:
- `bfd_unknown'
- Unknown format. Not used for anything useful.
- `bfd_object'
- Object file.
- `bfd_archive'
- Archive file.
- `bfd_core'
- Core file.
The three arrays of function pointers are as follows:
- `bfd_check_format'
- Check whether the BFD is of a particular format (object file, archive
file, or core file) corresponding to this target vector. This is called
by the `bfd_check_format' function when examining an existing BFD.
If the BFD matches the desired format, this function will initialize any
format specific information such as the `tdata' field of the BFD.
This function must be called before any other BFD target vector function
on a file opened for reading.
- `bfd_set_format'
- Set the format of a BFD which was created for output. This is called by
the `bfd_set_format' function after creating the BFD with a
function such as `bfd_openw'. This function will initialize format
specific information required to write out an object file or whatever of
the given format. This function must be called before any other BFD
target vector function on a file opened for writing.
- `bfd_write_contents'
- Write out the contents of the BFD in the given format. This is called
by `bfd_close' function for a BFD opened for writing. This really
should not be an array selected by format type, as the
`bfd_set_format' function provides all the required information.
In fact, BFD will fail if a different format is used when calling
through the `bfd_set_format' and the `bfd_write_contents'
arrays; fortunately, since `bfd_close' gets it right, this is a
difficult error to make.
This document was generated
by system on December, 2 2004
using texi2html