diff options
Diffstat (limited to 'gas/config')
-rw-r--r-- | gas/config/tc-arc.c | 7 | ||||
-rw-r--r-- | gas/config/tc-avr.c | 6 | ||||
-rw-r--r-- | gas/config/tc-cr16.c | 12 | ||||
-rw-r--r-- | gas/config/tc-cris.c | 3 | ||||
-rw-r--r-- | gas/config/tc-crx.c | 12 | ||||
-rw-r--r-- | gas/config/tc-d10v.c | 2 | ||||
-rw-r--r-- | gas/config/tc-d30v.c | 2 | ||||
-rw-r--r-- | gas/config/tc-ft32.c | 5 | ||||
-rw-r--r-- | gas/config/tc-h8300.c | 3 | ||||
-rw-r--r-- | gas/config/tc-m68hc11.c | 2 | ||||
-rw-r--r-- | gas/config/tc-mmix.c | 3 | ||||
-rw-r--r-- | gas/config/tc-mn10200.c | 9 | ||||
-rw-r--r-- | gas/config/tc-nds32.c | 3 | ||||
-rw-r--r-- | gas/config/tc-ppc.c | 10 | ||||
-rw-r--r-- | gas/config/tc-pru.c | 5 | ||||
-rw-r--r-- | gas/config/tc-riscv.c | 3 | ||||
-rw-r--r-- | gas/config/tc-s12z.c | 2 | ||||
-rw-r--r-- | gas/config/tc-s390.c | 5 | ||||
-rw-r--r-- | gas/config/tc-spu.c | 11 | ||||
-rw-r--r-- | gas/config/tc-tilegx.c | 2 | ||||
-rw-r--r-- | gas/config/tc-tilepro.c | 2 | ||||
-rw-r--r-- | gas/config/tc-v850.c | 3 | ||||
-rw-r--r-- | gas/config/tc-vax.c | 2 | ||||
-rw-r--r-- | gas/config/tc-xc16x.c | 5 | ||||
-rw-r--r-- | gas/config/tc-xgate.c | 2 | ||||
-rw-r--r-- | gas/config/tc-xstormy16.c | 2 | ||||
-rw-r--r-- | gas/config/tc-xtensa.c | 2 | ||||
-rw-r--r-- | gas/config/tc-z80.c | 2 |
28 files changed, 47 insertions, 80 deletions
diff --git a/gas/config/tc-arc.c b/gas/config/tc-arc.c index 3cd33da..d03dc72 100644 --- a/gas/config/tc-arc.c +++ b/gas/config/tc-arc.c @@ -2936,12 +2936,7 @@ md_apply_fix (fixS *fixP, } else { - as_bad_where (fixP->fx_file, fixP->fx_line, - _("can't resolve `%s' {%s section} - `%s' {%s section}"), - fx_addsy ? S_GET_NAME (fx_addsy) : "0", - segment_name (add_symbol_segment), - S_GET_NAME (fx_subsy), - segment_name (sub_symbol_segment)); + as_bad_subtract (fixP); return; } } diff --git a/gas/config/tc-avr.c b/gas/config/tc-avr.c index 397f22d..40dcce7 100644 --- a/gas/config/tc-avr.c +++ b/gas/config/tc-avr.c @@ -1548,7 +1548,7 @@ md_apply_fix (fixS *fixP, valueT * valP, segT seg) fixP->fx_r_type = BFD_RELOC_AVR_DIFF32; break; default: - as_bad_where (fixP->fx_file, fixP->fx_line, _("expression too complex")); + as_bad_subtract (fixP); break; } @@ -1560,7 +1560,7 @@ md_apply_fix (fixS *fixP, valueT * valP, segT seg) } /* We don't actually support subtracting a symbol. */ if (fixP->fx_subsy != (symbolS *) NULL) - as_bad_where (fixP->fx_file, fixP->fx_line, _("expression too complex")); + as_bad_subtract (fixP); /* For the DIFF relocs, write the value into the object file while still keeping fx_done FALSE, as both the difference (recorded in the object file) @@ -1824,7 +1824,7 @@ tc_gen_reloc (asection *seg ATTRIBUTE_UNUSED, if (fixp->fx_subsy != NULL) { - as_bad_where (fixp->fx_file, fixp->fx_line, _("expression too complex")); + as_bad_subtract (fixp); return NULL; } diff --git a/gas/config/tc-cr16.c b/gas/config/tc-cr16.c index cbe113e..8925650 100644 --- a/gas/config/tc-cr16.c +++ b/gas/config/tc-cr16.c @@ -573,14 +573,10 @@ tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS * fixP) else { /* We only resolve difference expressions in the same section. */ - as_bad_where (fixP->fx_file, fixP->fx_line, - _("can't resolve `%s' {%s section} - `%s' {%s section}"), - fixP->fx_addsy ? S_GET_NAME (fixP->fx_addsy) : "0", - segment_name (fixP->fx_addsy - ? S_GET_SEGMENT (fixP->fx_addsy) - : absolute_section), - S_GET_NAME (fixP->fx_subsy), - segment_name (S_GET_SEGMENT (fixP->fx_addsy))); + as_bad_subtract (fixP); + free (reloc->sym_ptr_ptr); + free (reloc); + return NULL; } } #ifdef OBJ_ELF diff --git a/gas/config/tc-cris.c b/gas/config/tc-cris.c index 94a32e3..02ce2ac 100644 --- a/gas/config/tc-cris.c +++ b/gas/config/tc-cris.c @@ -4050,8 +4050,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg) /* We can't actually support subtracting a symbol. */ if (fixP->fx_subsy != (symbolS *) NULL) - as_bad_where (fixP->fx_file, fixP->fx_line, - _("expression too complex")); + as_bad_subtract (fixP); /* This operand-type is scaled. */ if (fixP->fx_r_type == BFD_RELOC_CRIS_LAPCQ_OFFSET) diff --git a/gas/config/tc-crx.c b/gas/config/tc-crx.c index d33a0bf..ebf38f6 100644 --- a/gas/config/tc-crx.c +++ b/gas/config/tc-crx.c @@ -317,14 +317,10 @@ tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS * fixP) else { /* We only resolve difference expressions in the same section. */ - as_bad_where (fixP->fx_file, fixP->fx_line, - _("can't resolve `%s' {%s section} - `%s' {%s section}"), - fixP->fx_addsy ? S_GET_NAME (fixP->fx_addsy) : "0", - segment_name (fixP->fx_addsy - ? S_GET_SEGMENT (fixP->fx_addsy) - : absolute_section), - S_GET_NAME (fixP->fx_subsy), - segment_name (S_GET_SEGMENT (fixP->fx_addsy))); + as_bad_subtract (fixP); + free (reloc->sym_ptr_ptr); + free (reloc); + return NULL; } } diff --git a/gas/config/tc-d10v.c b/gas/config/tc-d10v.c index 1d92f34..b6437b1 100644 --- a/gas/config/tc-d10v.c +++ b/gas/config/tc-d10v.c @@ -1503,7 +1503,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) /* We don't actually support subtracting a symbol. */ if (fixP->fx_subsy != (symbolS *) NULL) - as_bad_where (fixP->fx_file, fixP->fx_line, _("expression too complex")); + as_bad_subtract (fixP); op_type = fixP->fx_r_type; if (op_type & 2048) diff --git a/gas/config/tc-d30v.c b/gas/config/tc-d30v.c index 957182a..c48e4a3 100644 --- a/gas/config/tc-d30v.c +++ b/gas/config/tc-d30v.c @@ -1906,7 +1906,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) /* We don't support subtracting a symbol. */ if (fixP->fx_subsy != (symbolS *) NULL) - as_bad_where (fixP->fx_file, fixP->fx_line, _("expression too complex")); + as_bad_subtract (fixP); /* Fetch the instruction, insert the fully resolved operand value, and stuff the instruction back again. */ diff --git a/gas/config/tc-ft32.c b/gas/config/tc-ft32.c index 91b8c36..928920f 100644 --- a/gas/config/tc-ft32.c +++ b/gas/config/tc-ft32.c @@ -570,8 +570,7 @@ md_apply_fix (fixS *fixP ATTRIBUTE_UNUSED, fixP->fx_r_type = BFD_RELOC_FT32_DIFF32; break; default: - as_bad_where (fixP->fx_file, fixP->fx_line, - _("expression too complex")); + as_bad_subtract (fixP); break; } @@ -584,7 +583,7 @@ md_apply_fix (fixS *fixP ATTRIBUTE_UNUSED, /* We don't actually support subtracting a symbol. */ if (fixP->fx_subsy != (symbolS *) NULL) - as_bad_where (fixP->fx_file, fixP->fx_line, _("expression too complex")); + as_bad_subtract (fixP); switch (fixP->fx_r_type) { diff --git a/gas/config/tc-h8300.c b/gas/config/tc-h8300.c index e1f359a..545c15e 100644 --- a/gas/config/tc-h8300.c +++ b/gas/config/tc-h8300.c @@ -2298,8 +2298,7 @@ tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS *fixp) if ((S_GET_SEGMENT (fixp->fx_addsy) != S_GET_SEGMENT (fixp->fx_subsy)) || S_GET_SEGMENT (fixp->fx_addsy) == undefined_section) { - as_bad_where (fixp->fx_file, fixp->fx_line, - _("Difference of symbols in different sections is not supported")); + as_bad_subtract (fixp); return NULL; } } diff --git a/gas/config/tc-m68hc11.c b/gas/config/tc-m68hc11.c index b31f5ca..a6e876c 100644 --- a/gas/config/tc-m68hc11.c +++ b/gas/config/tc-m68hc11.c @@ -4334,7 +4334,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) /* We don't actually support subtracting a symbol. */ if (fixP->fx_subsy != (symbolS *) NULL) - as_bad_where (fixP->fx_file, fixP->fx_line, _("Expression too complex.")); + as_bad_subtract (fixP); /* Patch the instruction with the resolved operand. Elf relocation info will also be generated to take care of linker/loader fixups. diff --git a/gas/config/tc-mmix.c b/gas/config/tc-mmix.c index d51a019..04a799a 100644 --- a/gas/config/tc-mmix.c +++ b/gas/config/tc-mmix.c @@ -3742,8 +3742,7 @@ mmix_frob_file (void) /* This case isn't doable in general anyway, methinks. */ if (fixP->fx_subsy != NULL) { - as_bad_where (fixP->fx_file, fixP->fx_line, - _("GREG expression too complicated")); + as_bad_subtract (fixP); continue; } diff --git a/gas/config/tc-mn10200.c b/gas/config/tc-mn10200.c index 6323e54..cbec565 100644 --- a/gas/config/tc-mn10200.c +++ b/gas/config/tc-mn10200.c @@ -762,14 +762,7 @@ tc_gen_reloc (asection *seg ATTRIBUTE_UNUSED, fixS *fixp) /* FIXME: We should try more ways to resolve difference expressions here. At least this is better than silently ignoring the subtrahend. */ - as_bad_where (fixp->fx_file, fixp->fx_line, - _("can't resolve `%s' {%s section} - `%s' {%s section}"), - fixp->fx_addsy ? S_GET_NAME (fixp->fx_addsy) : "0", - segment_name (fixp->fx_addsy - ? S_GET_SEGMENT (fixp->fx_addsy) - : absolute_section), - S_GET_NAME (fixp->fx_subsy), - segment_name (S_GET_SEGMENT (fixp->fx_addsy))); + as_bad_subtract (fixp); } reloc->howto = bfd_reloc_type_lookup (stdoutput, fixp->fx_r_type); diff --git a/gas/config/tc-nds32.c b/gas/config/tc-nds32.c index 4ff667c..0ab436c 100644 --- a/gas/config/tc-nds32.c +++ b/gas/config/tc-nds32.c @@ -7825,8 +7825,7 @@ nds32_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) /* cvt_frag_to_fill () has called output_leb128 () for us. */ break; default: - as_bad_where (fixP->fx_file, fixP->fx_line, - _("expression too complex")); + as_bad_subtract (fixP); return; } } diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c index 567f801..3eaeb89 100644 --- a/gas/config/tc-ppc.c +++ b/gas/config/tc-ppc.c @@ -7476,7 +7476,7 @@ tc_gen_reloc (asection *seg ATTRIBUTE_UNUSED, fixS *fixp) } reloc->addend = fixp->fx_addnumber; - if (fixp->fx_subsy && fixp->fx_addsy) + if (fixp->fx_subsy != NULL) { relocs[1] = reloc = XNEW (arelent); relocs[2] = NULL; @@ -7490,9 +7490,11 @@ tc_gen_reloc (asection *seg ATTRIBUTE_UNUSED, fixS *fixp) if (reloc->howto == (reloc_howto_type *) NULL) { - as_bad_where (fixp->fx_file, fixp->fx_line, - _("reloc %d not supported by object file format"), - BFD_RELOC_PPC_NEG); + as_bad_subtract (fixp); + free (relocs[1]->sym_ptr_ptr); + free (relocs[1]); + free (relocs[0]->sym_ptr_ptr); + free (relocs[0]); relocs[0] = NULL; } } diff --git a/gas/config/tc-pru.c b/gas/config/tc-pru.c index 14876f4..16678b1 100644 --- a/gas/config/tc-pru.c +++ b/gas/config/tc-pru.c @@ -742,8 +742,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) diffval /= 4; break; default: - as_bad_where (fixP->fx_file, fixP->fx_line, - _("expression too complex")); + as_bad_subtract (fixP); break; } @@ -753,7 +752,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) } /* We don't actually support subtracting a symbol. */ if (fixP->fx_subsy != (symbolS *) NULL) - as_bad_where (fixP->fx_file, fixP->fx_line, _("expression too complex")); + as_bad_subtract (fixP); /* For the DIFF relocs, write the value into the object file while still keeping fx_done FALSE, as both the difference (recorded in the object file) diff --git a/gas/config/tc-riscv.c b/gas/config/tc-riscv.c index df37579..460667e 100644 --- a/gas/config/tc-riscv.c +++ b/gas/config/tc-riscv.c @@ -3201,8 +3201,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) } if (fixP->fx_subsy != NULL) - as_bad_where (fixP->fx_file, fixP->fx_line, - _("unsupported symbol subtraction")); + as_bad_subtract (fixP); /* Add an R_RISCV_RELAX reloc if the reloc is relaxable. */ if (relaxable && fixP->fx_tcbit && fixP->fx_addsy != NULL) diff --git a/gas/config/tc-s12z.c b/gas/config/tc-s12z.c index 6ec4d5c..11a412d 100644 --- a/gas/config/tc-s12z.c +++ b/gas/config/tc-s12z.c @@ -3933,7 +3933,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) /* We don't actually support subtracting a symbol. */ if (fixP->fx_subsy != (symbolS *) NULL) - as_bad_where (fixP->fx_file, fixP->fx_line, _("Expression too complex.")); + as_bad_subtract (fixP); /* Patch the instruction with the resolved operand. Elf relocation diff --git a/gas/config/tc-s390.c b/gas/config/tc-s390.c index 064dd33..a203436 100644 --- a/gas/config/tc-s390.c +++ b/gas/config/tc-s390.c @@ -2254,10 +2254,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) where = fixP->fx_frag->fr_literal + fixP->fx_where; if (fixP->fx_subsy != NULL) - as_bad_where (fixP->fx_file, fixP->fx_line, - _("cannot emit relocation %s against subsy symbol %s"), - bfd_get_reloc_code_name (fixP->fx_r_type), - S_GET_NAME (fixP->fx_subsy)); + as_bad_subtract (fixP); if (fixP->fx_addsy != NULL) { diff --git a/gas/config/tc-spu.c b/gas/config/tc-spu.c index f9055a5..11fafa1 100644 --- a/gas/config/tc-spu.c +++ b/gas/config/tc-spu.c @@ -868,12 +868,7 @@ tc_gen_reloc (asection *seg ATTRIBUTE_UNUSED, fixS *fixp) arelent *reloc; reloc = XNEW (arelent); reloc->sym_ptr_ptr = XNEW (asymbol *); - if (fixp->fx_addsy) - *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy); - else if (fixp->fx_subsy) - *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_subsy); - else - abort (); + *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy); reloc->address = fixp->fx_frag->fr_address + fixp->fx_where; reloc->howto = bfd_reloc_type_lookup (stdoutput, fixp->fx_r_type); if (reloc->howto == (reloc_howto_type *) NULL) @@ -881,6 +876,8 @@ tc_gen_reloc (asection *seg ATTRIBUTE_UNUSED, fixS *fixp) as_bad_where (fixp->fx_file, fixp->fx_line, _("reloc %d not supported by object file format"), (int) fixp->fx_r_type); + free (reloc->sym_ptr_ptr); + free (reloc); return NULL; } reloc->addend = fixp->fx_addnumber; @@ -957,7 +954,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) if (fixP->fx_subsy != (symbolS *) NULL) { /* We can't actually support subtracting a symbol. */ - as_bad_where (fixP->fx_file, fixP->fx_line, _("expression too complex")); + as_bad_subtract (fixP); } if (fixP->fx_addsy != NULL) diff --git a/gas/config/tc-tilegx.c b/gas/config/tc-tilegx.c index e041b4a..97062c0 100644 --- a/gas/config/tc-tilegx.c +++ b/gas/config/tc-tilegx.c @@ -1476,7 +1476,7 @@ md_apply_fix (fixS *fixP, valueT * valP, segT seg ATTRIBUTE_UNUSED) if (fixP->fx_subsy != (symbolS *) NULL) { /* We can't actually support subtracting a symbol. */ - as_bad_where (fixP->fx_file, fixP->fx_line, _("expression too complex")); + as_bad_subtract (fixP); } /* Correct relocation types for pc-relativeness. */ diff --git a/gas/config/tc-tilepro.c b/gas/config/tc-tilepro.c index 365b621..11893bc 100644 --- a/gas/config/tc-tilepro.c +++ b/gas/config/tc-tilepro.c @@ -1334,7 +1334,7 @@ md_apply_fix (fixS *fixP, valueT * valP, segT seg ATTRIBUTE_UNUSED) if (fixP->fx_subsy != (symbolS *) NULL) { /* We can't actually support subtracting a symbol. */ - as_bad_where (fixP->fx_file, fixP->fx_line, _("expression too complex")); + as_bad_subtract (fixP); } /* Correct relocation types for pc-relativeness. */ diff --git a/gas/config/tc-v850.c b/gas/config/tc-v850.c index 5bfebba..81449d0 100644 --- a/gas/config/tc-v850.c +++ b/gas/config/tc-v850.c @@ -3447,8 +3447,7 @@ md_apply_fix (fixS *fixP, valueT *valueP, segT seg ATTRIBUTE_UNUSED) value -= S_GET_VALUE (fixP->fx_subsy); else /* We don't actually support subtracting a symbol. */ - as_bad_where (fixP->fx_file, fixP->fx_line, - _("expression too complex")); + as_bad_subtract (fixP); } fixP->fx_addnumber = value; } diff --git a/gas/config/tc-vax.c b/gas/config/tc-vax.c index f439f1b..efffc7d 100644 --- a/gas/config/tc-vax.c +++ b/gas/config/tc-vax.c @@ -279,7 +279,7 @@ md_apply_fix (fixS *fixP, valueT *valueP, segT seg ATTRIBUTE_UNUSED) valueT value = * valueP; if (fixP->fx_subsy != (symbolS *) NULL) - as_bad_where (fixP->fx_file, fixP->fx_line, _("expression too complex")); + as_bad_subtract (fixP); if (fixP->fx_addsy == NULL) fixP->fx_done = 1; diff --git a/gas/config/tc-xc16x.c b/gas/config/tc-xc16x.c index 7d89a37..12d9070 100644 --- a/gas/config/tc-xc16x.c +++ b/gas/config/tc-xc16x.c @@ -283,13 +283,12 @@ tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS *fixp) arelent *rel; bfd_reloc_code_real_type r_type; - if (fixp->fx_addsy && fixp->fx_subsy) + if (fixp->fx_subsy) { if ((S_GET_SEGMENT (fixp->fx_addsy) != S_GET_SEGMENT (fixp->fx_subsy)) || S_GET_SEGMENT (fixp->fx_addsy) == undefined_section) { - as_bad_where (fixp->fx_file, fixp->fx_line, - _("Difference of symbols in different sections is not supported")); + as_bad_subtract (fixp); return NULL; } } diff --git a/gas/config/tc-xgate.c b/gas/config/tc-xgate.c index 5f5d165..f97540a 100644 --- a/gas/config/tc-xgate.c +++ b/gas/config/tc-xgate.c @@ -660,7 +660,7 @@ md_apply_fix (fixS * fixP, valueT * valP, segT seg ATTRIBUTE_UNUSED) /* We don't actually support subtracting a symbol. */ if (fixP->fx_subsy != (symbolS *) NULL) - as_bad_where (fixP->fx_file, fixP->fx_line, _("Expression too complex.")); + as_bad_subtract (fixP); where = fixP->fx_frag->fr_literal + fixP->fx_where; opcode = bfd_getl16 (where); diff --git a/gas/config/tc-xstormy16.c b/gas/config/tc-xstormy16.c index 3edf384..deb1081 100644 --- a/gas/config/tc-xstormy16.c +++ b/gas/config/tc-xstormy16.c @@ -479,7 +479,7 @@ xstormy16_md_apply_fix (fixS * fixP, /* We don't actually support subtracting a symbol. */ if (fixP->fx_subsy != (symbolS *) NULL) - as_bad_where (fixP->fx_file, fixP->fx_line, _("expression too complex")); + as_bad_subtract (fixP); if ((int) fixP->fx_r_type >= (int) BFD_RELOC_UNUSED) { diff --git a/gas/config/tc-xtensa.c b/gas/config/tc-xtensa.c index 452d4a7..b8634f7 100644 --- a/gas/config/tc-xtensa.c +++ b/gas/config/tc-xtensa.c @@ -6006,7 +6006,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg) if (fixP->fx_subsy && !(linkrelax && (fixP->fx_r_type == BFD_RELOC_32 || fixP->fx_r_type == BFD_RELOC_16 || fixP->fx_r_type == BFD_RELOC_8))) - as_bad_where (fixP->fx_file, fixP->fx_line, _("expression too complex")); + as_bad_subtract (fixP); switch (fixP->fx_r_type) { diff --git a/gas/config/tc-z80.c b/gas/config/tc-z80.c index 303296b..052982f 100644 --- a/gas/config/tc-z80.c +++ b/gas/config/tc-z80.c @@ -3853,7 +3853,7 @@ tc_gen_reloc (asection *seg ATTRIBUTE_UNUSED , fixS *fixp) if (fixp->fx_subsy != NULL) { - as_bad_where (fixp->fx_file, fixp->fx_line, _("expression too complex")); + as_bad_subtract (fixp); return NULL; } |