summaryrefslogtreecommitdiff
path: root/bfd/bfdio.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2021-12-24 15:42:43 -0800
committerH.J. Lu <hjl.tools@gmail.com>2021-12-28 05:27:29 -0800
commitc17eb63b7f69329307ba5f225364a993cfb45dca (patch)
treec120438977bf18a419f871b88a5710e6dc2f6190 /bfd/bfdio.c
parent443aa5f05edb58fc1774f926e9259b7c5a180926 (diff)
downloadbinutils-gdb-c17eb63b7f69329307ba5f225364a993cfb45dca.tar.gz
bfd: Don't check non-thin archive member file size
There is no need to check member file size for thin archive member. * bfdio.c (bfd_bread): Don't check non-thin archive member file size.
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 463b3879c52..9aa15c1ffa4 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);