aboutsummaryrefslogtreecommitdiff
path: root/ld/ldlang.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2005-12-19 15:06:40 +0000
committerH.J. Lu <hjl.tools@gmail.com>2005-12-19 15:06:40 +0000
commit15445c8e19dfaa3762e42c3d78f93f832b700b1b (patch)
tree6c5cad0010806f6ce40ec90f54330170df0b2587 /ld/ldlang.c
parentdca1bfa85b44a4799cfd6c8473c2c93499dbe5e6 (diff)
downloadgdb-15445c8e19dfaa3762e42c3d78f93f832b700b1b.zip
gdb-15445c8e19dfaa3762e42c3d78f93f832b700b1b.tar.gz
gdb-15445c8e19dfaa3762e42c3d78f93f832b700b1b.tar.bz2
2005-12-19 H.J. Lu <hongjiu.lu@intel.com>
PR ld/2065 * ldlang.c (output_statement_newfunc): Revert the change made on 2005-11-16. (output_prev_sec_find): Likewsise. * ldlang.h (lang_statement_list_type): Likewsise.
Diffstat (limited to 'ld/ldlang.c')
-rw-r--r--ld/ldlang.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/ld/ldlang.c b/ld/ldlang.c
index 0e72ab8..8ef48d1 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -912,8 +912,6 @@ output_statement_newfunc (struct bfd_hash_entry *entry,
(lang_statement_union_type *) &ret->os,
&ret->os.header.next);
- ret->os.prev = &((*lang_output_section_statement.tail)
- ->output_section_statement);
/* GCC's strict aliasing rules prevent us from just casting the
address, so we store the pointer in a variable and cast that
instead. */
@@ -1292,15 +1290,20 @@ lang_output_section_find_by_flags (const asection *sec,
static asection *
output_prev_sec_find (lang_output_section_statement_type *os)
{
+ asection *s = (asection *) NULL;
lang_output_section_statement_type *lookup;
- for (lookup = os->prev; lookup != NULL; lookup = lookup->prev)
+ for (lookup = &lang_output_section_statement.head->output_section_statement;
+ lookup != NULL;
+ lookup = lookup->next)
{
if (lookup->constraint == -1)
continue;
+ if (lookup == os)
+ return s;
if (lookup->bfd_section != NULL && lookup->bfd_section->owner != NULL)
- return lookup->bfd_section;
+ s = lookup->bfd_section;
}
return NULL;