Fix description of EM_S370.
[deliverable/binutils-gdb.git] / gas / symbols.c
index 8e18632d83c7e42063473986e91ed0361f58352a..60decd891510c0fbc02b5ea235d4f4cce1648f0d 100644 (file)
@@ -354,6 +354,7 @@ colon (sym_name)            /* just seen "x:" - rattle symbols & frags */
        */
       if (LOCAL_SYMBOL_CHECK (symbolP))
        {
+#ifdef BFD_ASSEMBLER
          struct local_symbol *locsym = (struct local_symbol *) symbolP;
 
          if (locsym->lsy_section != undefined_section
@@ -368,6 +369,7 @@ colon (sym_name)            /* just seen "x:" - rattle symbols & frags */
          locsym->lsy_section = now_seg;
          local_symbol_set_frag (locsym, frag_now);
          locsym->lsy_offset = frag_now_fix ();
+#endif
        }
       else if (!S_IS_DEFINED (symbolP) || S_IS_COMMON (symbolP))
        {
@@ -615,8 +617,6 @@ symbol_find_base (name, strip_underscore)
      CONST char *name;
      int strip_underscore;
 {
-  struct local_symbol *locsym;
-
   if (strip_underscore && *name == '_')
     name++;
 
@@ -649,9 +649,15 @@ symbol_find_base (name, strip_underscore)
       *copy = '\0';
     }
 
-  locsym = (struct local_symbol *) hash_find (local_hash, name);
-  if (locsym != NULL)
-    return (symbolS *) locsym;
+#ifdef BFD_ASSEMBLER
+  {
+    struct local_symbol *locsym;
+
+    locsym = (struct local_symbol *) hash_find (local_hash, name);
+    if (locsym != NULL)
+      return (symbolS *) locsym;
+  }
+#endif
 
   return ((symbolS *) hash_find (sy_hash, name));
 }
@@ -765,7 +771,7 @@ symbol_insert (addme, target, rootPP, lastPP)
      symbolS *addme;
      symbolS *target;
      symbolS **rootPP;
-     symbolS **lastPP;
+     symbolS **lastPP ATTRIBUTE_UNUSED;
 {
   if (LOCAL_SYMBOL_CHECK (addme))
     abort ();
@@ -844,6 +850,7 @@ resolve_symbol_value (symp, finalize)
   valueT final_val;
   segT final_seg;
 
+#ifdef BFD_ASSEMBLER
   if (LOCAL_SYMBOL_CHECK (symp))
     {
       struct local_symbol *locsym = (struct local_symbol *) symp;
@@ -862,6 +869,7 @@ resolve_symbol_value (symp, finalize)
 
       return final_val;
     }
+#endif
 
   if (symp->sy_resolved)
     {
@@ -1040,8 +1048,11 @@ resolve_symbol_value (symp, finalize)
             expressions, such as IEEE-695.  */
          /* Don't emit messages unless we're finalizing the symbol value,
             otherwise we may get the same message multiple times.  */
-         if ((seg_left != absolute_section || seg_right != absolute_section)
-             && (op != O_subtract || seg_left != seg_right)
+         if ((seg_left != absolute_section
+              || seg_right != absolute_section)
+             && (op != O_subtract
+                 || seg_left != seg_right
+                 || seg_left == undefined_section)
              && finalize)
            {
              char *file;
@@ -1179,7 +1190,7 @@ static void resolve_local_symbol PARAMS ((const char *, PTR));
 
 static void
 resolve_local_symbol (key, value)
-     const char *key;
+     const char *key ATTRIBUTE_UNUSED;
      PTR value;
 {
   if (value != NULL)
@@ -1321,6 +1332,9 @@ dollar_label_name (n, augend)
   know (n >= 0);
   know (augend == 0 || augend == 1);
   p = symbol_name_build;
+#ifdef LOCAL_LABEL_PREFIX
+  *p++ = LOCAL_LABEL_PREFIX;
+#endif
   *p++ = 'L';
 
   /* Next code just does sprintf( {}, "%d", n); */
@@ -1563,8 +1577,10 @@ valueT
 S_GET_VALUE (s)
      symbolS *s;
 {
+#ifdef BFD_ASSEMBLER
   if (LOCAL_SYMBOL_CHECK (s))
     return ((struct local_symbol *) s)->lsy_offset;
+#endif
 
   if (!s->sy_resolved && s->sy_value.X_op != O_constant)
     resolve_symbol_value (s, 1);
@@ -1595,11 +1611,13 @@ S_SET_VALUE (s, val)
      symbolS *s;
      valueT val;
 {
+#ifdef BFD_ASSEMBLER
   if (LOCAL_SYMBOL_CHECK (s))
     {
       ((struct local_symbol *) s)->lsy_offset = val;
       return;
     }
+#endif
 
   s->sy_value.X_op = O_constant;
   s->sy_value.X_add_number = (offsetT) val;
@@ -1611,9 +1629,9 @@ copy_symbol_attributes (dest, src)
      symbolS *dest, *src;
 {
   if (LOCAL_SYMBOL_CHECK (dest))
-    abort ();
+    dest = local_symbol_convert ((struct local_symbol *) dest);
   if (LOCAL_SYMBOL_CHECK (src))
-    abort ();
+    src = local_symbol_convert ((struct local_symbol *) src);
 
 #ifdef BFD_ASSEMBLER
   /* In an expression, transfer the settings of these flags.
@@ -1906,11 +1924,13 @@ symbol_set_frag (s, f)
      symbolS *s;
      fragS *f;
 {
+#ifdef BFD_ASSEMBLER
   if (LOCAL_SYMBOL_CHECK (s))
     {
       local_symbol_set_frag ((struct local_symbol *) s, f);
       return;
     }
+#endif
   s->sy_frag = f;
 }
 
@@ -1920,8 +1940,10 @@ fragS *
 symbol_get_frag (s)
      symbolS *s;
 {
+#ifdef BFD_ASSEMBLER
   if (LOCAL_SYMBOL_CHECK (s))
     return local_symbol_get_frag ((struct local_symbol *) s);
+#endif
   return s->sy_frag;
 }
 
@@ -2063,11 +2085,13 @@ void
 symbol_mark_resolved (s)
      symbolS *s;
 {
+#ifdef BFD_ASSEMBLER
   if (LOCAL_SYMBOL_CHECK (s))
     {
       local_symbol_mark_resolved ((struct local_symbol *) s);
       return;
     }
+#endif
   s->sy_resolved = 1;
 }
 
@@ -2077,8 +2101,10 @@ int
 symbol_resolved_p (s)
      symbolS *s;
 {
+#ifdef BFD_ASSEMBLER
   if (LOCAL_SYMBOL_CHECK (s))
     return local_symbol_resolved_p ((struct local_symbol *) s);
+#endif
   return s->sy_resolved;
 }
 
@@ -2086,7 +2112,7 @@ symbol_resolved_p (s)
 
 int
 symbol_section_p (s)
-     symbolS *s;
+     symbolS *s ATTRIBUTE_UNUSED;
 {
   if (LOCAL_SYMBOL_CHECK (s))
     return 0;
@@ -2257,6 +2283,7 @@ print_symbol_value_1 (file, sym)
 
   if (LOCAL_SYMBOL_CHECK (sym))
     {
+#ifdef BFD_ASSEMBLER
       struct local_symbol *locsym = (struct local_symbol *) sym;
       if (local_symbol_get_frag (locsym) != &zero_address_frag
          && local_symbol_get_frag (locsym) != NULL)
@@ -2264,6 +2291,7 @@ print_symbol_value_1 (file, sym)
       if (local_symbol_resolved_p (locsym))
        fprintf (file, " resolved");
       fprintf (file, " local");
+#endif
     }
   else
     {
@@ -2302,10 +2330,12 @@ print_symbol_value_1 (file, sym)
     {
       indent_level++;
       fprintf (file, "\n%*s<", indent_level * 4, "");
+#ifdef BFD_ASSEMBLER
       if (LOCAL_SYMBOL_CHECK (sym))
        fprintf (file, "constant %lx",
                 (long) ((struct local_symbol *) sym)->lsy_offset);
       else
+#endif
        print_expr_1 (file, &sym->sy_value);
       fprintf (file, ">");
       indent_level--;
This page took 0.028395 seconds and 4 git commands to generate.