bfd/
[deliverable/binutils-gdb.git] / bfd / libbfd.c
index be090e9b069819ae67b0455d769ce33002316861..2791ca32a70593df16647bd0aae5c0201cb07dbb 100644 (file)
@@ -692,10 +692,12 @@ _bfd_generic_get_section_contents (bfd *abfd,
                                   file_ptr offset,
                                   bfd_size_type count)
 {
+  bfd_size_type sz;
   if (count == 0)
     return TRUE;
 
-  if (offset + count > section->_raw_size)
+  sz = section->rawsize ? section->rawsize : section->size;
+  if (offset + count > sz)
     {
       bfd_set_error (bfd_error_invalid_operation);
       return FALSE;
@@ -717,6 +719,8 @@ _bfd_generic_get_section_contents_in_window
    bfd_size_type count ATTRIBUTE_UNUSED)
 {
 #ifdef USE_MMAP
+  bfd_size_type sz;
+
   if (count == 0)
     return TRUE;
   if (abfd->xvec->_bfd_get_section_contents
@@ -744,7 +748,8 @@ _bfd_generic_get_section_contents_in_window
       w->data = w->i->data;
       return bfd_get_section_contents (abfd, section, w->data, offset, count);
     }
-  if (offset + count > section->_raw_size
+  sz = section->rawsize ? section->rawsize : section->size;
+  if (offset + count > sz
       || ! bfd_get_file_window (abfd, section->filepos + offset, count, w,
                                TRUE))
     return FALSE;
@@ -818,11 +823,11 @@ _bfd_generic_verify_endian_match (bfd *ibfd, bfd *obfd)
       const char *msg;
 
       if (bfd_big_endian (ibfd))
-       msg = _("%s: compiled for a big endian system and target is little endian");
+       msg = _("%B: compiled for a big endian system and target is little endian");
       else
-       msg = _("%s: compiled for a little endian system and target is big endian");
+       msg = _("%B: compiled for a little endian system and target is big endian");
 
-      (*_bfd_error_handler) (msg, bfd_archive_filename (ibfd));
+      (*_bfd_error_handler) (msg, ibfd);
 
       bfd_set_error (bfd_error_wrong_format);
       return FALSE;
This page took 0.024663 seconds and 4 git commands to generate.