osprey/cygnus/bfd/archive.c File Reference

#include "bfd.h"
#include "sysdep.h"
#include "libbfd.h"
#include "aout/ar.h"
#include "aout/ranlib.h"
#include "safe-ctype.h"

Include dependency graph for archive.c:

Go to the source code of this file.

Data Types

type  ar_cache

Defines

#define ar_padchar(abfd)   ((abfd)->xvec->ar_pad_char)
#define ar_maxnamelen(abfd)   ((abfd)->xvec->ar_max_namelen)
#define arch_eltdata(bfd)   ((struct areltdata *) ((bfd)->arelt_data))
#define arch_hdr(bfd)   ((struct ar_hdr *) arch_eltdata(bfd)->arch_header)
#define BSD_SYMDEF_SIZE   8
#define BSD_SYMDEF_OFFSET_SIZE   4
#define BSD_SYMDEF_COUNT_SIZE   4
#define BSD_STRING_COUNT_SIZE   4
#define HPUX_SYMDEF_COUNT_SIZE   2
#define getuid()   0
#define getgid()   0
#define foo(arelt, stelt, size)
#define foo2(arelt, stelt, size)   foo (arelt, stelt, size)

Functions/Subroutines

bfd_boolean _bfd_generic_mkarchive (bfd *abfd)
symindex bfd_get_next_mapent (bfd *abfd, symindex prev, carsym **entry)
bfd_bfd_create_empty_archive_element_shell (bfd *obfd)
bfd_boolean bfd_set_archive_head (bfd *output_archive, bfd *new_head)
bfd_bfd_look_for_bfd_in_cache (bfd *arch_bfd, file_ptr filepos)
bfd_boolean _bfd_add_bfd_to_archive_cache (bfd *arch_bfd, file_ptr filepos, bfd *new_elt)
static char * get_extended_arelt_filename (bfd *arch, const char *name)
void_bfd_generic_read_ar_hdr (bfd *abfd)
void_bfd_generic_read_ar_hdr_mag (bfd *abfd, const char *mag)
bfd_bfd_get_elt_at_filepos (bfd *archive, file_ptr filepos)
bfd_bfd_generic_get_elt_at_index (bfd *abfd, symindex index)
bfdbfd_openr_next_archived_file (bfd *archive, bfd *last_file)
bfdbfd_generic_openr_next_archived_file (bfd *archive, bfd *last_file)
const bfd_targetbfd_generic_archive_p (bfd *abfd)
static bfd_boolean do_slurp_bsd_armap (bfd *abfd)
static bfd_boolean do_slurp_coff_armap (bfd *abfd)
bfd_boolean bfd_slurp_armap (bfd *abfd)
bfd_boolean bfd_slurp_bsd_armap_f2 (bfd *abfd)
bfd_boolean _bfd_slurp_extended_name_table (bfd *abfd)
static const char * normalize (bfd *abfd ATTRIBUTE_UNUSED, const char *file)
bfd_boolean _bfd_archive_bsd_construct_extended_name_table (bfd *abfd, char **tabloc, bfd_size_type *tablen, const char **name)
bfd_boolean _bfd_archive_coff_construct_extended_name_table (bfd *abfd, char **tabloc, bfd_size_type *tablen, const char **name)
bfd_boolean _bfd_construct_extended_name_table (bfd *abfd, bfd_boolean trailing_slash, char **tabloc, bfd_size_type *tablen)
static struct areltdatabfd_ar_hdr_from_filesystem (bfd *abfd, const char *filename, bfd *member)
struct ar_hdrbfd_special_undocumented_glue (bfd *, const char *)
int bfd_generic_stat_arch_elt (bfd *abfd, struct stat *buf)
void bfd_dont_truncate_arname (bfd *abfd, const char *pathname, char *arhdr)
void bfd_bsd_truncate_arname (bfd *abfd, const char *pathname, char *arhdr)
void bfd_gnu_truncate_arname (bfd *abfd, const char *pathname, char *arhdr)
bfd_boolean _bfd_write_archive_contents (bfd *arch)
bfd_boolean _bfd_compute_and_write_armap (bfd *arch, unsigned int elength)
bfd_boolean bsd_write_armap (bfd *arch, unsigned int elength, struct orl *map, unsigned int orl_count, int stridx)
bfd_boolean _bfd_archive_bsd_update_armap_timestamp (bfd *arch)
bfd_boolean coff_write_armap (bfd *arch, unsigned int elength, struct orl *map, unsigned int symbol_count, int stridx)

Variables

int errno


Define Documentation

#define ar_maxnamelen ( abfd   )     ((abfd)->xvec->ar_max_namelen)

#define ar_padchar ( abfd   )     ((abfd)->xvec->ar_pad_char)

#define arch_eltdata ( bfd   )     ((struct areltdata *) ((bfd)->arelt_data))

#define arch_hdr ( bfd   )     ((struct ar_hdr *) arch_eltdata(bfd)->arch_header)

#define BSD_STRING_COUNT_SIZE   4

Definition at line 666 of file archive.c.

Referenced by bfd_slurp_bsd_armap_f2(), and do_slurp_bsd_armap().

#define BSD_SYMDEF_COUNT_SIZE   4

Definition at line 663 of file archive.c.

Referenced by do_slurp_bsd_armap().

#define BSD_SYMDEF_OFFSET_SIZE   4

Definition at line 660 of file archive.c.

Referenced by bfd_slurp_bsd_armap_f2(), bsd_write_armap(), and do_slurp_bsd_armap().

#define BSD_SYMDEF_SIZE   8

Definition at line 657 of file archive.c.

Referenced by bfd_slurp_bsd_armap_f2(), bsd_write_armap(), and do_slurp_bsd_armap().

#define foo ( arelt,
stelt,
size   ) 

Value:

buf->stelt = strtol (hdr->arelt, &aloser, size);  \
  if (aloser == hdr->arelt)             \
    return -1;

#define foo2 ( arelt,
stelt,
size   )     foo (arelt, stelt, size)

#define getgid ( void   )     0

Definition at line 1312 of file archive.c.

Referenced by _PXFGETGID(), bfd_ar_hdr_from_filesystem(), bsd_write_armap(), and getgid_().

#define getuid ( void   )     0

Definition at line 1308 of file archive.c.

Referenced by _PXFGETUID(), bfd_ar_hdr_from_filesystem(), bsd_write_armap(), and getuid_().

#define HPUX_SYMDEF_COUNT_SIZE   2

Definition at line 902 of file archive.c.

Referenced by bfd_slurp_bsd_armap_f2().


Function Documentation

bfd_boolean _bfd_add_bfd_to_archive_cache ( bfd arch_bfd,
file_ptr  filepos,
bfd new_elt 
)

Definition at line 267 of file archive.c.

References ar_cache::arelt, bfd_ardata, bfd_zalloc(), FALSE, ar_cache::next, NULL, ar_cache::ptr, and TRUE.

Referenced by _bfd_get_elt_at_filepos().

bfd_boolean _bfd_archive_bsd_construct_extended_name_table ( bfd abfd,
char **  tabloc,
bfd_size_type tablen,
const char **  name 
)

Definition at line 1148 of file archive.c.

References _bfd_construct_extended_name_table(), and FALSE.

bfd_boolean _bfd_archive_bsd_update_armap_timestamp ( bfd arch  ) 

bfd_boolean _bfd_archive_coff_construct_extended_name_table ( bfd abfd,
char **  tabloc,
bfd_size_type tablen,
const char **  name 
)

Definition at line 1160 of file archive.c.

References _bfd_construct_extended_name_table(), and TRUE.

bfd_boolean _bfd_compute_and_write_armap ( bfd arch,
unsigned int  elength 
)

bfd_boolean _bfd_construct_extended_name_table ( bfd abfd,
bfd_boolean  trailing_slash,
char **  tabloc,
bfd_size_type tablen 
)

bfd* _bfd_create_empty_archive_element_shell ( bfd obfd  ) 

bfd* _bfd_generic_get_elt_at_index ( bfd abfd,
symindex  index 
)

Definition at line 510 of file archive.c.

References _bfd_get_elt_at_filepos(), bfd_ardata, and carsym::file_offset.

Referenced by vms_get_elt_at_index().

bfd_boolean _bfd_generic_mkarchive ( bfd abfd  ) 

Definition at line 165 of file archive.c.

References bfd::aout_ar_data, bfd_ardata, bfd_zalloc(), FALSE, NULL, bfd::tdata, and TRUE.

void* _bfd_generic_read_ar_hdr ( bfd abfd  ) 

Definition at line 323 of file archive.c.

References _bfd_generic_read_ar_hdr_mag(), and NULL.

void* _bfd_generic_read_ar_hdr_mag ( bfd abfd,
const char *  mag 
)

bfd* _bfd_get_elt_at_filepos ( bfd archive,
file_ptr  filepos 
)

bfd* _bfd_look_for_bfd_in_cache ( bfd arch_bfd,
file_ptr  filepos 
)

Definition at line 252 of file archive.c.

References ar_cache::arelt, bfd_ardata, ar_cache::next, NULL, and ar_cache::ptr.

Referenced by _bfd_get_elt_at_filepos().

bfd_boolean _bfd_slurp_extended_name_table ( bfd abfd  ) 

Extended name table.

Normally archives support only 14-character filenames.

Intel has extended the format: longer names are stored in a special element (the first in the archive, or second if there is an armap); the name in the ar_hdr is replaced by <space><index into="" filename="" element>="">. Index is the P.R. of an int (decimal). Data General have extended the format by using the prefix // for the special element.

Definition at line 1013 of file archive.c.

References _bfd_read_ar_hdr, bfd_ardata, bfd_bread(), bfd_error_malformed_archive, bfd_error_system_call, bfd_get_error(), bfd_release(), bfd_seek(), bfd_set_error(), bfd_tell(), bfd_zalloc(), FALSE, NULL, areltdata::parsed_size, SEEK_CUR, SEEK_SET, strncmp(), and TRUE.

Referenced by bfd_generic_archive_p().

bfd_boolean _bfd_write_archive_contents ( bfd arch  ) 

static struct areltdata* bfd_ar_hdr_from_filesystem ( bfd abfd,
const char *  filename,
bfd member 
) [static, read]

void bfd_bsd_truncate_arname ( bfd abfd,
const char *  pathname,
char *  arhdr 
)

Definition at line 1504 of file archive.c.

References ar_maxnamelen, ar_hdr::ar_name, ar_padchar, filename, length, memcpy, NULL, strlen(), and strrchr().

Referenced by bfd_dont_truncate_arname().

void bfd_dont_truncate_arname ( bfd abfd,
const char *  pathname,
char *  arhdr 
)

const bfd_target* bfd_generic_archive_p ( bfd abfd  ) 

bfd* bfd_generic_openr_next_archived_file ( bfd archive,
bfd last_file 
)

Definition at line 549 of file archive.c.

References _bfd_get_elt_at_filepos(), arelt_size, bfd_ardata, bfd::my_archive, bfd::origin, and size.

int bfd_generic_stat_arch_elt ( bfd abfd,
struct stat buf 
)

symindex bfd_get_next_mapent ( bfd abfd,
symindex  prev,
carsym **  entry 
)

void bfd_gnu_truncate_arname ( bfd abfd,
const char *  pathname,
char *  arhdr 
)

Definition at line 1552 of file archive.c.

References ar_maxnamelen, ar_hdr::ar_name, ar_padchar, filename, length, memcpy, NULL, strlen(), and strrchr().

bfd* bfd_openr_next_archived_file ( bfd archive,
bfd last_file 
)

bfd_boolean bfd_set_archive_head ( bfd output_archive,
bfd new_head 
)

Definition at line 245 of file archive.c.

References bfd::archive_head, and TRUE.

Referenced by pe_dll_generate_implib().

bfd_boolean bfd_slurp_armap ( bfd abfd  ) 

bfd_boolean bfd_slurp_bsd_armap_f2 ( bfd abfd  ) 

struct ar_hdr * bfd_special_undocumented_glue ( bfd abfd,
const char *  filename 
) [read]

Definition at line 1401 of file archive.c.

References areltdata::arch_header, bfd_ar_hdr_from_filesystem(), and NULL.

bfd_boolean bsd_write_armap ( bfd arch,
unsigned int  elength,
struct orl map,
unsigned int  orl_count,
int  stridx 
)

bfd_boolean coff_write_armap ( bfd arch,
unsigned int  elength,
struct orl map,
unsigned int  symbol_count,
int  stridx 
)

static bfd_boolean do_slurp_bsd_armap ( bfd abfd  )  [static]

static bfd_boolean do_slurp_coff_armap ( bfd abfd  )  [static]

static char* get_extended_arelt_filename ( bfd arch,
const char *  name 
) [static]

static const char* normalize ( bfd *abfd  ATTRIBUTE_UNUSED,
const char *  file 
) [static]


Variable Documentation

int errno


Generated on Wed Apr 8 14:46:11 2009 for Open64 by  doxygen 1.5.6