aboutsummaryrefslogtreecommitdiff
path: root/ld/ldexp.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2010-12-20 06:27:11 +0000
committerAlan Modra <amodra@gmail.com>2010-12-20 06:27:11 +0000
commite759c116027e96bb72562d69ae49a86d6f271a3a (patch)
treee4af0a57dda551e1778c8a5bca14ac742142fdcd /ld/ldexp.c
parent544838827cd5c8da5c67c1617a50ae08ec7661ff (diff)
downloadgdb-e759c116027e96bb72562d69ae49a86d6f271a3a.zip
gdb-e759c116027e96bb72562d69ae49a86d6f271a3a.tar.gz
gdb-e759c116027e96bb72562d69ae49a86d6f271a3a.tar.bz2
PR ld/12001
Revert 2010-11-03 Nick Clifton * ldlang.c (ldlang_def_chain_list): Delete. (insert_defined, ldlang_add_def, lang_place_defineds): Delete. (lang_process): Don't call lang_place_defineds. (lang_add_assignment): Don't do anything special for --defsym. * ldexp.h (struct ldexp_control): Add uses_defined. (exp_fold_tree_no_dot): Declare. * ldexp.c (exp_fold_tree): Clear uses_defined. (exp_fold_tree_no_dot): Likewise. Make global. (fold_name <DEFINED>): Set uses_defined. (exp_fold_tree_1 <etree_assign>): Define symbol during first phase even when the value being assigned isn't valid. * ldlang.c (open_input_bfds): Process assignment statements. (lang_process): Bump lang_statement_iteration. (scan_for_self_assignment): Formatting. (print_assignment): Style. testsuite/ * ld-scripts/default-script2.d: Revert 2010-11-03 change.
Diffstat (limited to 'ld/ldexp.c')
-rw-r--r--ld/ldexp.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/ld/ldexp.c b/ld/ldexp.c
index de7f9f2..71b957c 100644
--- a/ld/ldexp.c
+++ b/ld/ldexp.c
@@ -44,7 +44,6 @@
#include "safe-ctype.h"
static void exp_fold_tree_1 (etree_type *);
-static void exp_fold_tree_no_dot (etree_type *);
static bfd_vma align_n (bfd_vma, bfd_vma);
segment_type *segments;
@@ -504,6 +503,7 @@ fold_name (etree_type *tree)
break;
case DEFINED:
+ expld.uses_defined = TRUE;
if (expld.phase == lang_first_phase_enum)
lang_track_definedness (tree->name.name);
else
@@ -802,7 +802,9 @@ exp_fold_tree_1 (etree_type *tree)
}
exp_fold_tree_1 (tree->assign.src);
- if (expld.result.valid_p)
+ if (expld.result.valid_p
+ || (expld.phase == lang_first_phase_enum
+ && !expld.uses_defined))
{
if (h == NULL)
{
@@ -872,15 +874,17 @@ exp_fold_tree (etree_type *tree, asection *current_section, bfd_vma *dotp)
expld.dot = *dotp;
expld.dotp = dotp;
expld.section = current_section;
+ expld.uses_defined = FALSE;
exp_fold_tree_1 (tree);
}
-static void
+void
exp_fold_tree_no_dot (etree_type *tree)
{
expld.dot = 0;
expld.dotp = NULL;
expld.section = bfd_abs_section_ptr;
+ expld.uses_defined = FALSE;
exp_fold_tree_1 (tree);
}