Many places report errors of the nature "can't resolve a - b".
This provides a utility function to report such errors consistently.
I removed the section reporting and quotes around symbol names while I
was at it. Compare
ifunc-2.s:4: Error: can't resolve `bar1' {.text.1 section} - `foo1' {.text.1 section}
with
ifunc-2.s:4: Error: can't resolve bar1 - foo1
In many cases the section names don't help the user very much in
figuring out what went wrong, and the quotes if present arguably ought
to be placed around the entire expression:
can't resolve `bar1 - foo1'
The patch also tidies some tc_get_reloc functions that leak memory on
error paths.
* write.h (as_bad_subtract): Declare.
* write.c (as_bad_subtract): New function.
(fixup_segment): Use as_bad_subtract.
* config/tc-arc.c (md_apply_fix): Likewise.
* config/tc-avr.c (md_apply_fix, tc_gen_reloc): Likewise.
* config/tc-cris.c (md_apply_fix): Likewise.
* config/tc-d10v.c (md_apply_fix): Likewise.
* config/tc-d30v.c (md_apply_fix): Likewise.
* config/tc-ft32.c (md_apply_fix): Likewise.
* config/tc-h8300.c (tc_gen_reloc): Likewise.
* config/tc-m68hc11.c (md_apply_fix): Likewise.
* config/tc-mmix.c (mmix_frob_file): Likewise.
* config/tc-mn10200.c (tc_gen_reloc): Likewise.
* config/tc-nds32.c (nds32_apply_fix): Likewise.
* config/tc-pru.c (md_apply_fix): Likewise.
* config/tc-riscv.c (md_apply_fix): Likewise.
* config/tc-s12z.c (md_apply_fix): Likewise.
* config/tc-s390.c (md_apply_fix): Likewise.
* config/tc-tilegx.c (md_apply_fix): Likewise.
* config/tc-tilepro.c (md_apply_fix): Likewise.
* config/tc-v850.c (md_apply_fix): Likewise.
* config/tc-vax.c (md_apply_fix): Likewise.
* config/tc-xc16x.c (tc_gen_reloc): Likewise.
* config/tc-xgate.c (md_apply_fix): Likewise.
* config/tc-xstormy16.c (xstormy16_md_apply_fix): Likewise.
* config/tc-xtensa.c (md_apply_fix): Likewise.
* config/tc-z80.c (tc_gen_reloc): Likewise.
* config/tc-spu.c (md_apply_fix): Likewise.
(tc_gen_reloc): Delete dead code. Free memory on error.
* config/tc-cr16.c (tc_gen_reloc): Use as_bad_subtract. Free
on error.
* config/tc-crx.c (tc_gen_reloc): Likewise.
* config/tc-ppc.c (tc_gen_reloc): Likewise.
* testsuite/gas/i386/ifunc-2.l: Adjust to suit changed error message.
* testsuite/gas/mips/lui-2.l: Likewise.
* testsuite/gas/tic6x/reloc-bad-1.l: Likewise.
}
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;
}
}
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;
}
}
/* 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)
if (fixp->fx_subsy != NULL)
{
- as_bad_where (fixp->fx_file, fixp->fx_line, _("expression too complex"));
+ as_bad_subtract (fixp);
return NULL;
}
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
/* 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)
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;
}
}
/* 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)
/* 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. */
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;
}
/* 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)
{
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;
}
}
/* 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.
/* 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;
}
/* 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);
/* 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;
}
}
}
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;
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;
}
}
diffval /= 4;
break;
default:
- as_bad_where (fixP->fx_file, fixP->fx_line,
- _("expression too complex"));
+ as_bad_subtract (fixP);
break;
}
}
/* 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)
}
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)
/* 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
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)
{
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)
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;
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)
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. */
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. */
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;
}
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;
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;
}
}
/* 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);
/* 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)
{
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)
{
if (fixp->fx_subsy != NULL)
{
- as_bad_where (fixp->fx_file, fixp->fx_line, _("expression too complex"));
+ as_bad_subtract (fixp);
return NULL;
}
.*/ifunc-2\.s: Assembler messages:
-.*/ifunc-2\.s:4: Error: can't resolve `bar1' {\.text\.1 section} - `foo1' {\.text\.1 section}
-.*/ifunc-2\.s:5: Error: can't resolve `bar2' {\.text\.2 section} - `foo2' {\.text\.2 section}
-.*/ifunc-2\.s:6: Error: can't resolve `bar1' {\.text\.1 section} - `bar2' {\.text\.2 section}
-.*/ifunc-2\.s:7: Error: can't resolve `bar2' {\.text\.2 section} - `bar1' {\.text\.1 section}
-.*/ifunc-2\.s:8: Error: can't resolve `\.text\.1' {\.text\.1 section} - `bar1' {\.text\.1 section}
-.*/ifunc-2\.s:9: Error: can't resolve `\.text\.1' {\.text\.1 section} - `bar2' {\.text\.2 section}
-.*/ifunc-2\.s:10: Error: can't resolve `bar1' {\.text\.1 section} - `abs1' {\*ABS\* section}
-.*/ifunc-2\.s:11: Error: can't resolve `abs1' {\*ABS\* section} - `bar1' {\.text\.1 section}
-.*/ifunc-2\.s:12: Error: can't resolve `\.text\.1' {\.text\.1 section} - `bar1' {\.text\.1 section}
-.*/ifunc-2\.s:19: Error: can't resolve `bar1' {\.text\.1 section} - `foo1' {\.text\.1 section}
-.*/ifunc-2\.s:20: Error: can't resolve `bar2' {\.text\.2 section} - `foo2' {\.text\.2 section}
-.*/ifunc-2\.s:21: Error: can't resolve `bar1' {\.text\.1 section} - `bar2' {\.text\.2 section}
-.*/ifunc-2\.s:22: Error: can't resolve `bar2' {\.text\.2 section} - `bar1' {\.text\.1 section}
-.*/ifunc-2\.s:23: Error: can't resolve `\.text\.1' {\.text\.1 section} - `bar1' {\.text\.1 section}
-.*/ifunc-2\.s:24: Error: can't resolve `\.text\.1' {\.text\.1 section} - `bar2' {\.text\.2 section}
-.*/ifunc-2\.s:25: Error: can't resolve `bar1' {\.text\.1 section} - `abs1' {\*ABS\* section}
-.*/ifunc-2\.s:26: Error: can't resolve `abs1' {\*ABS\* section} - `bar1' {\.text\.1 section}
-.*/ifunc-2\.s:27: Error: can't resolve `\.text\.1' {\.text\.1 section} - `bar1' {\.text\.1 section}
-.*/ifunc-2\.s:34: Error: can't resolve `bar1' {\.text\.1 section} - `foo1' {\.text\.1 section}
-.*/ifunc-2\.s:35: Error: can't resolve `bar2' {\.text\.2 section} - `foo2' {\.text\.2 section}
-.*/ifunc-2\.s:36: Error: can't resolve `bar1' {\.text\.1 section} - `bar2' {\.text\.2 section}
-.*/ifunc-2\.s:37: Error: can't resolve `bar2' {\.text\.2 section} - `bar1' {\.text\.1 section}
-.*/ifunc-2\.s:38: Error: can't resolve `\.text\.1' {\.text\.1 section} - `bar1' {\.text\.1 section}
-.*/ifunc-2\.s:39: Error: can't resolve `\.text\.1' {\.text\.1 section} - `bar2' {\.text\.2 section}
-.*/ifunc-2\.s:40: Error: can't resolve `bar1' {\.text\.1 section} - `abs1' {\*ABS\* section}
-.*/ifunc-2\.s:41: Error: can't resolve `abs1' {\*ABS\* section} - `bar1' {\.text\.1 section}
-.*/ifunc-2\.s:42: Error: can't resolve `\.text\.1' {\.text\.1 section} - `bar1' {\.text\.1 section}
-.*/ifunc-2\.s:44: Error: can't resolve `abs1' {\*ABS\* section} - `abs2' {\*ABS\* section}
-.*/ifunc-2\.s:45: Error: can't resolve `abs2' {\*ABS\* section} - `abs1' {\*ABS\* section}
-.*/ifunc-2\.s:50: Error: can't resolve `abs1' {\*ABS\* section} - `abs2' {\*ABS\* section}
-.*/ifunc-2\.s:51: Error: can't resolve `abs2' {\*ABS\* section} - `abs1' {\*ABS\* section}
-.*/ifunc-2\.s:56: Error: can't resolve `abs1' {\*ABS\* section} - `abs2' {\*ABS\* section}
-.*/ifunc-2\.s:57: Error: can't resolve `abs2' {\*ABS\* section} - `abs1' {\*ABS\* section}
-.*/ifunc-2\.s:62: Error: can't resolve `bar1' {\.text\.1 section} - `foo1' {\.text\.1 section}
-.*/ifunc-2\.s:63: Error: can't resolve `bar2' {\.text\.2 section} - `foo2' {\.text\.2 section}
-.*/ifunc-2\.s:64: Error: can't resolve `bar1' {\.text\.1 section} - `bar2' {\.text\.2 section}
-.*/ifunc-2\.s:65: Error: can't resolve `bar2' {\.text\.2 section} - `bar1' {\.text\.1 section}
-.*/ifunc-2\.s:66: Error: can't resolve `\.text\.2' {\.text\.2 section} - `bar1' {\.text\.1 section}
-.*/ifunc-2\.s:67: Error: can't resolve `\.text\.2' {\.text\.2 section} - `bar2' {\.text\.2 section}
-.*/ifunc-2\.s:68: Error: can't resolve `bar2' {\.text\.2 section} - `abs1' {\*ABS\* section}
-.*/ifunc-2\.s:69: Error: can't resolve `abs1' {\*ABS\* section} - `bar2' {\.text\.2 section}
-.*/ifunc-2\.s:70: Error: can't resolve `\.text\.2' {\.text\.2 section} - `bar2' {\.text\.2 section}
-.*/ifunc-2\.s:77: Error: can't resolve `bar1' {\.text\.1 section} - `foo1' {\.text\.1 section}
-.*/ifunc-2\.s:78: Error: can't resolve `bar2' {\.text\.2 section} - `foo2' {\.text\.2 section}
-.*/ifunc-2\.s:79: Error: can't resolve `bar1' {\.text\.1 section} - `bar2' {\.text\.2 section}
-.*/ifunc-2\.s:80: Error: can't resolve `bar2' {\.text\.2 section} - `bar1' {\.text\.1 section}
-.*/ifunc-2\.s:81: Error: can't resolve `\.text\.2' {\.text\.2 section} - `bar1' {\.text\.1 section}
-.*/ifunc-2\.s:82: Error: can't resolve `\.text\.2' {\.text\.2 section} - `bar2' {\.text\.2 section}
-.*/ifunc-2\.s:83: Error: can't resolve `bar2' {\.text\.2 section} - `abs1' {\*ABS\* section}
-.*/ifunc-2\.s:84: Error: can't resolve `abs1' {\*ABS\* section} - `bar2' {\.text\.2 section}
-.*/ifunc-2\.s:85: Error: can't resolve `\.text\.2' {\.text\.2 section} - `bar2' {\.text\.2 section}
-.*/ifunc-2\.s:92: Error: can't resolve `bar1' {\.text\.1 section} - `foo1' {\.text\.1 section}
-.*/ifunc-2\.s:93: Error: can't resolve `bar2' {\.text\.2 section} - `foo2' {\.text\.2 section}
-.*/ifunc-2\.s:94: Error: can't resolve `bar1' {\.text\.1 section} - `bar2' {\.text\.2 section}
-.*/ifunc-2\.s:95: Error: can't resolve `bar2' {\.text\.2 section} - `bar1' {\.text\.1 section}
-.*/ifunc-2\.s:96: Error: can't resolve `\.text\.2' {\.text\.2 section} - `bar1' {\.text\.1 section}
-.*/ifunc-2\.s:97: Error: can't resolve `\.text\.2' {\.text\.2 section} - `bar2' {\.text\.2 section}
-.*/ifunc-2\.s:98: Error: can't resolve `bar2' {\.text\.2 section} - `abs1' {\*ABS\* section}
-.*/ifunc-2\.s:99: Error: can't resolve `abs1' {\*ABS\* section} - `bar2' {\.text\.2 section}
-.*/ifunc-2\.s:100: Error: can't resolve `\.text\.2' {\.text\.2 section} - `bar2' {\.text\.2 section}
+.*/ifunc-2\.s:4: Error: can't resolve bar1 - foo1
+.*/ifunc-2\.s:5: Error: can't resolve bar2 - foo2
+.*/ifunc-2\.s:6: Error: can't resolve bar1 - bar2
+.*/ifunc-2\.s:7: Error: can't resolve bar2 - bar1
+.*/ifunc-2\.s:8: Error: can't resolve \.text\.1 - bar1
+.*/ifunc-2\.s:9: Error: can't resolve \.text\.1 - bar2
+.*/ifunc-2\.s:10: Error: can't resolve bar1 - abs1
+.*/ifunc-2\.s:11: Error: can't resolve abs1 - bar1
+.*/ifunc-2\.s:12: Error: can't resolve \.text\.1 - bar1
+.*/ifunc-2\.s:19: Error: can't resolve bar1 - foo1
+.*/ifunc-2\.s:20: Error: can't resolve bar2 - foo2
+.*/ifunc-2\.s:21: Error: can't resolve bar1 - bar2
+.*/ifunc-2\.s:22: Error: can't resolve bar2 - bar1
+.*/ifunc-2\.s:23: Error: can't resolve \.text\.1 - bar1
+.*/ifunc-2\.s:24: Error: can't resolve \.text\.1 - bar2
+.*/ifunc-2\.s:25: Error: can't resolve bar1 - abs1
+.*/ifunc-2\.s:26: Error: can't resolve abs1 - bar1
+.*/ifunc-2\.s:27: Error: can't resolve \.text\.1 - bar1
+.*/ifunc-2\.s:34: Error: can't resolve bar1 - foo1
+.*/ifunc-2\.s:35: Error: can't resolve bar2 - foo2
+.*/ifunc-2\.s:36: Error: can't resolve bar1 - bar2
+.*/ifunc-2\.s:37: Error: can't resolve bar2 - bar1
+.*/ifunc-2\.s:38: Error: can't resolve \.text\.1 - bar1
+.*/ifunc-2\.s:39: Error: can't resolve \.text\.1 - bar2
+.*/ifunc-2\.s:40: Error: can't resolve bar1 - abs1
+.*/ifunc-2\.s:41: Error: can't resolve abs1 - bar1
+.*/ifunc-2\.s:42: Error: can't resolve \.text\.1 - bar1
+.*/ifunc-2\.s:44: Error: can't resolve abs1 - abs2
+.*/ifunc-2\.s:45: Error: can't resolve abs2 - abs1
+.*/ifunc-2\.s:50: Error: can't resolve abs1 - abs2
+.*/ifunc-2\.s:51: Error: can't resolve abs2 - abs1
+.*/ifunc-2\.s:56: Error: can't resolve abs1 - abs2
+.*/ifunc-2\.s:57: Error: can't resolve abs2 - abs1
+.*/ifunc-2\.s:62: Error: can't resolve bar1 - foo1
+.*/ifunc-2\.s:63: Error: can't resolve bar2 - foo2
+.*/ifunc-2\.s:64: Error: can't resolve bar1 - bar2
+.*/ifunc-2\.s:65: Error: can't resolve bar2 - bar1
+.*/ifunc-2\.s:66: Error: can't resolve \.text\.2 - bar1
+.*/ifunc-2\.s:67: Error: can't resolve \.text\.2 - bar2
+.*/ifunc-2\.s:68: Error: can't resolve bar2 - abs1
+.*/ifunc-2\.s:69: Error: can't resolve abs1 - bar2
+.*/ifunc-2\.s:70: Error: can't resolve \.text\.2 - bar2
+.*/ifunc-2\.s:77: Error: can't resolve bar1 - foo1
+.*/ifunc-2\.s:78: Error: can't resolve bar2 - foo2
+.*/ifunc-2\.s:79: Error: can't resolve bar1 - bar2
+.*/ifunc-2\.s:80: Error: can't resolve bar2 - bar1
+.*/ifunc-2\.s:81: Error: can't resolve \.text\.2 - bar1
+.*/ifunc-2\.s:82: Error: can't resolve \.text\.2 - bar2
+.*/ifunc-2\.s:83: Error: can't resolve bar2 - abs1
+.*/ifunc-2\.s:84: Error: can't resolve abs1 - bar2
+.*/ifunc-2\.s:85: Error: can't resolve \.text\.2 - bar2
+.*/ifunc-2\.s:92: Error: can't resolve bar1 - foo1
+.*/ifunc-2\.s:93: Error: can't resolve bar2 - foo2
+.*/ifunc-2\.s:94: Error: can't resolve bar1 - bar2
+.*/ifunc-2\.s:95: Error: can't resolve bar2 - bar1
+.*/ifunc-2\.s:96: Error: can't resolve \.text\.2 - bar1
+.*/ifunc-2\.s:97: Error: can't resolve \.text\.2 - bar2
+.*/ifunc-2\.s:98: Error: can't resolve bar2 - abs1
+.*/ifunc-2\.s:99: Error: can't resolve abs1 - bar2
+.*/ifunc-2\.s:100: Error: can't resolve \.text\.2 - bar2
.*\.s: Assembler messages:
.*\.s:10: Error: invalid operands \(\*UND\* and \*UND\* sections\) for `/'
.*\.s:7: Error: PC-relative reference to a different section
-.*\.s:8: Error: can't resolve `baz' {\*UND\* section} - `bar' {\*UND\* section}
-.*\.s:9: Error: can't resolve `\.text' {\.text section} - `baz' {\*UND\* section}
+.*\.s:8: Error: can't resolve baz - bar
+.*\.s:9: Error: can't resolve \.text - baz
[^:]*: Assembler messages:
-[^:]*:8: Error: can't resolve `a' \{\*UND\* section\} - `b' \{\*UND\* section\}
+[^:]*:8: Error: can't resolve a - b
dump_section_relocs (abfd, sec, stderr);
}
+void
+as_bad_subtract (fixS *fixp)
+{
+ as_bad_where (fixp->fx_file, fixp->fx_line,
+ _("can't resolve %s - %s"),
+ fixp->fx_addsy ? S_GET_NAME (fixp->fx_addsy) : "0",
+ S_GET_NAME (fixp->fx_subsy));
+}
+
/* fixup_segment()
Go through all the fixS's in a segment and see which ones can be
as_bad_where (fixP->fx_file, fixP->fx_line,
_("register value used as expression"));
else
- 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 (add_symbol_segment),
- S_GET_NAME (fixP->fx_subsy),
- segment_name (sub_symbol_segment));
+ as_bad_subtract (fixP);
}
else if (sub_symbol_segment != undefined_section
&& ! bfd_is_com_section (sub_symbol_segment)
extern fixS *fix_new_exp (fragS *, unsigned long, unsigned long,
expressionS *, int, bfd_reloc_code_real_type);
extern void write_print_statistics (FILE *);
+extern void as_bad_subtract (fixS *);
#endif /* __write_h__ */