Lines Matching refs:nbfd
59 bfd *nbfd;
61 nbfd = (bfd *) bfd_zmalloc (sizeof (bfd));
62 if (nbfd == NULL)
67 nbfd->id = --bfd_reserved_id_counter;
71 nbfd->id = bfd_id_counter++;
73 nbfd->memory = objalloc_create ();
74 if (nbfd->memory == NULL)
77 free (nbfd);
81 nbfd->arch_info = &bfd_default_arch_struct;
83 if (!bfd_hash_table_init_n (& nbfd->section_htab, bfd_section_hash_newfunc,
86 free (nbfd);
90 return nbfd;
100 bfd *nbfd;
102 nbfd = _bfd_new_bfd ();
103 if (nbfd == NULL)
105 nbfd->xvec = obfd->xvec;
106 nbfd->iovec = obfd->iovec;
108 nbfd->iostream = obfd->iostream;
109 nbfd->my_archive = obfd;
110 nbfd->direction = read_direction;
111 nbfd->target_defaulted = obfd->target_defaulted;
112 return nbfd;
194 bfd *nbfd;
197 nbfd = _bfd_new_bfd ();
198 if (nbfd == NULL)
205 target_vec = bfd_find_target (target, nbfd);
210 _bfd_delete_bfd (nbfd);
216 nbfd->iostream = fdopen (fd, mode);
219 nbfd->iostream = real_fopen (filename, mode);
220 if (nbfd->iostream == NULL)
223 _bfd_delete_bfd (nbfd);
231 nbfd->filename = xstrdup (filename);
237 nbfd->direction = both_direction;
239 nbfd->direction = read_direction;
241 nbfd->direction = write_direction;
243 if (! bfd_cache_init (nbfd))
245 _bfd_delete_bfd (nbfd);
248 nbfd->opened_once = TRUE;
255 (void) bfd_set_cacheable (nbfd, TRUE);
257 return nbfd;
381 bfd *nbfd;
384 nbfd = _bfd_new_bfd ();
385 if (nbfd == NULL)
388 target_vec = bfd_find_target (target, nbfd);
391 _bfd_delete_bfd (nbfd);
395 nbfd->iostream = stream;
398 nbfd->filename = xstrdup (filename);
399 nbfd->direction = read_direction;
401 if (! bfd_cache_init (nbfd))
403 _bfd_delete_bfd (nbfd);
407 return nbfd;
416 void *(*open_func) (struct bfd *nbfd,
419 file_ptr (*pread_func) (struct bfd *nbfd,
424 int (*close_func) (struct bfd *nbfd,
574 bfd *nbfd;
579 nbfd = _bfd_new_bfd ();
580 if (nbfd == NULL)
583 target_vec = bfd_find_target (target, nbfd);
586 _bfd_delete_bfd (nbfd);
592 nbfd->filename = xstrdup (filename);
593 nbfd->direction = read_direction;
596 stream = (*open_p) (nbfd, open_closure);
599 _bfd_delete_bfd (nbfd);
603 vec = (struct opncls *) bfd_zalloc (nbfd, sizeof (struct opncls));
609 nbfd->iovec = &opncls_iovec;
610 nbfd->iostream = vec;
612 return nbfd;
642 bfd *nbfd;
645 /* nbfd has to point to head of malloc'ed block so that bfd_close may
647 nbfd = _bfd_new_bfd ();
648 if (nbfd == NULL)
651 target_vec = bfd_find_target (target, nbfd);
654 _bfd_delete_bfd (nbfd);
660 nbfd->filename = xstrdup (filename);
661 nbfd->direction = write_direction;
663 if (bfd_open_file (nbfd) == NULL)
667 _bfd_delete_bfd (nbfd);
671 return nbfd;
805 bfd *nbfd;
807 nbfd = _bfd_new_bfd ();
808 if (nbfd == NULL)
812 nbfd->filename = xstrdup (filename);
814 nbfd->xvec = templ->xvec;
815 nbfd->direction = no_direction;
816 bfd_set_format (nbfd, bfd_object);
818 return nbfd;