bfd_byte *p_end;
bfd_vma len;
const char *std_sec;
+ ufile_ptr filesize;
/* PR 17512: file: 2844a11d. */
if (hdr->sh_size == 0)
return;
- if (hdr->sh_size > bfd_get_file_size (abfd))
+
+ filesize = bfd_get_file_size (abfd);
+ if (filesize != 0 && hdr->sh_size > filesize)
{
/* xgettext:c-format */
_bfd_error_handler (_("%pB: error: attribute section '%pA' too big: %#llx"),