/* This module handles expression trees.
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003
+ 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
Written by Steve Chamberlain of Cygnus Support <sac@cygnus.com>.
static etree_value_type exp_fold_tree_no_dot
(etree_type *, lang_output_section_statement_type *, lang_phase_type);
+static bfd_vma align_n
+ (bfd_vma, bfd_vma);
struct exp_data_seg exp_data_seg;
result = other;
break;
+ case ALIGN_K:
+ result.value = align_n (result.value, other.value);
+ break;
+
case DATA_SEGMENT_ALIGN:
if (allocation_done != lang_first_phase_enum
&& current_section == abs_output_section
break;
case DEFINED:
if (allocation_done == lang_first_phase_enum)
- result.valid_p = FALSE;
+ {
+ lang_track_definedness (tree->name.name);
+ result.valid_p = FALSE;
+ }
else
{
struct bfd_link_hash_entry *h;
+ int def_iteration
+ = lang_symbol_definition_iteration (tree->name.name);
h = bfd_wrapped_link_hash_lookup (output_bfd, &link_info,
tree->name.name,
result.value = (h != NULL
&& (h->type == bfd_link_hash_defined
|| h->type == bfd_link_hash_defweak
- || h->type == bfd_link_hash_common));
+ || h->type == bfd_link_hash_common)
+ && (def_iteration == lang_statement_iteration
+ || def_iteration == -1));
result.section = abs_output_section;
result.valid_p = TRUE;
}
{
/* FIXME: Should we worry if the symbol is already
defined? */
+ lang_update_definedness (tree->assign.dst, h);
h->type = bfd_link_hash_defined;
h->u.def.value = result.value;
h->u.def.section = result.section->bfd_section;
return res.value;
}
-bfd_vma align_n (bfd_vma value, bfd_vma align)
+static bfd_vma
+align_n (bfd_vma value, bfd_vma align)
{
if (align <= 1)
return value;