summaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorH.J. Lu <hjl@lucon.org>2005-12-19 15:06:40 +0000
committerH.J. Lu <hjl@lucon.org>2005-12-19 15:06:40 +0000
commit67c0d946e5669a08730132782811f2ce9410b348 (patch)
tree2daeac31663a8542ade2669075c614b4fc18ee1d /ld
parent463addb254c8f30a42a198204d3990c33fa0d4a1 (diff)
downloadbinutils-redhat-67c0d946e5669a08730132782811f2ce9410b348.tar.gz
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')
-rw-r--r--ld/ChangeLog8
-rw-r--r--ld/ldlang.c11
-rw-r--r--ld/ldlang.h1
3 files changed, 15 insertions, 5 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index bd68c9d70a..52fd1d5e06 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,11 @@
+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.
+
2005-12-16 Nathan Sidwell <nathan@codesourcery.com>
Second part of ms1 to mt renaming.
diff --git a/ld/ldlang.c b/ld/ldlang.c
index 0e72ab851e..8ef48d13b9 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;
diff --git a/ld/ldlang.h b/ld/ldlang.h
index cf5b01ff3d..381bb0484c 100644
--- a/ld/ldlang.h
+++ b/ld/ldlang.h
@@ -130,7 +130,6 @@ typedef struct lang_output_section_statement_struct
lang_statement_header_type header;
lang_statement_list_type children;
struct lang_output_section_statement_struct *next;
- struct lang_output_section_statement_struct *prev;
const char *name;
asection *bfd_section;
lang_memory_region_type *region;