From: Mark Shinwell Date: Wed, 21 Jun 2006 14:40:24 +0000 (+0000) Subject: ld/ X-Git-Tag: binutils-csl-sourcerygxx-3_4_4-21~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=eaf89de12813be48d6d0e2df275534a6eb7c324d;p=thirdparty%2Fbinutils-gdb.git 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. --- diff --git a/ChangeLog.csl b/ChangeLog.csl index 54f22aacf8a..6ec87fe96ad 100644 --- a/ChangeLog.csl +++ b/ChangeLog.csl @@ -1,3 +1,10 @@ +2006-06-21 Mark Shinwell + + 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 bfd/ diff --git a/ld/ldlang.c b/ld/ldlang.c index f6d849e19c9..a9b325d59f2 100644 --- a/ld/ldlang.c +++ b/ld/ldlang.c @@ -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);