]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
ld/
authorMark Shinwell <shinwell@codesourcery.com>
Wed, 21 Jun 2006 14:40:24 +0000 (14:40 +0000)
committerMark Shinwell <shinwell@codesourcery.com>
Wed, 21 Jun 2006 14:40:24 +0000 (14:40 +0000)
* ldlang.c (lang_insert_orphan): Correctly handle the case where
the section is to end up after the section currently at the end
of the list in output_bfd.

ChangeLog.csl
ld/ldlang.c

index 54f22aacf8a03e5fb342f613db31766bee37ff4b..6ec87fe96ad1e60f3dbfb9c4c5964c0a6c48be87 100644 (file)
@@ -1,3 +1,10 @@
+2006-06-21  Mark Shinwell  <shinwell@codesourcery.com>
+
+       ld/
+       * ldlang.c (lang_insert_orphan): Correctly handle the case where
+       the section is to end up after the section currently at the end
+       of the list in output_bfd.
+
 2006-06-19  Vladimir Prus  <vladimir@codesourcery.com>
 
        bfd/
index f6d849e19c9719fd3376841492d47da8fa5eb489..a9b325d59f20c86d607a9ec0d414e3d500a71dff 100644 (file)
@@ -1441,7 +1441,18 @@ lang_insert_orphan (asection *s,
        place->section = &output_bfd->sections;
 
       as = *place->section;
-      if (as != snew && as->prev != snew)
+
+      if (!as)
+        {
+          /* Put the section at the end of the list.  */
+
+         /* Unlink the section.  */
+         bfd_section_list_remove (output_bfd, snew);
+
+         /* Now tack it back on in the right place.  */
+         bfd_section_list_append (output_bfd, snew);
+        }
+      else if (as != snew && as->prev != snew)
        {
          /* Unlink the section.  */
          bfd_section_list_remove (output_bfd, snew);