This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: ld output_section_statment related tidy
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Andreas Schwab <schwab at suse dot de>, binutils at sourceware dot org
- Date: Mon, 16 Feb 2009 18:31:44 +1030
- Subject: Re: ld output_section_statment related tidy
- References: <48B43034.9070204@redhat.com> <48B43287.7030808@linux.intel.com> <20080826191933.GA7838@caradoc.them.org> <6dc9ffc80808261245y30d8b0e8u8c5cdaffada33aac@mail.gmail.com> <20080827002101.GA4989@bubble.grove.modra.org> <20080907040432.GB4700@bubble.grove.modra.org> <jehc2ztyl5.fsf@sykes.suse.de> <20090215131238.GG7648@bubble.grove.modra.org> <je4oyvn5ih.fsf@sykes.suse.de> <20090216072251.GI7648@bubble.grove.modra.org>
This should make sure we keep the lists consistent.
* ldlang.c (process_insert_statements): ASSERT that output section
statements are in order.
Index: ld/ldlang.c
===================================================================
RCS file: /cvs/src/src/ld/ldlang.c,v
retrieving revision 1.300
diff -u -p -r1.300 ldlang.c
--- ld/ldlang.c 16 Feb 2009 07:25:52 -0000 1.300
+++ ld/ldlang.c 16 Feb 2009 07:59:12 -0000
@@ -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
--
Alan Modra
Australia Development Lab, IBM