2001-02-13 H.J. Lu <hjl@gnu.org>
authorH.J. Lu <hjl.tools@gmail.com>
Tue, 13 Feb 2001 22:23:33 +0000 (22:23 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Tue, 13 Feb 2001 22:23:33 +0000 (22:23 +0000)
* ldexp.h (node_type): Add etree_provided.
* ldexp.c (exp_fold_tree): Handle etree_provided. Set the node
type to etree_provided if defined by PROVIDE. Allow updating
for etree_provided.
(exp_print_tree): Handle etree_provided.
* mpw-elfmips.c (gldelf32ebmip_find_exp_assignment): Handle
etree_provided.

ld/ChangeLog
ld/ldexp.c
ld/ldexp.h
ld/mpw-elfmips.c

index 9b95eb53c4dcb42836826fc070598178323c6276..f592287e5e359cd7a5b88c3ba44f5d82c00d6769 100644 (file)
@@ -1,3 +1,13 @@
+2001-02-13  H.J. Lu  <hjl@gnu.org>
+
+       * ldexp.h (node_type): Add etree_provided.
+       * ldexp.c (exp_fold_tree): Handle etree_provided. Set the node
+       type to etree_provided if defined by PROVIDE. Allow updating
+       for etree_provided. 
+       (exp_print_tree): Handle etree_provided.
+       * mpw-elfmips.c (gldelf32ebmip_find_exp_assignment): Handle
+       etree_provided.
+
 2001-02-09  David Mosberger  <davidm@hpl.hp.com>
 
        * emulparams/elf64_ia64.sh (OTHER_READONLY_SECTIONS): Add
index cc3427434ce1fe4aa770b424f04e4a3c052fc4b9..2b757fec90c8643e0dc8fa970c1e1fec688c2e05 100644 (file)
@@ -593,10 +593,11 @@ exp_fold_tree (tree, current_section, allocation_done, dot, dotp)
 
     case etree_assign:
     case etree_provide:
+    case etree_provided:
       if (tree->assign.dst[0] == '.' && tree->assign.dst[1] == 0)
        {
          /* Assignment to dot can only be done during allocation */
-         if (tree->type.node_class == etree_provide)
+         if (tree->type.node_class != etree_assign)
            einfo (_("%F%S can not PROVIDE assignment to location counter\n"));
          if (allocation_done == lang_allocating_phase_enum
              || (allocation_done == lang_final_phase_enum
@@ -666,6 +667,8 @@ exp_fold_tree (tree, current_section, allocation_done, dot, dotp)
                  h->type = bfd_link_hash_defined;
                  h->u.def.value = result.value;
                  h->u.def.section = result.section->bfd_section;
+                 if (tree->type.node_class == etree_provide)
+                   tree->type.node_class = etree_provided;
                }
            }
        }
@@ -880,6 +883,7 @@ exp_print_tree (tree)
       exp_print_tree (tree->assign.src);
       break;
     case etree_provide:
+    case etree_provided:
       fprintf (config.map_file, "PROVIDE (%s, ", tree->assign.dst);
       exp_print_tree (tree->assign.src);
       fprintf (config.map_file, ")");
index 4c507bd4c3ace8630bb6969b765611915e1bb054..5175235d2ba13bd1f78c3c067eef009b388827ca 100644 (file)
@@ -37,6 +37,7 @@ typedef struct {
           etree_name,
           etree_assign,
           etree_provide,
+          etree_provided,
           etree_undef,
           etree_unspec,
           etree_value,
index 3143b2ec1482a0645a335a4d2234bb6ceda7d235..feeb5c6e5a3e351a09cd8191f59745ffa9ae5614 100644 (file)
@@ -522,6 +522,7 @@ gldelf32ebmip_find_exp_assignment (exp)
   switch (exp->type.node_class)
     {
     case etree_provide:
+    case etree_provided:
       h = bfd_link_hash_lookup (link_info.hash, exp->assign.dst,
                                false, false, false);
       if (h == NULL)
@@ -541,7 +542,7 @@ gldelf32ebmip_find_exp_assignment (exp)
        {
          if (! (bfd_elf32_record_link_assignment
                 (output_bfd, &link_info, exp->assign.dst,
-                 exp->type.node_class == etree_provide ? true : false)))
+                 exp->type.node_class != etree_assign ? true : false)))
            einfo (_("%P%F: failed to record assignment to %s: %E\n"),
                   exp->assign.dst);
        }