summaryrefslogtreecommitdiff
path: root/bfd/elf.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2012-03-23 09:34:57 +0000
committerAlan Modra <amodra@bigpond.net.au>2012-03-23 09:34:57 +0000
commitb443544cc116bf78990bd2a49064def86e79ab07 (patch)
tree5c8f8723179c94ac75f4f7be2216edf52a7cea71 /bfd/elf.c
parent8efd1781af338ecd687515ff6a34d3ab1fe044ed (diff)
downloadbinutils-redhat-b443544cc116bf78990bd2a49064def86e79ab07.tar.gz
* elf.c (assign_file_positions_for_non_load_sections): Don't warn
on empty alloc sections.
Diffstat (limited to 'bfd/elf.c')
-rw-r--r--bfd/elf.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/bfd/elf.c b/bfd/elf.c
index 5aabeeb1cd..df43a6ad4c 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -4820,12 +4820,13 @@ assign_file_positions_for_non_load_sections (bfd *abfd,
BFD_ASSERT (hdr->sh_offset == hdr->bfd_section->filepos);
else if ((hdr->sh_flags & SHF_ALLOC) != 0)
{
- (*_bfd_error_handler)
- (_("%B: warning: allocated section `%s' not in segment"),
- abfd,
- (hdr->bfd_section == NULL
- ? "*unknown*"
- : hdr->bfd_section->name));
+ if (hdr->sh_size != 0)
+ (*_bfd_error_handler)
+ (_("%B: warning: allocated section `%s' not in segment"),
+ abfd,
+ (hdr->bfd_section == NULL
+ ? "*unknown*"
+ : hdr->bfd_section->name));
/* We don't need to page align empty sections. */
if ((abfd->flags & D_PAGED) != 0 && hdr->sh_size != 0)
off += vma_page_aligned_bias (hdr->sh_addr, off,