bfd *nbfd;  nbfd = _bfd_new_bfd_contained_in (obfd); if (nbfd == NULL) { bfd_set_error (bfd_error_no_memory); return NULL; } return nbfd;
return _bfd_new_bfd_contained_in (obfd);
static char *get_extended_arelt_filename PARAMS ((bfd *arch,						  const char *name));static boolean do_slurp_bsd_armap PARAMS ((bfd *abfd));static boolean do_slurp_coff_armap PARAMS ((bfd *abfd));static const char *normalize PARAMS ((bfd *, const char *file));static struct areltdata *bfd_ar_hdr_from_filesystem PARAMS ((bfd *abfd,							     const char *));boolean_bfd_generic_mkarchive (abfd)     bfd *abfd;{  abfd->tdata.aout_ar_data = ((struct artdata *)			      bfd_zalloc (abfd, sizeof (struct artdata)));  if (bfd_ardata (abfd) == NULL)    {      bfd_set_error (bfd_error_no_memory);      return false;    }  bfd_ardata (abfd)->cache = NULL;  bfd_ardata (abfd)->archive_head = NULL;  bfd_ardata (abfd)->symdefs = NULL;  bfd_ardata (abfd)->extended_names = NULL;  bfd_ardata (abfd)->tdata = NULL;  return true;}/*FUNCTION	bfd_get_next_mapentSYNOPSIS	symindex bfd_get_next_mapent(bfd *abfd, symindex previous, carsym **sym);DESCRIPTION	Step through archive @var{abfd}'s symbol table (if it	has one).  Successively update @var{sym} with the next symbol's	information, returning that symbol's (internal) index into the	symbol table.	Supply <<BFD_NO_MORE_SYMBOLS>> as the @var{previous} entry to get	the first one; returns <<BFD_NO_MORE_SYMBOLS>> when you've already	got the last one.	A <<carsym>> is a canonical archive symbol.  The only	user-visible element is its name, a null-terminated string.*/symindexbfd_get_next_mapent (abfd, prev, entry)     bfd *abfd;     symindex prev;     carsym **entry;{  if (!bfd_has_map (abfd))    {      bfd_set_error (bfd_error_invalid_operation);      return BFD_NO_MORE_SYMBOLS;    }  if (prev == BFD_NO_MORE_SYMBOLS)    prev = 0;  else    ++prev;  if (prev >= bfd_ardata (abfd)->symdef_count)    return BFD_NO_MORE_SYMBOLS;  *entry = (bfd_ardata (abfd)->symdefs + prev);  return prev;}/* To be called by backends only */bfd *_bfd_create_empty_archive_element_shell (obfd)     bfd *obfd;{  bfd *nbfd;  nbfd = _bfd_new_bfd_contained_in (obfd);  if (nbfd == NULL)    {      bfd_set_error (bfd_error_no_memory);      return NULL;    }  return nbfd;}/*FUNCTION	bfd_set_archive_headSYNOPSIS	boolean bfd_set_archive_head(bfd *output, bfd *new_head);DESCRIPTION	Set the head of the chain of	BFDs contained in the archive @var{output} to @var{new_head}.*/booleanbfd_set_archive_head (output_archive, new_head)     bfd *output_archive;     bfd *new_head;{  output_archive->archive_head = new_head;  return true;}bfd *_bfd_look_for_bfd_in_cache (arch_bfd, filepos)     bfd *arch_bfd;     file_ptr filepos;{  struct ar_cache *current;  for (current = bfd_ardata (arch_bfd)->cache; current != NULL;       current = current->next)    if (current->ptr == filepos)      return current->arelt;  return NULL;}/* Kind of stupid to call cons for each one, but we don't do too many */boolean_bfd_add_bfd_to_archive_cache (arch_bfd, filepos, new_elt)     bfd *arch_bfd, *new_elt;     file_ptr filepos;{  struct ar_cache *new_cache = ((struct ar_cache *)				bfd_zalloc (arch_bfd,					    sizeof (struct ar_cache)));  if (new_cache == NULL)    {      bfd_set_error (bfd_error_no_memory);      return false;    }  new_cache->ptr = filepos;  new_cache->arelt = new_elt;  new_cache->next = (struct ar_cache *) NULL;  if (bfd_ardata (arch_bfd)->cache == NULL)    bfd_ardata (arch_bfd)->cache = new_cache;  else    {      struct ar_cache *current = bfd_ardata (arch_bfd)->cache;      while (current->next != NULL)	current = current->next;      current->next = new_cache;    }  return true;}/* The name begins with space.  Hence the rest of the name is an index into   the string table. */static char *get_extended_arelt_filename (arch, name)     bfd *arch;     const char *name;{  unsigned long index = 0;  /* Should extract string so that I can guarantee not to overflow into     the next region, but I'm too lazy. */  errno = 0;  /* Skip first char, which is '/' in SVR4 or ' ' in some other variants. */  index = strtol (name + 1, NULL, 10);  if (errno != 0)    {      bfd_set_error (bfd_error_malformed_archive);      return NULL;    }  return bfd_ardata (arch)->extended_names + index;}