aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2005-03-18 13:56:26 +0000
committerAlan Modra <amodra@gmail.com>2005-03-18 13:56:26 +0000
commit41c7ba7cc251f99e099fb60e1868b951ea5a686f (patch)
tree183e7d5775c3f00f09d8d434bcb1b523c89fef28 /ld
parent554220db5bd1b44f1ad9e1de6888f145c25ba829 (diff)
downloadgdb-41c7ba7cc251f99e099fb60e1868b951ea5a686f.zip
gdb-41c7ba7cc251f99e099fb60e1868b951ea5a686f.tar.gz
gdb-41c7ba7cc251f99e099fb60e1868b951ea5a686f.tar.bz2
* ldlang.c (lang_insert_orphan): Use old section_tail rather than
traversing the bfd section list to find pointer to new section.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog5
-rw-r--r--ld/ldlang.c9
2 files changed, 10 insertions, 4 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index e1a1253..dce7055 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,8 @@
+2005-03-19 Alan Modra <amodra@bigpond.net.au>
+
+ * ldlang.c (lang_insert_orphan): Use old section_tail rather than
+ traversing the bfd section list to find pointer to new section.
+
2005-03-18 Alan Modra <amodra@bigpond.net.au>
* scripttempl/elf.sc: When CREATE_SHLIB, put .sdata2 and .sbss2
diff --git a/ld/ldlang.c b/ld/ldlang.c
index dc805a3..3c4e9ac 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -818,6 +818,7 @@ lang_insert_orphan (lang_input_statement_type *file,
etree_type *load_base;
lang_output_section_statement_type *os;
lang_output_section_statement_type **os_tail;
+ asection **bfd_tail;
/* Start building a list of statements for this section.
First save the current statement pointer. */
@@ -871,6 +872,7 @@ lang_insert_orphan (lang_input_statement_type *file,
os_tail = ((lang_output_section_statement_type **)
lang_output_section_statement.tail);
+ bfd_tail = output_bfd->section_tail;
os = lang_enter_output_section_statement (secname, address, 0, NULL, NULL,
load_base, 0);
@@ -902,7 +904,7 @@ lang_insert_orphan (lang_input_statement_type *file,
if (after != NULL && os->bfd_section != NULL)
{
- asection *snew, **pps;
+ asection *snew;
snew = os->bfd_section;
@@ -929,9 +931,8 @@ lang_insert_orphan (lang_input_statement_type *file,
place->section = &output_bfd->sections;
/* Unlink the section. */
- for (pps = &output_bfd->sections; *pps != snew; pps = &(*pps)->next)
- continue;
- bfd_section_list_remove (output_bfd, pps);
+ ASSERT (*bfd_tail == snew);
+ bfd_section_list_remove (output_bfd, bfd_tail);
/* Now tack it back on in the right place. */
bfd_section_list_insert (output_bfd, place->section, snew);