+2001-01-10 Nick Clifton <nickc@redhat.com>
+
+ * symbols.c (DOLLAR_LABEL_CHAR): New constant - the magic
+ character used to dollar local symbols.
+ (LOCAL_LABEL_CHAR): New constant - the magic character used to
+ local label symbols.
+ (dollar_label_name): Use DOLLAR_LABEL_CHAR.
+ (fb_label_name): Prefix local labels with LOCAL_LABEL_PREFIX,
+ if defined.
+ Use LOCAL_LABEL_CHAR.
+ (decode_local_label_name): Skip LOCAL_LABEL_PREFIX.
+ Use DOLLAR_LABEL_CHAR and LOCAL_LABEL_CHAR.
+ (S_IS_LOCAL): Use DOLLAR_LABEL_CHAR and LOCAL_LABEL_CHAR.
+
2001-01-08 Bo Thorsen <bo@suse.de>
* config/tc-i386.c (i386_immediate, i386_displacement):
#define debug_verify_symchain(root, last) ((void) 0)
#endif
+#define DOLLAR_LABEL_CHAR '\001'
+#define LOCAL_LABEL_CHAR '\002'
+
struct obstack notes;
static void fb_label_init PARAMS ((void));
while ((*p = *--q) != '\0')
++p;
- *p++ = 1; /* ^A */
+ *p++ = DOLLAR_LABEL_CHAR; /* ^A */
/* Instance number. */
q = symbol_name_temporary;
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); */
while ((*p = *--q) != '\0')
++p;
- *p++ = 2; /* ^B */
+ *p++ = LOCAL_LABEL_CHAR; /* ^B */
/* Instance number. */
q = symbol_name_temporary;
int instance_number;
char *type;
const char *message_format = _("\"%d\" (instance number %d of a %s label)");
-
- if (s[0] != 'L')
+ int index = 0;
+
+#ifdef LOCAL_LABEL_PREFIX
+ if (s[index] == LOCAL_LABEL_PREFIX)
+ ++index;
+#endif
+
+ if (s[index] != 'L')
return s;
- for (label_number = 0, p = s + 1; isdigit ((unsigned char) *p); ++p)
+ for (label_number = 0, p = s + index + 1; isdigit ((unsigned char) *p); ++p)
label_number = (10 * label_number) + *p - '0';
- if (*p == 1)
+ if (*p == DOLLAR_LABEL_CHAR)
type = "dollar";
- else if (*p == 2)
+ else if (*p == LOCAL_LABEL_CHAR)
type = "fb";
else
return s;
name = S_GET_NAME (s);
return (name != NULL
&& ! S_IS_DEBUG (s)
- && (strchr (name, '\001')
- || strchr (name, '\002')
+ && (strchr (name, DOLLAR_LABEL_CHAR)
+ || strchr (name, LOCAL_LABEL_CHAR)
|| (! flag_keep_locals
&& (bfd_is_local_label (stdoutput, s->bsym)
|| (flag_mri