X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gas%2Fconfig%2Ftc-i860.c;h=858d81e9983e8cdddb8c93cbb53a1b5518d55100;hb=4512dafa508c4b148996f2d67222a82dd018cdd3;hp=c5aca38e4502265c6c16acd7045769aa7ddcb01f;hpb=ebd1c8757cf3f32daffe2615cbb778e495ebe412;p=deliverable%2Fbinutils-gdb.git diff --git a/gas/config/tc-i860.c b/gas/config/tc-i860.c index c5aca38e45..858d81e998 100644 --- a/gas/config/tc-i860.c +++ b/gas/config/tc-i860.c @@ -1,6 +1,5 @@ /* tc-i860.c -- Assembler for the Intel i860 architecture. - Copyright 1989, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2001, 2002, - 2003, 2006 Free Software Foundation, Inc. + Copyright (C) 1989-2016 Free Software Foundation, Inc. Brought back from the dead and completely reworked by Jason Eckhardt . @@ -9,7 +8,7 @@ GAS is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. GAS is distributed in the hope that it will be useful, @@ -54,7 +53,7 @@ static char reg_prefix; struct i860_it { - char *error; + const char *error; unsigned long opcode; enum expand_type expand; struct i860_fi @@ -91,7 +90,7 @@ static void s_enddual (int); static void s_atmp (int); static void s_align_wrapper (int); static int i860_get_expression (char *); -static bfd_reloc_code_real_type obtain_reloc_for_imm16 (fixS *, long *); +static bfd_reloc_code_real_type obtain_reloc_for_imm16 (fixS *, long *); #ifdef DEBUG_I860 static void print_insn (struct i860_it *); #endif @@ -174,7 +173,7 @@ s_atmp (int ignore ATTRIBUTE_UNUSED) } /* Handle ".align" directive depending on syntax mode. - AT&T/SVR4 syntax uses the standard align directive. However, + AT&T/SVR4 syntax uses the standard align directive. However, the Intel syntax additionally allows keywords for the alignment parameter: ".align type", where type is one of {.short, .long, .quad, .single, .double} representing alignments of 2, 4, @@ -198,7 +197,7 @@ s_align_wrapper (int arg) strncpy (parm, " 4", 7); else if (strncmp (parm, ".double", 7) == 0) strncpy (parm, " 8", 7); - + while (*input_line_pointer == ' ') ++input_line_pointer; } @@ -221,7 +220,7 @@ md_begin (void) while (i860_opcodes[i].name != NULL) { const char *name = i860_opcodes[i].name; - retval = hash_insert (op_hash, name, (PTR)&i860_opcodes[i]); + retval = hash_insert (op_hash, name, (void *) &i860_opcodes[i]); if (retval != NULL) { fprintf (stderr, _("internal error: can't hash `%s': %s\n"), @@ -261,7 +260,7 @@ md_assemble (char *str) int i; struct i860_it pseudo[3]; - assert (str); + gas_assert (str); fc = 0; /* Assemble the instruction. */ @@ -408,6 +407,7 @@ md_assemble (char *str) as_warn (_("An instruction was expanded (%s)"), str); } + dwarf2_emit_insn (0); i = 0; do { @@ -895,7 +895,7 @@ i860_process_insn (char *str) the_insn.expand = insn->expand; fc++; - + continue; } else @@ -1010,62 +1010,10 @@ i860_get_expression (char *str) return 0; } -/* Turn a string in input_line_pointer into a floating point constant of - type TYPE, and store the appropriate bytes in *LITP. The number of - LITTLENUMS emitted is stored in *SIZEP. An error message is returned, - or NULL on OK. */ - -/* Equal to MAX_PRECISION in atof-ieee.c. */ -#define MAX_LITTLENUMS 6 - -char * +const char * md_atof (int type, char *litP, int *sizeP) { - int prec; - LITTLENUM_TYPE words[MAX_LITTLENUMS]; - LITTLENUM_TYPE *wordP; - char *t; - - switch (type) - { - case 'f': - case 'F': - case 's': - case 'S': - prec = 2; - break; - - case 'd': - case 'D': - case 'r': - case 'R': - prec = 4; - break; - - case 'x': - case 'X': - prec = 6; - break; - - case 'p': - case 'P': - prec = 6; - break; - - default: - *sizeP = 0; - return _("Bad call to MD_ATOF()"); - } - t = atof_ieee (input_line_pointer, type, words); - if (t) - input_line_pointer = t; - *sizeP = prec * sizeof (LITTLENUM_TYPE); - for (wordP = words; prec--;) - { - md_number_to_chars (litP, (long) (*wordP++), sizeof (LITTLENUM_TYPE)); - litP += sizeof (LITTLENUM_TYPE); - } - return 0; + return ieee_md_atof (type, litP, sizeP, TRUE); } /* Write out in current endian mode. */ @@ -1080,10 +1028,10 @@ md_number_to_chars (char *buf, valueT val, int n) /* This should never be called for i860. */ int -md_estimate_size_before_relax (register fragS *fragP ATTRIBUTE_UNUSED, +md_estimate_size_before_relax (fragS *fragP ATTRIBUTE_UNUSED, segT segtype ATTRIBUTE_UNUSED) { - as_fatal (_("i860_estimate_size_before_relax\n")); + as_fatal (_("relaxation not supported\n")); } #ifdef DEBUG_I860 @@ -1136,7 +1084,7 @@ struct option md_longopts[] = { size_t md_longopts_size = sizeof (md_longopts); int -md_parse_option (int c, char *arg ATTRIBUTE_UNUSED) +md_parse_option (int c, const char *arg ATTRIBUTE_UNUSED) { switch (c) { @@ -1478,8 +1426,8 @@ tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, { arelent *reloc; - reloc = xmalloc (sizeof (*reloc)); - reloc->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *)); + reloc = XNEW (arelent); + reloc->sym_ptr_ptr = XNEW (asymbol *); *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy); reloc->address = fixp->fx_frag->fr_address + fixp->fx_where; reloc->addend = fixp->fx_offset; @@ -1534,11 +1482,10 @@ void i860_check_label (symbolS *labelsym) { /* At this point, the current line pointer is sitting on the character - just after the first colon on the label. */ + just after the first colon on the label. */ if (target_intel_syntax && *input_line_pointer == ':') { S_SET_EXTERNAL (labelsym); input_line_pointer++; } } -