element, since it handles the bookkeeping so nicely for us. */
bfd *
-_bfd_get_elt_at_filepos (bfd *archive, file_ptr filepos)
+_bfd_get_elt_at_filepos (bfd *archive, file_ptr filepos,
+ struct bfd_link_info *info)
{
struct areltdata *new_areldata;
bfd *n_bfd;
free (new_areldata);
return NULL;
}
- n_bfd = _bfd_get_elt_at_filepos (ext_arch, new_areldata->origin);
+ n_bfd = _bfd_get_elt_at_filepos (ext_arch,
+ new_areldata->origin, info);
if (n_bfd == NULL)
{
free (new_areldata);
open the external file as a bfd. */
bfd_set_error (bfd_error_no_error);
n_bfd = open_nested_file (filename, archive);
- if (n_bfd == NULL && bfd_get_error () == bfd_error_no_error)
- bfd_set_error (bfd_error_malformed_archive);
+ if (n_bfd == NULL)
+ {
+ switch (bfd_get_error ())
+ {
+ default:
+ break;
+ case bfd_error_no_error:
+ bfd_set_error (bfd_error_malformed_archive);
+ break;
+ case bfd_error_system_call:
+ if (info != NULL)
+ {
+ info->callbacks->einfo
+ (_("%F%P: %pB(%s): error opening thin archive member: %E\n"),
+ archive, filename);
+ break;
+ }
+ break;
+ }
+ }
}
else
{
carsym *entry;
entry = bfd_ardata (abfd)->symdefs + sym_index;
- return _bfd_get_elt_at_filepos (abfd, entry->file_offset);
+ return _bfd_get_elt_at_filepos (abfd, entry->file_offset, NULL);
}
bfd *
}
}
- return _bfd_get_elt_at_filepos (archive, filestart);
+ return _bfd_get_elt_at_filepos (archive, filestart, NULL);
}
bfd *
we uncompress the archive element if necessary. */
static bfd *
-alpha_ecoff_get_elt_at_filepos (bfd *archive, file_ptr filepos)
+alpha_ecoff_get_elt_at_filepos (bfd *archive, file_ptr filepos,
+ struct bfd_link_info *info)
{
bfd *nbfd = NULL;
struct areltdata *tdata;
ufile_ptr filesize;
buf = NULL;
- nbfd = _bfd_get_elt_at_filepos (archive, filepos);
+ nbfd = _bfd_get_elt_at_filepos (archive, filepos, info);
if (nbfd == NULL)
goto error_return;
}
}
- return alpha_ecoff_get_elt_at_filepos (archive, filestart);
+ return alpha_ecoff_get_elt_at_filepos (archive, filestart, NULL);
}
/* Open the archive file given an index into the armap. */
carsym *entry;
entry = bfd_ardata (abfd)->symdefs + sym_index;
- return alpha_ecoff_get_elt_at_filepos (abfd, entry->file_offset);
+ return alpha_ecoff_get_elt_at_filepos (abfd, entry->file_offset,
+ NULL);
}
static void
}
}
- return _bfd_get_elt_at_filepos (archive, filestart);
+ return _bfd_get_elt_at_filepos (archive, filestart, NULL);
}
/* Stat an element in an XCOFF archive. */
hash = srch;
}
- element = (*backend->get_elt_at_filepos) (abfd, (file_ptr) file_offset);
+ element = (*backend->get_elt_at_filepos) (abfd,
+ (file_ptr) file_offset,
+ info);
if (element == NULL)
return false;
Elf_Internal_Sym *isymend;
bool result;
- abfd = _bfd_get_elt_at_filepos (abfd, symdef->file_offset);
+ abfd = _bfd_get_elt_at_filepos (abfd, symdef->file_offset, NULL);
if (abfd == NULL)
return false;
}
/* We need to include this archive member. */
- element = _bfd_get_elt_at_filepos (abfd, symdef->file_offset);
+ element = _bfd_get_elt_at_filepos (abfd, symdef->file_offset,
+ info);
if (element == NULL)
goto error_return;
extern bool _bfd_compute_and_write_armap
(bfd *, unsigned int) ATTRIBUTE_HIDDEN;
extern bfd *_bfd_get_elt_at_filepos
- (bfd *, file_ptr) ATTRIBUTE_HIDDEN;
+ (bfd *, file_ptr, struct bfd_link_info *) ATTRIBUTE_HIDDEN;
extern bfd *_bfd_generic_get_elt_at_index
(bfd *, symindex) ATTRIBUTE_HIDDEN;
extern bfd * _bfd_new_bfd
extern bool _bfd_compute_and_write_armap
(bfd *, unsigned int) ATTRIBUTE_HIDDEN;
extern bfd *_bfd_get_elt_at_filepos
- (bfd *, file_ptr) ATTRIBUTE_HIDDEN;
+ (bfd *, file_ptr, struct bfd_link_info *) ATTRIBUTE_HIDDEN;
extern bfd *_bfd_generic_get_elt_at_index
(bfd *, symindex) ATTRIBUTE_HIDDEN;
extern bfd * _bfd_new_bfd
(bfd *, struct internal_filehdr *, struct internal_aouthdr *);
/* Read an element from an archive at a given file position. This
is needed because OSF/1 3.2 uses a weird archive format. */
- bfd *(*get_elt_at_filepos) (bfd *, file_ptr);
+ bfd *(*get_elt_at_filepos) (bfd *, file_ptr, struct bfd_link_info *);
};
/* ECOFF targets don't support COFF long section names, so this
if (last_ar_offset != arsym->file_offset)
{
last_ar_offset = arsym->file_offset;
- element = _bfd_get_elt_at_filepos (abfd, last_ar_offset);
+ element = _bfd_get_elt_at_filepos (abfd, last_ar_offset,
+ info);
if (element == NULL
|| !bfd_check_format (element, bfd_object))
goto error_return;