Index: tc-v850.c =================================================================== RCS file: /cvs/src/src/gas/config/tc-v850.c,v retrieving revision 1.8 diff -u -r1.8 tc-v850.c --- tc-v850.c 2000/06/19 00:58:35 1.8 +++ tc-v850.c 2000/08/01 03:07:58 @@ -21,7 +21,7 @@ #include #include #include "as.h" -#include "subsegs.h" +#include "subsegs.h" #include "opcode/v850.h" #define AREA_ZDA 0 @@ -60,15 +60,15 @@ /* Characters which start a comment at the beginning of a line. */ const char line_comment_chars[] = ";#"; -/* Characters which may be used to separate multiple commands on a +/* Characters which may be used to separate multiple commands on a single line. */ const char line_separator_chars[] = ";"; -/* Characters which are used to indicate an exponent in a floating +/* Characters which are used to indicate an exponent in a floating point number. */ const char EXP_CHARS[] = "eE"; -/* Characters which mean that a number is a floating point constant, +/* Characters which mean that a number is a floating point constant, as in 0d1.0. */ const char FLT_CHARS[] = "dD"; @@ -115,7 +115,7 @@ v850_sdata (int ignore ATTRIBUTE_UNUSED) { obj_elf_section_change_hook(); - + subseg_set (sdata_section, (subsegT) get_absolute_expression ()); demand_empty_rest_of_line (); @@ -125,9 +125,9 @@ v850_tdata (int ignore ATTRIBUTE_UNUSED) { obj_elf_section_change_hook(); - + subseg_set (tdata_section, (subsegT) get_absolute_expression ()); - + demand_empty_rest_of_line (); } @@ -135,9 +135,9 @@ v850_zdata (int ignore ATTRIBUTE_UNUSED) { obj_elf_section_change_hook(); - + subseg_set (zdata_section, (subsegT) get_absolute_expression ()); - + demand_empty_rest_of_line (); } @@ -145,9 +145,9 @@ v850_sbss (int ignore ATTRIBUTE_UNUSED) { obj_elf_section_change_hook(); - + subseg_set (sbss_section, (subsegT) get_absolute_expression ()); - + demand_empty_rest_of_line (); } @@ -155,9 +155,9 @@ v850_tbss (int ignore ATTRIBUTE_UNUSED) { obj_elf_section_change_hook(); - + subseg_set (tbss_section, (subsegT) get_absolute_expression ()); - + demand_empty_rest_of_line (); } @@ -165,9 +165,9 @@ v850_zbss (int ignore ATTRIBUTE_UNUSED) { obj_elf_section_change_hook(); - + subseg_set (zbss_section, (subsegT) get_absolute_expression ()); - + demand_empty_rest_of_line (); } @@ -175,9 +175,9 @@ v850_rosdata (int ignore ATTRIBUTE_UNUSED) { obj_elf_section_change_hook(); - + subseg_set (rosdata_section, (subsegT) get_absolute_expression ()); - + demand_empty_rest_of_line (); } @@ -185,9 +185,9 @@ v850_rozdata (int ignore ATTRIBUTE_UNUSED) { obj_elf_section_change_hook(); - + subseg_set (rozdata_section, (subsegT) get_absolute_expression ()); - + demand_empty_rest_of_line (); } @@ -195,9 +195,9 @@ v850_call_table_data (int ignore ATTRIBUTE_UNUSED) { obj_elf_section_change_hook(); - + subseg_set (call_table_data_section, (subsegT) get_absolute_expression ()); - + demand_empty_rest_of_line (); } @@ -205,9 +205,9 @@ v850_call_table_text (int ignore ATTRIBUTE_UNUSED) { obj_elf_section_change_hook(); - + subseg_set (call_table_text_section, (subsegT) get_absolute_expression ()); - + demand_empty_rest_of_line (); } @@ -217,9 +217,9 @@ register int temp = get_absolute_expression (); obj_elf_section_change_hook(); - + subseg_set (bss_section, (subsegT) temp); - + demand_empty_rest_of_line (); } @@ -227,12 +227,12 @@ v850_offset (int ignore ATTRIBUTE_UNUSED) { int temp = get_absolute_expression (); - + temp -= frag_now_fix(); - + if (temp > 0) (void) frag_more (temp); - + demand_empty_rest_of_line (); } @@ -251,22 +251,22 @@ name = input_line_pointer; c = get_symbol_end (); - + /* just after name is now '\0' */ p = input_line_pointer; *p = c; - + SKIP_WHITESPACE (); - + if (*input_line_pointer != ',') { as_bad (_("Expected comma after symbol-name")); ignore_rest_of_line (); return; } - + input_line_pointer ++; /* skip ',' */ - + if ((temp = get_absolute_expression ()) < 0) { /* xgettext:c-format */ @@ -274,19 +274,19 @@ ignore_rest_of_line (); return; } - + size = temp; *p = 0; symbolP = symbol_find_or_make (name); *p = c; - + if (S_IS_DEFINED (symbolP) && ! S_IS_COMMON (symbolP)) { as_bad (_("Ignoring attempt to re-define symbol")); ignore_rest_of_line (); return; } - + if (S_GET_VALUE (symbolP) != 0) { if (S_GET_VALUE (symbolP) != size) @@ -296,9 +296,9 @@ S_GET_NAME (symbolP), (long) S_GET_VALUE (symbolP), size); } } - + know (symbol_get_frag (symbolP) == & zero_address_frag); - + if (*input_line_pointer != ',') have_align = 0; else @@ -307,7 +307,7 @@ input_line_pointer++; SKIP_WHITESPACE (); } - + if (! have_align || *input_line_pointer != '"') { if (! have_align) @@ -315,14 +315,14 @@ else { temp = get_absolute_expression (); - + if (temp < 0) { temp = 0; as_warn (_("Common alignment negative; 0 assumed")); } } - + if (symbol_get_obj (symbolP)->local) { segT old_sec; @@ -333,42 +333,42 @@ old_sec = now_seg; old_subsec = now_subseg; - + applicable = bfd_applicable_section_flags (stdoutput); - + applicable &= SEC_ALLOC; - + switch (area) { case AREA_SDA: if (sbss_section == NULL) { sbss_section = subseg_new (".sbss", 0); - + bfd_set_section_flags (stdoutput, sbss_section, applicable); - + seg_info (sbss_section)->bss = 1; } break; - + case AREA_ZDA: if (zbss_section == NULL) { zbss_section = subseg_new (".zbss", 0); - + bfd_set_section_flags (stdoutput, sbss_section, applicable); - + seg_info (zbss_section)->bss = 1; } break; - + case AREA_TDA: if (tbss_section == NULL) { tbss_section = subseg_new (".tbss", 0); - + bfd_set_section_flags (stdoutput, tbss_section, applicable); - + seg_info (tbss_section)->bss = 1; } break; @@ -379,7 +379,7 @@ /* convert to a power of 2 alignment */ for (align = 0; (temp & 1) == 0; temp >>= 1, ++align) ; - + if (temp != 1) { as_bad (_("Common alignment not a power of 2")); @@ -389,7 +389,7 @@ } else align = 0; - + switch (area) { case AREA_SDA: @@ -413,7 +413,7 @@ default: abort(); } - + if (align) frag_align (align, 0, 0); @@ -437,31 +437,31 @@ default: abort (); } - + symbol_set_frag (symbolP, frag_now); pfrag = frag_var (rs_org, 1, 1, (relax_substateT) 0, symbolP, (offsetT) size, (char *) 0); *pfrag = 0; S_SET_SIZE (symbolP, size); - + switch (area) { case AREA_SDA: S_SET_SEGMENT (symbolP, sbss_section); break; - + case AREA_ZDA: S_SET_SEGMENT (symbolP, zbss_section); break; - + case AREA_TDA: S_SET_SEGMENT (symbolP, tbss_section); break; - + default: abort(); } - + S_CLEAR_EXTERNAL (symbolP); obj_elf_section_change_hook(); subseg_set (old_sec, old_subsec); @@ -472,18 +472,18 @@ S_SET_VALUE (symbolP, (valueT) size); S_SET_ALIGN (symbolP, temp); S_SET_EXTERNAL (symbolP); - + switch (area) { case AREA_SDA: if (scommon_section == NULL) { flagword applicable; - + applicable = bfd_applicable_section_flags (stdoutput); - + scommon_section = subseg_new (".scommon", 0); - + bfd_set_section_flags (stdoutput, scommon_section, (applicable & (SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_DATA @@ -491,16 +491,16 @@ } S_SET_SEGMENT (symbolP, scommon_section); break; - + case AREA_ZDA: if (zcommon_section == NULL) { flagword applicable; - + applicable = bfd_applicable_section_flags (stdoutput); - + zcommon_section = subseg_new (".zcommon", 0); - + bfd_set_section_flags (stdoutput, zcommon_section, (applicable & (SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_DATA @@ -508,16 +508,16 @@ } S_SET_SEGMENT (symbolP, zcommon_section); break; - + case AREA_TDA: if (tcommon_section == NULL) { flagword applicable; - + applicable = bfd_applicable_section_flags (stdoutput); - + tcommon_section = subseg_new (".tcommon", 0); - + bfd_set_section_flags (stdoutput, tcommon_section, (applicable & (SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_DATA @@ -525,7 +525,7 @@ } S_SET_SEGMENT (symbolP, tcommon_section); break; - + default: abort(); } @@ -659,7 +659,7 @@ #define REG_NAME_CNT (sizeof (pre_defined_registers) / sizeof (struct reg_name)) -static const struct reg_name system_registers[] = +static const struct reg_name system_registers[] = { { "ctbp", 20 }, { "ctpc", 16 }, @@ -736,14 +736,14 @@ else if (accept_numbers) { int reg = S_GET_VALUE (symbolP); - + if (reg >= 0 && reg <= 31) return reg; } /* Otherwise drop through and try parsing name normally. */ } - + low = 0; high = regcount - 1; @@ -791,9 +791,9 @@ name, FALSE); * input_line_pointer = c; /* put back the delimiting char */ - + /* look to see if it's in the register table */ - if (reg_number >= 0) + if (reg_number >= 0) { expressionP->X_op = O_register; expressionP->X_add_number = reg_number; @@ -801,14 +801,14 @@ /* make the rest nice */ expressionP->X_add_symbol = NULL; expressionP->X_op_symbol = NULL; - + return true; } else { /* reset the line as if we had not done anything */ input_line_pointer = start; - + return false; } } @@ -818,7 +818,7 @@ * in: Input_line_pointer points to 1st char of operand. * expressionP points to an expression structure to be filled in. * accept_numbers is true iff numerical register names may be used. - * accept_list_names is true iff the special names PS and SR may be + * accept_list_names is true iff the special names PS and SR may be * accepted. * * out: A expressionS structure in expressionP. @@ -846,7 +846,7 @@ accept_numbers); * input_line_pointer = c; /* put back the delimiting char */ - + if (reg_number < 0 && accept_numbers) { @@ -874,9 +874,9 @@ * input_line_pointer = c; /* put back the delimiting char */ } } - + /* look to see if it's in the register table */ - if (reg_number >= 0) + if (reg_number >= 0) { expressionP->X_op = O_register; expressionP->X_add_number = reg_number; @@ -891,7 +891,7 @@ { /* reset the line as if we had not done anything */ input_line_pointer = start; - + return false; } } @@ -922,9 +922,9 @@ reg_number = reg_name_search (cc_names, CC_NAME_CNT, name, FALSE); * input_line_pointer = c; /* put back the delimiting char */ - + /* look to see if it's in the register table */ - if (reg_number >= 0) + if (reg_number >= 0) { expressionP->X_op = O_constant; expressionP->X_add_number = reg_number; @@ -939,7 +939,7 @@ { /* reset the line as if we had not done anything */ input_line_pointer = start; - + return false; } } @@ -976,7 +976,7 @@ * the lowest numbered permissable register in the register list, * and so on upwards. System registers are considered to be very * high numbers. - * + * */ static char * parse_register_list @@ -1008,14 +1008,14 @@ /* If the expression starts with a curly brace it is a register list. Otherwise it is a constant expression, whoes bits indicate which registers are to be included in the list. */ - + if (* input_line_pointer != '{') { int reg; int i; - + expression (& exp); - + if (exp.X_op != O_constant) return _("constant expression or register list expected"); @@ -1023,7 +1023,7 @@ { if (exp.X_add_number & 0xFFFFF000) return _("high bits set in register list expression"); - + for (reg = 20; reg < 32; reg ++) if (exp.X_add_number & (1 << (reg - 20))) { @@ -1036,7 +1036,7 @@ { if (exp.X_add_number & 0xFFFE0000) return _("high bits set in register list expression"); - + for (reg = 1; reg < 16; reg ++) if (exp.X_add_number & (1 << (reg - 1))) { @@ -1047,7 +1047,7 @@ if (exp.X_add_number & (1 << 15)) * insn |= (1 << 3); - + if (exp.X_add_number & (1 << 16)) * insn |= (1 << 19); } @@ -1055,7 +1055,7 @@ { if (exp.X_add_number & 0xFFFE0000) return _("high bits set in register list expression"); - + for (reg = 16; reg < 32; reg ++) if (exp.X_add_number & (1 << (reg - 16))) { @@ -1080,7 +1080,7 @@ if (register_name (& exp)) { int i; - + /* Locate the given register in the list, and if it is there, insert the corresponding bit into the instruction. */ for (i = 0; i < 32; i++) @@ -1145,7 +1145,7 @@ for (j = exp.X_add_number + 1; j <= exp2.X_add_number; j++) { int i; - + /* Locate the given register in the list, and if it is there, insert the corresponding bit into the instruction. */ for (i = 0; i < 32; i++) @@ -1178,7 +1178,7 @@ { {NULL, no_argument, NULL, 0} }; -size_t md_longopts_size = sizeof md_longopts; +size_t md_longopts_size = sizeof md_longopts; void @@ -1241,7 +1241,7 @@ fprintf (stderr, _("unknown command line option: -%c%s\n"), c, arg); return 0; } - + return 1; } @@ -1277,7 +1277,7 @@ *sizep = 0; return _("bad call to md_atof"); } - + t = atof_ieee (input_line_pointer, type, words); if (t) input_line_pointer = t; @@ -1302,7 +1302,7 @@ fragS * fragP; { subseg_change (sec, 0); - + /* In range conditional or unconditional branch. */ if (fragP->fr_subtype == 0 || fragP->fr_subtype == 2) { @@ -1314,7 +1314,7 @@ /* Out of range conditional branch. Emit a branch around a jump. */ else if (fragP->fr_subtype == 1) { - unsigned char *buffer = + unsigned char *buffer = (unsigned char *) (fragP->fr_fix + fragP->fr_literal); /* Reverse the condition of the first branch. */ @@ -1369,7 +1369,7 @@ { if (machine == -1) machine = bfd_mach_v850ea; - + if (processor_mask == -1) processor_mask = PROCESSOR_V850EA; } @@ -1377,7 +1377,7 @@ { if (machine == -1) machine = bfd_mach_v850e; - + if (processor_mask == -1) processor_mask = PROCESSOR_V850E; } @@ -1386,13 +1386,13 @@ { if (machine == -1) machine = 0; - + if (processor_mask == -1) processor_mask = PROCESSOR_V850; } else /* xgettext:c-format */ - as_bad (_("Unable to determine default target processor from string: %s"), + as_bad (_("Unable to determine default target processor from string: %s"), TARGET_CPU); v850_hash = hash_new(); @@ -1405,7 +1405,7 @@ op = v850_opcodes; while (op->name) { - if (strcmp (prev_name, op->name)) + if (strcmp (prev_name, op->name)) { prev_name = (char *) op->name; hash_insert (v850_hash, op->name, (char *) op); @@ -1416,17 +1416,17 @@ bfd_set_arch_mach (stdoutput, TARGET_ARCH, machine); applicable = bfd_applicable_section_flags (stdoutput); - + call_table_data_section = subseg_new (".call_table_data", 0); bfd_set_section_flags (stdoutput, call_table_data_section, applicable & (SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_DATA | SEC_HAS_CONTENTS)); - + call_table_text_section = subseg_new (".call_table_text", 0); bfd_set_section_flags (stdoutput, call_table_text_section, applicable & (SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_CODE)); - + /* Restore text section as the current default. */ subseg_set (text_section, 0); } @@ -1444,7 +1444,7 @@ as_bad (_("ctoff() relocation used on an instruction which does not support it")); return BFD_RELOC_64; /* Used to indicate an error condition. */ } - + return BFD_RELOC_V850_CALLT_6_7_OFFSET; } @@ -1454,14 +1454,14 @@ if (operand == NULL) return BFD_RELOC_V850_SDA_16_16_OFFSET; if (operand->bits == 15 && operand->shift == 17) return BFD_RELOC_V850_SDA_15_16_OFFSET; if (operand->bits == -1) return BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET; - + if ( operand->bits != 16 || operand->shift != 16) { as_bad (_("sdaoff() relocation used on an instruction which does not support it")); return BFD_RELOC_64; /* Used to indicate an error condition. */ } - + return BFD_RELOC_V850_SDA_16_16_OFFSET; } @@ -1478,7 +1478,7 @@ as_bad (_("zdaoff() relocation used on an instruction which does not support it")); return BFD_RELOC_64; /* Used to indicate an error condition. */ } - + return BFD_RELOC_V850_ZDA_16_16_OFFSET; } @@ -1490,13 +1490,13 @@ if (operand->bits == 4 && operand->insert != NULL) return BFD_RELOC_V850_TDA_4_5_OFFSET; /* sld.hu, operand: D5-4 */ if (operand->bits == 4 && operand->insert == NULL) return BFD_RELOC_V850_TDA_4_4_OFFSET; /* sld.bu, operand: D4 */ if (operand->bits == 16 && operand->shift == 16) return BFD_RELOC_V850_TDA_16_16_OFFSET; /* set1 & chums, operands: D16 */ - + if (operand->bits != 7) { as_bad (_("tdaoff() relocation used on an instruction which does not support it")); return BFD_RELOC_64; /* Used to indicate an error condition. */ } - + return operand->insert != NULL ? BFD_RELOC_V850_TDA_7_8_OFFSET /* sld.h/sst.h, operand: D8_7 */ : BFD_RELOC_V850_TDA_7_7_OFFSET; /* sld.b/sst.b, opreand: D7 */ @@ -1525,7 +1525,7 @@ input_line_pointer += strlen (name); \ return reloc; \ } - + CHECK_ ("hi0", BFD_RELOC_HI16); CHECK_ ("hi", BFD_RELOC_HI16_S); CHECK_ ("lo", BFD_RELOC_LO16); @@ -1534,11 +1534,11 @@ CHECK_ ("tdaoff", handle_tdaoff (operand)); CHECK_ ("hilo", BFD_RELOC_32); CHECK_ ("ctoff", handle_ctoff (operand)); - + /* Restore skipped parenthesis. */ if (paren_skipped) -- input_line_pointer; - + return BFD_RELOC_UNUSED; } @@ -1556,7 +1556,7 @@ if (operand->insert) { const char * message = NULL; - + insn = operand->insert (insn, val, & message); if (message != NULL) { @@ -1600,25 +1600,25 @@ max = (1 << operand->bits) - 1; else max = (1 << (operand->bits - 1)) - 1; - + min = - (1 << (operand->bits - 1)); } else { max = (1 << operand->bits) - 1; - + if (! warn_unsigned_overflows) min = - (1 << (operand->bits - 1)); else min = 0; } - + if (val < (offsetT) min || val > (offsetT) max) { /* xgettext:c-format */ const char * err = _("operand out of range (%s not between %ld and %ld)"); char buf[100]; - + /* Restore min and mix to expected values for decimal ranges. */ if ((operand->flags & V850_OPERAND_SIGNED) && ! warn_signed_overflows) @@ -1631,12 +1631,12 @@ if (str) { sprintf (buf, "%s: ", str); - + sprint_value (buf + strlen (buf), val); } else sprint_value (buf, val); - + if (file == (char *) NULL) as_warn (err, buf, min, max); else @@ -1646,7 +1646,7 @@ insn |= (((long) val & ((1 << operand->bits) - 1)) << operand->shift); } - + return insn; } @@ -1654,7 +1654,7 @@ static char copy_of_instruction [128]; void -md_assemble (str) +md_assemble (str) char * str; { char * s; @@ -1674,13 +1674,13 @@ unsigned long extra_data = 0; char * saved_input_line_pointer; - + strncpy (copy_of_instruction, str, sizeof (copy_of_instruction) - 1); - + /* Get the opcode. */ for (s = str; *s != '\0' && ! isspace (*s); s++) continue; - + if (*s != '\0') *s++ = '\0'; @@ -1701,19 +1701,19 @@ start_of_operands = str; saved_input_line_pointer = input_line_pointer; - + for (;;) { const char * errmsg = NULL; match = 0; - + if ((opcode->processors & processor_mask) == 0) { errmsg = _("Target processor does not support this instruction."); goto error; } - + relaxable = 0; fc = 0; next_opindex = 0; @@ -1750,7 +1750,7 @@ /* Gather the operand. */ hold = input_line_pointer; input_line_pointer = str; - + /* lo(), hi(), hi0(), etc... */ if ((reloc = v850_reloc_prefix (operand)) != BFD_RELOC_UNUSED) { @@ -1760,7 +1760,7 @@ match = 1; goto error; } - + expression (& ex); if (ex.X_op == O_constant) @@ -1771,7 +1771,7 @@ /* To cope with "not1 7, zdaoff(0xfffff006)[r0]" and the like. */ /* Fall through. */ - + case BFD_RELOC_LO16: { /* Truncate, then sign extend the value. */ @@ -1796,20 +1796,20 @@ ex.X_add_number = SEXT16 (temp); break; } - + case BFD_RELOC_32: if ((operand->flags & V850E_IMMEDIATE32) == 0) { errmsg = _("immediate operand is too large"); goto error; } - + extra_data_after_insn = true; extra_data_len = 4; extra_data = ex.X_add_number; ex.X_add_number = 0; break; - + default: fprintf (stderr, "reloc: %d\n", reloc); as_bad (_("AAARG -> unhandled constant reloc")); @@ -1818,7 +1818,7 @@ if (fc > MAX_INSN_FIXUPS) as_fatal (_("too many fixups")); - + fixups[ fc ].exp = ex; fixups[ fc ].opindex = * opindex_ptr; fixups[ fc ].reloc = reloc; @@ -1833,12 +1833,12 @@ errmsg = _("immediate operand is too large"); goto error; } - + extra_data_after_insn = true; extra_data_len = 4; extra_data = ex.X_add_number; } - + if (fc > MAX_INSN_FIXUPS) as_fatal (_("too many fixups")); @@ -1851,8 +1851,8 @@ else { errmsg = NULL; - - if ((operand->flags & V850_OPERAND_REG) != 0) + + if ((operand->flags & V850_OPERAND_REG) != 0) { if (!register_name (& ex)) { @@ -1862,14 +1862,14 @@ && ex.X_add_number == 0) { errmsg = _("register r0 cannot be used here"); - + /* Force an error message to be generated by skipping over any following potential matches for this opcode. */ opcode += 3; } } - else if ((operand->flags & V850_OPERAND_SRG) != 0) + else if ((operand->flags & V850_OPERAND_SRG) != 0) { if (!system_register_name (& ex, true, false)) { @@ -1880,7 +1880,7 @@ { char * start = input_line_pointer; char c = get_symbol_end (); - + if (strcmp (start, "ep") != 0 && strcmp (start, "r30") != 0) { /* Put things back the way we found them. */ @@ -1889,32 +1889,32 @@ errmsg = _("expected EP register"); goto error; } - + *input_line_pointer = c; str = input_line_pointer; input_line_pointer = hold; - + while (*str == ' ' || *str == ',' || *str == '[' || *str == ']') ++ str; continue; } - else if ((operand->flags & V850_OPERAND_CC) != 0) + else if ((operand->flags & V850_OPERAND_CC) != 0) { if (!cc_name (& ex)) { errmsg = _("invalid condition code name"); } } - else if (operand->flags & V850E_PUSH_POP) + else if (operand->flags & V850E_PUSH_POP) { errmsg = parse_register_list (& insn, operand); - + /* The parse_register_list() function has already done everything, so fake a dummy expression. */ ex.X_op = O_constant; ex.X_add_number = 0; } - else if (operand->flags & V850E_IMMEDIATE16) + else if (operand->flags & V850E_IMMEDIATE16) { expression (& ex); @@ -1929,19 +1929,19 @@ else errmsg = _("constant too big to fit into instruction"); } - + extra_data_after_insn = true; extra_data_len = 2; extra_data = ex.X_add_number; ex.X_add_number = 0; } - else if (operand->flags & V850E_IMMEDIATE32) + else if (operand->flags & V850E_IMMEDIATE32) { expression (& ex); - + if (ex.X_op != O_constant) errmsg = _("constant expression expected"); - + extra_data_after_insn = true; extra_data_len = 4; extra_data = ex.X_add_number; @@ -1952,7 +1952,7 @@ { char c; int exists = 0; - + /* It is possible that an alias has been defined that matches a register name. For example the code may include a ".set ZERO, 0" directive, which matches @@ -1963,13 +1963,13 @@ input_line_pointer = str; c = get_symbol_end (); - + if (symbol_find (str) != NULL) exists = 1; - + * input_line_pointer = c; input_line_pointer = str; - + expression (& ex); if (ex.X_op != O_constant) @@ -2021,11 +2021,11 @@ if (errmsg) goto error; - + /* fprintf (stderr, " insn: %x, operand %d, op: %d, add_number: %d\n", insn, opindex_ptr - opcode->operands, ex.X_op, ex.X_add_number); */ - switch (ex.X_op) + switch (ex.X_op) { case O_illegal: errmsg = _("illegal operand"); @@ -2085,22 +2085,22 @@ processor. */ if ((opcode->processors & processor_mask) == 0) goto error; - + continue; } - + as_bad ("%s: %s", copy_of_instruction, errmsg); - + if (* input_line_pointer == ']') ++ input_line_pointer; - + ignore_rest_of_line (); input_line_pointer = saved_input_line_pointer; return; } break; } - + while (isspace (*str)) ++str; @@ -2111,7 +2111,7 @@ input_line_pointer = str; /* Write out the instruction. */ - + if (relaxable && fc > 0) { insn_size = 2; @@ -2136,7 +2136,7 @@ md_number_to_chars (f + 2, 0, 4); } } - else + else { /* Four byte insns have an opcode with the two high bits on. */ if ((insn & 0x0600) == 0x0600) @@ -2147,15 +2147,15 @@ /* Special case: 32 bit MOV */ if ((insn & 0xffe0) == 0x0620) insn_size = 2; - + f = frag_more (insn_size); - + md_number_to_chars (f, insn, insn_size); if (extra_data_after_insn) { f = frag_more (extra_data_len); - + md_number_to_chars (f, extra_data, extra_data_len); extra_data_after_insn = false; @@ -2167,16 +2167,16 @@ BFD_RELOC_UNUSED plus the operand index. This lets us easily handle fixups for any operand type, although that is admittedly not a very exciting feature. We pick a BFD reloc type in - md_apply_fix. */ + md_apply_fix. */ for (i = 0; i < fc; i++) { const struct v850_operand * operand; bfd_reloc_code_real_type reloc; - + operand = & v850_operands[ fixups[i].opindex ]; reloc = fixups[i].reloc; - + if (reloc != BFD_RELOC_UNUSED) { reloc_howto_type * reloc_howto = bfd_reloc_type_lookup (stdoutput, @@ -2187,12 +2187,12 @@ if (!reloc_howto) abort(); - + size = bfd_get_reloc_size (reloc_howto); /* XXX This will abort on an R_V850_8 reloc - is this reloc actually used ? */ - if (size != 2 && size != 4) + if (size != 2 && size != 4) abort (); address = (f - frag_now->fr_literal) + insn_size - size; @@ -2201,9 +2201,9 @@ { address += 2; } - + fixP = fix_new_exp (frag_now, address, size, - & fixups[i].exp, + & fixups[i].exp, reloc_howto->pc_relative, reloc); @@ -2237,14 +2237,14 @@ /* If while processing a fixup, a reloc really needs to be created */ /* then it is done here. */ - + arelent * tc_gen_reloc (seg, fixp) asection * seg ATTRIBUTE_UNUSED; fixS * fixp; { arelent * reloc; - + reloc = (arelent *) xmalloc (sizeof (arelent)); reloc->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *)); *reloc->sym_ptr_ptr= symbol_get_bfdsym (fixp->fx_addsy); @@ -2259,16 +2259,16 @@ (int) fixp->fx_r_type); xfree (reloc); - + return NULL; } - + if ( fixp->fx_r_type == BFD_RELOC_VTABLE_ENTRY || fixp->fx_r_type == BFD_RELOC_VTABLE_INHERIT) reloc->addend = fixp->fx_offset; else reloc->addend = fixp->fx_addnumber; - + return reloc; } @@ -2285,7 +2285,7 @@ else abort (); return 2; -} +} long v850_pcrel_from_section (fixp, section) @@ -2300,7 +2300,7 @@ || S_IS_WEAK (fixp->fx_addsy) || (S_GET_SEGMENT (fixp->fx_addsy) != section))) return 0; - + return fixp->fx_frag->fr_address + fixp->fx_where; } @@ -2370,7 +2370,7 @@ return 1; } - /* Determine a BFD reloc value based on the operand information. + /* Determine a BFD reloc value based on the operand information. We are only prepared to turn a few of the operands into relocs. */ if (operand->bits == 22) @@ -2380,7 +2380,7 @@ else { /* fprintf (stderr, "bits: %d, insn: %x\n", operand->bits, insn); */ - + as_bad_where (fixp->fx_file, fixp->fx_line, _("unresolved expression that must be resolved")); fixp->fx_done = 1; @@ -2399,7 +2399,7 @@ else if (fixp->fx_size == 4) bfd_putl32 (value, (unsigned char *) where); } - + fixp->fx_addnumber = value; return 1; } @@ -2450,15 +2450,15 @@ { if (fixP->fx_addsy == NULL) return 1; - + /* Prevent all adjustments to global symbols. */ if (S_IS_EXTERN (fixP->fx_addsy)) return 0; - + /* Similarly for weak symbols. */ if (S_IS_WEAK (fixP->fx_addsy)) return 0; - + /* Don't adjust function names */ if (S_IS_FUNCTION (fixP->fx_addsy)) return 0; @@ -2467,20 +2467,20 @@ if ( fixP->fx_r_type == BFD_RELOC_VTABLE_INHERIT || fixP->fx_r_type == BFD_RELOC_VTABLE_ENTRY) return 0; - + return 1; } - + int v850_force_relocation (fixP) struct fix * fixP; { if (fixP->fx_addsy && S_IS_WEAK (fixP->fx_addsy)) return 1; - + if ( fixP->fx_r_type == BFD_RELOC_VTABLE_INHERIT || fixP->fx_r_type == BFD_RELOC_VTABLE_ENTRY) return 1; - + return 0; }