daily update
[deliverable/binutils-gdb.git] / bfd / elf.c
index 73a8713e218334000c7e4bc2c1b74c068a2c902f..ab23a190b94860cfc0cc62745616e5eb01299b9b 100644 (file)
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -4662,12 +4662,13 @@ assign_file_positions_for_non_load_sections (bfd *abfd,
        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)));
          if ((abfd->flags & D_PAGED) != 0)
            off += vma_page_aligned_bias (hdr->sh_addr, off,
                                          bed->maxpagesize);
@@ -5401,7 +5402,7 @@ rewrite_elf_program_header (bfd *ibfd, bfd *obfd)
         all of the sections we have selected.  */
       amt = sizeof (struct elf_segment_map);
       amt += ((bfd_size_type) section_count - 1) * sizeof (asection *);
-      map = bfd_alloc (obfd, amt);
+      map = bfd_zalloc (obfd, amt);
       if (map == NULL)
        return FALSE;
 
@@ -5796,7 +5797,7 @@ copy_elf_program_header (bfd *ibfd, bfd *obfd)
       amt = sizeof (struct elf_segment_map);
       if (section_count != 0)
        amt += ((bfd_size_type) section_count - 1) * sizeof (asection *);
-      map = bfd_alloc (obfd, amt);
+      map = bfd_zalloc (obfd, amt);
       if (map == NULL)
        return FALSE;
 
This page took 0.025049 seconds and 4 git commands to generate.