aboutsummaryrefslogtreecommitdiff
path: root/bfd/bfdio.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/bfdio.c')
-rw-r--r--bfd/bfdio.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/bfd/bfdio.c b/bfd/bfdio.c
index 463b387..9aa15c1 100644
--- a/bfd/bfdio.c
+++ b/bfd/bfdio.c
@@ -231,9 +231,11 @@ bfd_bread (void *ptr, bfd_size_type size, bfd *abfd)
}
offset += abfd->origin;
- /* If this is an archive element, don't read past the end of
+ /* If this is a non-thin archive element, don't read past the end of
this element. */
- if (element_bfd->arelt_data != NULL)
+ if (element_bfd->arelt_data != NULL
+ && element_bfd->my_archive != NULL
+ && !bfd_is_thin_archive (element_bfd->my_archive))
{
bfd_size_type maxbytes = arelt_size (element_bfd);