aboutsummaryrefslogtreecommitdiff
path: root/bfd/elfcode.h
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/elfcode.h')
-rw-r--r--bfd/elfcode.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/bfd/elfcode.h b/bfd/elfcode.h
index d634219..b5da87f 100644
--- a/bfd/elfcode.h
+++ b/bfd/elfcode.h
@@ -656,7 +656,8 @@ elf_object_p (abfd)
/* If the section is loaded, but not page aligned, clear
D_PAGED. */
- if ((i_shdrp[shindex].sh_flags & SHF_ALLOC) != 0
+ if (i_shdrp[shindex].sh_size != 0
+ && (i_shdrp[shindex].sh_flags & SHF_ALLOC) != 0
&& i_shdrp[shindex].sh_type != SHT_NOBITS
&& (((i_shdrp[shindex].sh_addr - i_shdrp[shindex].sh_offset)
% ebd->maxpagesize)