adjust STRIP_UNDERSCORE
authorK. Richard Pixley <rich@cygnus>
Wed, 6 Nov 1991 02:27:02 +0000 (02:27 +0000)
committerK. Richard Pixley <rich@cygnus>
Wed, 6 Nov 1991 02:27:02 +0000 (02:27 +0000)
gas/config/obj-bout.h
gas/symbols.c

index 02eba6e..272c0c4 100644 (file)
@@ -169,12 +169,6 @@ struct relocation_info {
 };
 #endif /* CUSTOM_RELOC_FORMAT */
 
-/* If compiler generate leading underscores, remove them. */
-
-#ifndef STRIP_UNDERSCORE
-#define STRIP_UNDERSCORE 0
-#endif /* STRIP_UNDERSCORE */
-
 /*
  *  Macros to extract information from a symbol table entry.
  *  This syntaxic indirection allows independence regarding a.out or coff.
index b2c0d8d..f4b7b1d 100644 (file)
@@ -133,32 +133,6 @@ local_label_name(n, augend)
   return(symbol_name_build);
 } /* local_label_name() */
 
-/*
- * decode name that may have been generated by local_label_name() above.  If
- * the name wasn't generated by local_label_name(), then return it unaltered.
- * This is used for error messages.
- */
-
-char *decode_local_label_name(s)
-char *s;
-{
-       char *symbol_decode;
-       int label_number;
-/*     int label_version; */
-       char *message_format = "\"%d\" (instance number %s of a local label)";
-
-       if (s[0] != 'L'
-           || s[2] != 1) {
-               return(s);
-       } /* not a local_label_name() generated name. */
-
-       label_number = s[1] - '0';
-
-       (void) sprintf(symbol_decode = obstack_alloc(&notes, strlen(s + 3) + strlen(message_format) + 10),
-               message_format, label_number, s + 3);
-
-       return(symbol_decode);
-} /* decode_local_label_name() */
 
 void local_colon (n)
 int n; /* just saw "n:" */
@@ -196,7 +170,6 @@ fragS *frag;                        /* Associated fragment */
        unsigned int name_length;
        char *preserved_copy_of_name;
        symbolS *symbolP;
-       extern int memset();
        
        name_length = strlen(name) + 1; /* +1 for \0 */
        obstack_grow(&notes, name, name_length);
@@ -206,7 +179,7 @@ fragS *frag;                        /* Associated fragment */
  /* symbol must be born in some fixed state.  This seems as good as any. */
        memset(symbolP, 0, sizeof(symbolS));
 
-#if STRIP_UNDERSCORE
+#ifdef STRIP_UNDERSCORE
        S_SET_NAME(symbolP, (*preserved_copy_of_name == '_'
                                            ? preserved_copy_of_name + 1
                                            : preserved_copy_of_name));
@@ -267,10 +240,11 @@ void colon(sym_name)              /* just seen "x:" - rattle symbols & frags */
     int possible_bytes;
     fragS *frag_tmp;
     char *frag_opcode;
+
     extern md_short_jump_size;
     extern md_long_jump_size;
-
     possible_bytes=md_short_jump_size + new_broken_words * md_long_jump_size;
+
     frag_tmp=frag_now;
     frag_opcode=frag_var(rs_broken_word,
                         possible_bytes,
@@ -341,6 +315,10 @@ void colon(sym_name)               /* just seen "x:" - rattle symbols & frags */
                           * on the sparc also depends on it.
                           */
 /*                       char New_Type = SEGMENT_TO_SYMBOL_TYPE((int) now_seg); */
+#ifdef MANY_SEGMENTS
+#define SEG_BSS SEG_E2
+#define SEG_DATA SEG_E1
+#endif
                          
                          if (((!S_IS_DEBUG(symbolP) && !S_IS_DEFINED(symbolP) && S_IS_EXTERNAL(symbolP))
                               || (S_GET_SEGMENT(symbolP) == SEG_BSS))
@@ -482,11 +460,12 @@ char *name;
 symbolS *symbol_find(name)
 char *name;
 {
-#ifndef STRIP_UNDERSCORE
-#define STRIP_UNDERSCORE 0
+#ifdef STRIP_UNDERSCORE
+       return(symbol_find_base(name, 1));
+#else /* STRIP_UNDERSCORE */
+       return(symbol_find_base(name, ));
 #endif /* STRIP_UNDERSCORE */
-    return symbol_find_base(name, STRIP_UNDERSCORE);
-}
+} /* symbol_find() */
 
 symbolS *symbol_find_base(name, strip_underscore)
 char *name;
@@ -636,6 +615,34 @@ symbolS *lastP;
 
 
 /*
+ * decode name that may have been generated by local_label_name() above.  If
+ * the name wasn't generated by local_label_name(), then return it unaltered.
+ * This is used for error messages.
+ */
+char *decode_local_label_name(s)
+char *s;
+{
+       char *symbol_decode;
+       int label_number;
+ /*    int label_version; */
+       char *message_format = "\"%d\" (instance number %s of a local label)";
+       if (s[0] != 'L'
+           || s[2] != 1) {
+               return(s);
+       } /* not a local_label_name() generated name. */
+       label_number = s[1] - '0';
+       (void) sprintf(symbol_decode = obstack_alloc(&notes, strlen(s + 3) + strlen(message_format) + 10),
+               message_format, label_number, s + 3);
+
+       return(symbol_decode);
+} /* decode_local_label_name() */
+
+
+/*
  * Local Variables:
  * comment-column: 0
  * fill-column: 131