gas: blackfin: add tests for recent loop label fixes
[deliverable/binutils-gdb.git] / bfd / bfdio.c
index 4c13a767384add1ee9dbf7fe8d5b3b9d39a663c7..ce92781d505a8f4ee0c5efb16232b71119cfc4e8 100644 (file)
@@ -180,8 +180,12 @@ bfd_bread (void *ptr, bfd_size_type size, bfd *abfd)
   if (abfd->arelt_data != NULL)
     {
       size_t maxbytes = ((struct areltdata *) abfd->arelt_data)->parsed_size;
-      if (size > maxbytes)
-       size = maxbytes;
+      if (abfd->where + size > maxbytes)
+        {
+          if (abfd->where >= maxbytes)
+            return 0;
+          size = maxbytes - abfd->where;
+        }
     }
 
   if (abfd->iovec)
This page took 0.023775 seconds and 4 git commands to generate.