How It Works




How It Works - Untitled















Next: What BFD Version 2 Can Do,
Previous: History,
Up: Overview



1.2 How To Use BFD

To use the library, include bfd.h and link with libbfd.a.

BFD provides a common interface to the parts of an object file
for a calling application.

When an application successfully opens a target file (object, archive, or
whatever), a pointer to an internal structure is returned. This pointer
points to a structure called bfd, described in
bfd.h. Our convention is to call this pointer a BFD, and
instances of it within code abfd. All operations on
the target object file are applied as methods to the BFD. The mapping is
defined within bfd.h in a set of macros, all beginning
with bfd_ to reduce namespace pollution.

For example, this sequence does what you would probably expect:
return the number of sections in an object file attached to a BFD
abfd.


#include "bfd.h"

unsigned int number_of_sections (abfd)
bfd *abfd;
{
return bfd_count_sections (abfd);
}


The abstraction used within BFD is that an object file has:


a header,
a number of sections containing raw data (see Sections),
a set of relocations (see Relocations), and
some symbol information (see Symbols).

Also, BFDs opened for archives have the additional attribute of an index
and contain subordinate BFDs. This approach is fine for a.out and coff,
but loses efficiency when applied to formats such as S-records and
IEEE-695.





Wyszukiwarka

Podobne podstrony:
ldap how it works
Chi Quaternions and rotations in 3d space how it works (1998) [sharethefiles com]
Earthdawn How It Came to Pass
How DSL Works
04 How The Heart Approaches What It Yearns
How And Why Hypnosis Works
SHSpec 133 6204C17 How and Why Auditing Works
73 Jak mógłbym wyraźniej How can I say it clearer Jay Friedman Oct 1, 1997
You Can Do It How to Photograph Water Drops PopPhoto June 2006
prob analysis how difficult does it need to be
Luther The Marketing Plan How to Prepare and Implement It
Torsion what it is and how does it work
How a lighting circuit works
How the mind works Pinker
Do It Yourself How To Make Hash Oil

więcej podobnych podstron