* elf.c (assign_file_positions_for_non_load_sections): Don't warn
authorAlan Modra <amodra@gmail.com>
Fri, 23 Mar 2012 09:34:57 +0000 (09:34 +0000)
committerAlan Modra <amodra@gmail.com>
Fri, 23 Mar 2012 09:34:57 +0000 (09:34 +0000)
on empty alloc sections.

bfd/ChangeLog
bfd/elf.c

index c59bb4c6a9484e69e2110365c0c7d5c3c3363e8f..04c3b316012dc3f22068ac47f9b7c54eb07fdd29 100644 (file)
@@ -1,3 +1,8 @@
+2012-03-23  Alan Modra  <amodra@gmail.com>
+
+       * elf.c (assign_file_positions_for_non_load_sections): Don't warn
+       on empty alloc sections.
+
 2012-03-23  Alan Modra  <amodra@gmail.com>
 
        * linker.c (_bfd_nearby_section): New function, split out from..
index 5aabeeb1cdc416cb17432a8d734bb2a788187264..df43a6ad4ced8c864dbf64246dde361333c0b1f4 100644 (file)
--- 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,