X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=gas%2Fconfig%2Ftc-m32r.c;h=7a810d44384f61537e520059f94d8d66cb6982bf;hb=1cd8ff388206c878587561b6339d147fda189aa7;hp=d31dd8d59f77d3461f5e8f60dbfd12449e63170e;hpb=0a9ef439079f50221dad9eb5248387236d370c87;p=binutils-gdb.git diff --git a/gas/config/tc-m32r.c b/gas/config/tc-m32r.c index d31dd8d59f7..7a810d44384 100644 --- a/gas/config/tc-m32r.c +++ b/gas/config/tc-m32r.c @@ -1,5 +1,5 @@ /* tc-m32r.c -- Assembler for the Mitsubishi M32R. - Copyright (C) 1996, 1997, 1998, 1999, 2000 + Copyright 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -20,8 +20,8 @@ Boston, MA 02111-1307, USA. */ #include -#include #include "as.h" +#include "safe-ctype.h" #include "subsegs.h" #include "symcat.h" #include "opcodes/m32r-desc.h" @@ -332,6 +332,7 @@ const pseudo_typeS md_pseudo_table[] = void m32r_handle_align (fragp) + fragS *fragp; { static const unsigned char nop_pattern[] = { 0xf0, 0x00 }; static const unsigned char multi_nop_pattern[] = { 0x70, 0x00, 0xf0, 0x00 }; @@ -443,7 +444,7 @@ expand_debug_syms (syms, align) if (!syms) return; - (void) m32r_do_align (align, NULL, 0, 0); + (void) frag_align_code (align, 0); for (; syms != (sym_linkS *) 0; syms = next_syms) { symbolS *symbolP = syms->symbol; @@ -553,6 +554,8 @@ md_begin () scom_symbol.section = &scom_section; allow_m32rx (enable_m32rx); + + gas_cgen_initialize_saved_fixups_array (); } #define OPERAND_IS_COND_BIT(operand, indices, index) \ @@ -816,22 +819,21 @@ assemble_two_insns (str, str2, parallel_p) { char *s2 = str; - while (isspace (*s2++)) + while (ISSPACE (*s2++)) continue; --s2; - while (isalnum (*s2)) + while (ISALNUM (*s2)) { - if (isupper ((unsigned char) *s2)) - *s2 = tolower (*s2); + *s2 = TOLOWER (*s2); s2++; } } /* Preserve any fixups that have been generated and reset the list to empty. */ - gas_cgen_save_fixups (); + gas_cgen_save_fixups (0); /* Get the indices of the operands of the instruction. */ /* FIXME: CGEN_FIELDS is already recorded, but relying on that fact @@ -940,7 +942,7 @@ assemble_two_insns (str, str2, parallel_p) || (errmsg = (char *) can_make_parallel (&first, &second)) == NULL) { /* Get the fixups for the first instruction. */ - gas_cgen_swap_fixups (); + gas_cgen_swap_fixups (0); /* Write it out. */ expand_debug_syms (first.debug_sym_link, 1); @@ -952,7 +954,7 @@ assemble_two_insns (str, str2, parallel_p) make_parallel (second.buffer); /* Get its fixups. */ - gas_cgen_restore_fixups (); + gas_cgen_restore_fixups (0); /* Write it out. */ expand_debug_syms (second.debug_sym_link, 1); @@ -971,7 +973,7 @@ assemble_two_insns (str, str2, parallel_p) make_parallel (first.buffer); /* Get the fixups for the first instruction. */ - gas_cgen_restore_fixups (); + gas_cgen_restore_fixups (0); /* Write out the first instruction. */ expand_debug_syms (first.debug_sym_link, 1); @@ -1383,7 +1385,8 @@ const relax_typeS md_relax_table[] = }; long -m32r_relax_frag (fragP, stretch) +m32r_relax_frag (segment, fragP, stretch) + segT segment; fragS *fragP; long stretch; { @@ -1410,7 +1413,7 @@ m32r_relax_frag (fragP, stretch) } else { - growth = relax_frag (fragP, stretch); + growth = relax_frag (segment, fragP, stretch); /* Long jump on odd halfword boundary? */ if (fragP->fr_subtype == 2 && (address & 3) != 0) @@ -1439,8 +1442,6 @@ md_estimate_size_before_relax (fragP, segment) fragS *fragP; segT segment; { - int old_fr_fix = fragP->fr_fix; - /* The only thing we have to handle here are symbols outside of the current segment. They may be undefined or in a different segment in which case linker scripts may place them anywhere. @@ -1449,6 +1450,8 @@ md_estimate_size_before_relax (fragP, segment) if (S_GET_SEGMENT (fragP->fr_symbol) != segment) { + int old_fr_fix = fragP->fr_fix; + /* The symbol is undefined in this segment. Change the relaxation subtype to the max allowable and leave all further handling to md_convert_frag. */ @@ -1472,6 +1475,7 @@ md_estimate_size_before_relax (fragP, segment) /* Mark this fragment as finished. */ frag_wane (fragP); + return fragP->fr_fix - old_fr_fix; #else { const CGEN_INSN *insn; @@ -1498,7 +1502,7 @@ md_estimate_size_before_relax (fragP, segment) #endif } - return (fragP->fr_var + fragP->fr_fix - old_fr_fix); + return md_relax_table[fragP->fr_subtype].rlx_length; } /* *FRAGP has been relaxed to its final size, and now needs to have @@ -1559,7 +1563,6 @@ md_convert_frag (abfd, sec, fragP) { /* Address we want to reach in file space. */ target_address = S_GET_VALUE (fragP->fr_symbol) + fragP->fr_offset; - target_address += symbol_get_frag (fragP->fr_symbol)->fr_address; addend = (target_address - (opcode_address & -4)) >> 2; } @@ -1707,7 +1710,7 @@ m32r_cgen_record_fixup_exp (frag, where, insn, length, operand, opinfo, exp) #define FX_OPINFO_R_TYPE(f) ((f)->fx_cgen.opinfo) /* Sort any unmatched HI16 relocs so that they immediately precede - the corresponding LO16 reloc. This is called before md_apply_fix and + the corresponding LO16 reloc. This is called before md_apply_fix3 and tc_gen_reloc. */ void