* bfdio.c (bfd_tell): Handle nested archives.
(bfd_seek): Ditto.
* cache.c (bfd_cache_lookup_worker): Ditto.
* archive.c (_bfd_get_elt_at_filepos): Remove code dealing with
nested archives.
(bfd_generic_openr_next_archived_file): Likewise.
+2012-01-10 Tristan Gingold <gingold@adacore.com>
+
+ * bfdio.c (bfd_tell): Handle nested archives.
+ (bfd_seek): Ditto.
+ * cache.c (bfd_cache_lookup_worker): Ditto.
+ * archive.c (_bfd_get_elt_at_filepos): Remove code dealing with
+ nested archives.
+ (bfd_generic_openr_next_archived_file): Likewise.
+
2012-01-09 Iain Sandoe <idsandoe@googlemail.com>
* mach-o.c (bfd_mach_o_bfd_copy_private_symbol_data): Implement.
bfd *n_nfd;
char *filename;
- if (archive->my_archive)
- {
- filepos += archive->origin;
- archive = archive->my_archive;
- }
-
n_nfd = _bfd_look_for_bfd_in_cache (archive, filepos);
if (n_nfd)
return n_nfd;
filestart = last_file->proxy_origin;
if (! bfd_is_thin_archive (archive))
filestart += size;
- if (archive->my_archive)
- filestart -= archive->origin;
/* Pad to an even boundary...
Note that last_file->origin can be odd in the case of
BSD-4.4-style element with a long odd size. */
if (abfd->iovec)
{
+ bfd *parent_bfd = abfd;
ptr = abfd->iovec->btell (abfd);
- if (abfd->my_archive)
- ptr -= abfd->origin;
+ while (parent_bfd->my_archive != NULL)
+ {
+ ptr -= parent_bfd->origin;
+ parent_bfd = parent_bfd->my_archive;
+ }
}
else
ptr = 0;
}
file_position = position;
- if (direction == SEEK_SET && abfd->my_archive != NULL)
- file_position += abfd->origin;
+ if (direction == SEEK_SET)
+ {
+ bfd *parent_bfd = abfd;
+
+ while (parent_bfd->my_archive != NULL)
+ {
+ file_position += parent_bfd->origin;
+ parent_bfd = parent_bfd->my_archive;
+ }
+ }
if (abfd->iovec)
result = abfd->iovec->bseek (abfd, file_position, direction);
if ((abfd->flags & BFD_IN_MEMORY) != 0)
abort ();
- if (abfd->my_archive)
+ while (abfd->my_archive)
abfd = abfd->my_archive;
if (abfd->iostream != NULL)