This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Remove useless loop in elf.c


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=461c4b2edee2f0a4ee7dec0001a6fabf46454a24

commit 461c4b2edee2f0a4ee7dec0001a6fabf46454a24
Author: Tristan Gingold <gingold@adacore.com>
Date:   Thu Dec 3 11:57:29 2015 +0100

    Remove useless loop in elf.c

Diff:
---
 bfd/ChangeLog | 4 ++++
 bfd/elf.c     | 6 +-----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index cc3cc2b..ab717ea 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -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
diff --git a/bfd/elf.c b/bfd/elf.c
index 7f38fa0..9a2cff5 100644
--- 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))
 	    {


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]