]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* elf.c (assign_file_positions_for_load_sections): When checking
authorAlan Modra <amodra@gmail.com>
Thu, 9 Oct 2008 01:03:17 +0000 (01:03 +0000)
committerAlan Modra <amodra@gmail.com>
Thu, 9 Oct 2008 01:03:17 +0000 (01:03 +0000)
a segment for contents, don't assume that a non-TLS nobits section
must only be followed by nobits sections.

bfd/ChangeLog
bfd/elf.c

index bf7b48902b763885f1f7effd32174c734088bac6..d434e7f0c093db069c7562d6b86eef394163456b 100644 (file)
@@ -1,3 +1,9 @@
+2008-10-08  Alan Modra  <amodra@bigpond.net.au>
+
+       * elf.c (assign_file_positions_for_load_sections): When checking
+       a segment for contents, don't assume that a non-TLS nobits section
+       must only be followed by nobits sections.
+
 2008-10-02  Tristan Gingold  <gingold@adacore.com>
 
        * configure.in: Bump version to 2.18.92
index 7822c6e99d17aa9966fb6607b2ff183525cb958d..6406b740519842b387bca10f0736d21d7aa94d4e 100644 (file)
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -4263,21 +4263,14 @@ assign_file_positions_for_load_sections (bfd *abfd,
              elf_section_type (m->sections[i]) = SHT_NOBITS;
 
          /* Find out whether this segment contains any loadable
-            sections.  If the first section isn't loadable, the same
-            holds for any other sections.  */
-         i = 0;
-         while (elf_section_type (m->sections[i]) == SHT_NOBITS)
-           {
-             /* If a segment starts with .tbss, we need to look
-                at the next section to decide whether the segment
-                has any loadable sections.  */
-             if ((elf_section_flags (m->sections[i]) & SHF_TLS) == 0
-                 || ++i >= m->count)
-               {
-                 no_contents = TRUE;
-                 break;
-               }
-           }
+            sections.  */
+         no_contents = TRUE;
+         for (i = 0; i < m->count; i++)
+           if (elf_section_type (m->sections[i]) != SHT_NOBITS)
+             {
+               no_contents = FALSE;
+               break;
+             }
 
          off_adjust = vma_page_aligned_bias (m->sections[0]->vma, off, align);
          off += off_adjust;