* coffcode.h (coff_sym_filepos): Remove GNU960 conditional code.
[deliverable/binutils-gdb.git] / ld / ldexp.c
index 3335e37dc37e3b8fd2223bc07c8970bf4f9228df..ec25557bafb3879da2cc7f4b1f3dee05bc66eefd 100644 (file)
@@ -50,6 +50,9 @@ struct exp_data_seg exp_data_seg;
 
 segment_type *segments;
 
+/* Principally used for diagnostics.  */
+static bfd_boolean assigning_to_dot = FALSE;
+
 /* Print the string representation of the given token.  Surround it
    with spaces if INFIX_P is TRUE.  */
 
@@ -596,7 +599,8 @@ fold_name (etree_type *tree,
                    }
                }
            }
-         else if (allocation_done == lang_final_phase_enum)
+         else if (allocation_done == lang_final_phase_enum
+                  || assigning_to_dot)
            einfo (_("%F%S: undefined symbol `%s' referenced in expression\n"),
                   tree->name.name);
          else if (h->type == bfd_link_hash_new)
@@ -755,10 +759,13 @@ exp_fold_tree (etree_type *tree,
              || (allocation_done == lang_final_phase_enum
                  && current_section == abs_output_section))
            {
+             /* Notify the folder that this is an assignment to dot.  */
+             assigning_to_dot = TRUE;
              result = exp_fold_tree (tree->assign.src,
                                      current_section,
-                                     allocation_done, dot,
-                                     dotp);
+                                     allocation_done, dot, dotp);
+             assigning_to_dot = FALSE;
+
              if (! result.valid_p)
                einfo (_("%F%S invalid assignment to location counter\n"));
              else
@@ -1108,7 +1115,7 @@ exp_get_fill (etree_type *tree,
       fill = xmalloc ((len + 1) / 2 + sizeof (*fill) - 1);
       fill->size = (len + 1) / 2;
       dst = fill->data;
-      s = r.str;
+      s = (unsigned char *) r.str;
       val = 0;
       do
        {
This page took 0.024101 seconds and 4 git commands to generate.