These changes clean things up a bit, and improve Solaris cross
[deliverable/binutils-gdb.git] / gas / config / tc-a29k.c
index fbdadb5da72dadc73695b7d478f00e4aac428d20..a04cea123925f5e0c80211793a95c54618a1170b 100644 (file)
@@ -22,6 +22,7 @@
    much bloody rewriting required before.  There still probably is.  */
 
 #include "as.h"
+#include "read.h"
 
 #include "opcode/a29k.h"
 
@@ -48,7 +49,10 @@ struct machine_it {
        expressionS exp;
        int pcrel;
        int  reloc_offset;              /* Offset of reloc within insn */
-       enum reloc_type reloc;
+
+       int reloc;
+
+
 } the_insn;
 
 #if __STDC__ == 1
@@ -77,7 +81,10 @@ const pseudo_typeS
            { "reg",    s_lsym,         0 },    /* Register equate, same as equ */
            { "space",  s_ignore,       0 },    /* Listing control */
            { "sect",   s_ignore,       0 },    /* Creation of coff sections */
+#ifndef OBJ_COFF
+ /* We can do this right with coff */
            { "use",    s_use,          0 },
+#endif
            { "word",   cons,           4 },
            { NULL,     0,              0 },
     };
@@ -96,7 +103,7 @@ int md_reloc_size = 12;              /* Not bfdized*/
 
 /* This array holds the chars that always start a comment.  If the
    pre-processor is disabled, these aren't very useful */
-char comment_chars[] = ";";
+const char comment_chars[] = ";";
 
 /* This array holds the chars that only start a comment at the beginning of
    a line.  If the line seems to have the form '# 123 filename'
@@ -105,19 +112,19 @@ char comment_chars[] = ";";
    first line of the input file.  This is because the compiler outputs
    #NO_APP at the beginning of its output. */
 /* Also note that comments like this one will always work */
-char line_comment_chars[] = "#";
+const char line_comment_chars[] = "#";
 
 /* We needed an unused char for line separation to work around the
    lack of macros, using sed and such.  */
-char line_separator_chars[] = "@";
+const char line_separator_chars[] = "@";
 
 /* Chars that can be used to separate mant from exp in floating point nums */
-char EXP_CHARS[] = "eE";
+const char EXP_CHARS[] = "eE";
 
 /* Chars that mean this number is a floating point constant */
 /* As in 0f12.456 */
 /* or    0d1.2345e12 */
-char FLT_CHARS[] = "rRsSfFdDxXpP";
+const char FLT_CHARS[] = "rRsSfFdDxXpP";
 
 /* Also be aware that MAXIMUM_NUMBER_OF_CHARS_FOR_FLOAT may have to be
    changed in read.c .  Ideally it shouldn't have to know about it at all,
@@ -362,34 +369,18 @@ char *
 char *s;
 expressionS *operandp;
 {
-       char *save = input_line_pointer;
-       char *new;
-       segT seg;
-       
-       input_line_pointer = s;
-       seg = expr (0, operandp);
-       new = input_line_pointer;
-       input_line_pointer = save;
+  char *save = input_line_pointer;
+  char *new;
+  segT seg;
        
-       switch (seg) {
-       case SEG_ABSOLUTE:
-       case SEG_TEXT:
-       case SEG_DATA:
-       case SEG_BSS:
-       case SEG_UNKNOWN:
-       case SEG_DIFFERENCE:
-       case SEG_BIG:
-       case SEG_REGISTER:
-               return new;
-               
-       case SEG_ABSENT:
-               as_bad("Missing operand");
-               return new;
-               
-       default:
-               as_bad("Don't understand operand of type %s", segment_name (seg));
-               return new;
-       }
+  input_line_pointer = s;
+  seg = expr (0, operandp);
+  new = input_line_pointer;
+  input_line_pointer = save;
+
+  if (seg == SEG_ABSENT)       
+   as_bad("Missing operand");
+  return new;
 }
 
 /* Instruction parsing.  Takes a string containing the opcode.  
@@ -861,10 +852,6 @@ short tc_coff_fix2rtype(fixP)
 fixS *fixP;
 {
        
-       /* FIXME-NOW: relocation type handling is not yet written for
-          a29k. */
-       
-       
        switch (fixP->fx_r_type) {
        case RELOC_32:  return(R_WORD);
        case RELOC_8:   return(R_BYTE);
@@ -872,7 +859,7 @@ fixS *fixP;
        case RELOC_CONSTH: return (R_IHIHALF);
        case RELOC_JUMPTARG: return (R_IREL);
        default:        printf("need %o3\n", fixP->fx_r_type);
-               abort(0);
+               abort();
        } /* switch on type */
        
        return(0);
This page took 0.02524 seconds and 4 git commands to generate.