Remove useless loop in elf.c
authorTristan Gingold <gingold@adacore.com>
Thu, 3 Dec 2015 10:57:29 +0000 (11:57 +0100)
committerTristan Gingold <gingold@adacore.com>
Fri, 4 Dec 2015 11:51:03 +0000 (12:51 +0100)
bfd/ChangeLog
bfd/elf.c

index cc3cc2bbfe298de0aee66993bc909af9681ba347..ab717eae16e4854dab79d5f16938dd59e96a249c 100644 (file)
@@ -1,3 +1,7 @@
+2015-12-04  Tristan Gingold  <gingold@adacore.com>
+
+       * elf.c (rewrite_elf_program_header): Remove useless loop.
+
 2015-12-02  Alan Modra  <amodra@gmail.com>
 
        PR binutils/19315
index 7f38fa0c62c8c09f6465b2097269e1f938a899da..9a2cff5fe511ad7abbc1a275829cf812abd1c22b 100644 (file)
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -6380,13 +6380,9 @@ rewrite_elf_program_header (bfd *ibfd, bfd *obfd)
       first_matching_lma = TRUE;
       first_suggested_lma = TRUE;
 
-      for (section = ibfd->sections;
+      for (section = first_section, j = 0;
           section != NULL;
           section = section->next)
-       if (section == first_section)
-         break;
-
-      for (j = 0; section != NULL; section = section->next)
        {
          if (INCLUDE_SECTION_IN_SEGMENT (section, segment, bed))
            {