* ldlang.c (process_insert_statements): ASSERT that output section
authorAlan Modra <amodra@gmail.com>
Mon, 16 Feb 2009 08:02:29 +0000 (08:02 +0000)
committerAlan Modra <amodra@gmail.com>
Mon, 16 Feb 2009 08:02:29 +0000 (08:02 +0000)
statements are in order.

ld/ChangeLog
ld/ldlang.c

index 0636f10ba45d78ed27f941774b95bb0faecf6964..fdb319a508093e8f826ea9e38dcdc977b335d454 100644 (file)
@@ -1,3 +1,8 @@
+2009-02-16  Alan Modra  <amodra@bigpond.net.au>
+
+       * ldlang.c (process_insert_statements): ASSERT that output section
+       statements are in order.
+
 2009-02-16  Alan Modra  <amodra@bigpond.net.au>
 
        * ldlang.c (push_stat_ptr, pop_stat_ptr): New functions.
index 0bd82cb24ab01d2188ca30584ed6184daeb6d0ee..cc390b0b4119e12bdf6ed3464806d515f78380f4 100644 (file)
@@ -3438,7 +3438,10 @@ process_insert_statements (void)
        {
          /* Keep pointers to the first and last output section
             statement in the sequence we may be about to move.  */
-         last_os = &(*s)->output_section_statement;
+         os = &(*s)->output_section_statement;
+
+         ASSERT (last_os == NULL || last_os->next == os);
+         last_os = os;
 
          /* Set constraint negative so that lang_output_section_find
             won't match this output section statement.  At this