{
register symbolS *symbolP; /* symbol we are working with */
-#ifdef LOCAL_LABELS_DOLLAR
/* Sun local labels go out of scope whenever a non-local symbol is
defined. */
-
- if (*sym_name != 'L')
+ if (LOCAL_LABELS_DOLLAR && *sym_name != 'L')
dollar_label_clear ();
-#endif /* LOCAL_LABELS_DOLLAR */
#ifndef WORKING_DOT_WORD
if (new_broken_words)
}
}
-#ifdef LOCAL_LABELS_DOLLAR
-
/* Dollar labels look like a number followed by a dollar sign. Eg, "42$".
They are *really* local. That is, they go out of scope whenever we see a
label that isn't local. Also, like fb labels, there can be multiple
return symbol_name_build;
}
-#endif /* LOCAL_LABELS_DOLLAR */
-
-#ifdef LOCAL_LABELS_FB
-
/*
* Sombody else's idea of local labels. They are made by "n:" where n
* is any decimal digit. Refer to them with
return (symbol_name_build);
} /* fb_label_name() */
-#endif /* LOCAL_LABELS_FB */
-
-
/*
* decode name that may have been generated by foo_label_name() above. If
* the name wasn't generated by foo_label_name(), then return it unaltered.
const char *message_format = "\"%d\" (instance number %d of a %s label)";
if (s[0] != 'L')
- return (s);
+ return s;
for (label_number = 0, p = s + 1; isdigit (*p); ++p)
- {
- label_number = (10 * label_number) + *p - '0';
- }
+ label_number = (10 * label_number) + *p - '0';
if (*p == 1)
- {
- type = "dollar";
- }
+ type = "dollar";
else if (*p == 2)
- {
- type = "fb";
- }
+ type = "fb";
else
- {
- return (s);
- }
+ return s;
- for (instance_number = 0, p = s + 1; isdigit (*p); ++p)
- {
- instance_number = (10 * instance_number) + *p - '0';
- }
+ for (instance_number = 0, p++; isdigit (*p); ++p)
+ instance_number = (10 * instance_number) + *p - '0';
symbol_decode = obstack_alloc (¬es, strlen (message_format) + 30);
- (void) sprintf (symbol_decode, message_format, label_number,
- instance_number, type);
+ sprintf (symbol_decode, message_format, label_number, instance_number, type);
- return (symbol_decode);
-} /* decode_local_label_name() */
+ return symbol_decode;
+}
/* Get the value of a symbol. */
S_SET_EXTERNAL (s)
symbolS *s;
{
+ if ((s->bsym->flags & BSF_WEAK) != 0)
+ as_warn ("%s already declared as weak", S_GET_NAME (s));
s->bsym->flags |= BSF_GLOBAL;
s->bsym->flags &= ~(BSF_LOCAL|BSF_WEAK);
}
S_CLEAR_EXTERNAL (s)
symbolS *s;
{
+ if ((s->bsym->flags & BSF_WEAK) != 0)
+ as_warn ("%s already declared as weak", S_GET_NAME (s));
s->bsym->flags |= BSF_LOCAL;
s->bsym->flags &= ~(BSF_GLOBAL|BSF_WEAK);
}
S_SET_WEAK (s)
symbolS *s;
{
+ if ((s->bsym->flags & BSF_GLOBAL) != 0)
+ as_warn ("%s already declared as global", S_GET_NAME (s));
s->bsym->flags |= BSF_WEAK;
s->bsym->flags &= ~(BSF_GLOBAL|BSF_LOCAL);
}
#endif
abs_symbol.sy_value.X_op = O_constant;
-#ifdef LOCAL_LABELS_FB
- fb_label_init ();
-#endif /* LOCAL_LABELS_FB */
+ if (LOCAL_LABELS_FB)
+ fb_label_init ();
}
\f
int indent_level;
+#if 0
+
static void
indent ()
{
printf ("%*s", indent_level * 4, "");
}
+#endif
+
void print_expr_1 PARAMS ((FILE *, expressionS *));
void print_symbol_value_1 PARAMS ((FILE *, symbolS *));
const char *name = S_GET_NAME (sym);
if (!name || !name[0])
name = "(unnamed)";
- fprintf (file, "sym %lx %s", sym, name);
+ fprintf (file, "sym %lx %s", (unsigned long) sym, name);
if (sym->sy_frag != &zero_address_frag)
fprintf (file, " frag %lx", (long) sym->sy_frag);
if (sym->written)