* amd64fbsd-tdep.c (amd64fbsd_sigtramp_start_addr): Renamed from
[deliverable/binutils-gdb.git] / ld / ldexp.c
index cce0cdfc6deba0fee392d4a5aa80cd0b9ec48261..23a23924fecd6a44bfd8e64470f5e0eabc383d26 100644 (file)
@@ -1,6 +1,6 @@
 /* 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>.
 
@@ -43,6 +43,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 
 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;
 
@@ -392,6 +394,10 @@ fold_binary (etree_type *tree,
                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
@@ -485,10 +491,15 @@ fold_name (etree_type *tree,
       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,
@@ -496,7 +507,9 @@ fold_name (etree_type *tree,
          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;
        }
@@ -738,6 +751,7 @@ exp_fold_tree (etree_type *tree,
                {
                  /* 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;
@@ -1091,7 +1105,8 @@ exp_get_abs_int (etree_type *tree,
   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;
This page took 0.024703 seconds and 4 git commands to generate.