(tc_gen_reloc): Handle the case where the reloc is the difference of two

symbols defined in the same section.
This commit is contained in:
Nick Clifton
2005-03-03 13:50:02 +00:00
parent 406a7f05f4
commit 77ccfee5d2
2 changed files with 22 additions and 11 deletions

View File

@ -1,5 +1,9 @@
2005-03-03 Nick Clifton <nickc@redhat.com> 2005-03-03 Nick Clifton <nickc@redhat.com>
* config/tc-mn10200.c (tc_gen_reloc): Handle the case where the
reloc is the difference of two symbols defined in the same
section.
* config/tc-iq2000.c (line_comment_chars): Include the # character * config/tc-iq2000.c (line_comment_chars): Include the # character
as otherwise this breaks #APP/#NO_APP processing. as otherwise this breaks #APP/#NO_APP processing.

View File

@ -1235,17 +1235,24 @@ tc_gen_reloc (seg, fixp)
if (fixp->fx_subsy != NULL) if (fixp->fx_subsy != NULL)
{ {
/* FIXME: We should resolve difference expressions if possible if (S_GET_SEGMENT (fixp->fx_addsy) == S_GET_SEGMENT (fixp->fx_subsy)
here. At least this is better than silently ignoring the && S_IS_DEFINED (fixp->fx_subsy))
subtrahend. */ {
as_bad_where (fixp->fx_file, fixp->fx_line, fixp->fx_offset -= S_GET_VALUE (fixp->fx_subsy);
_("can't resolve `%s' {%s section} - `%s' {%s section}"), fixp->fx_subsy = NULL;
fixp->fx_addsy ? S_GET_NAME (fixp->fx_addsy) : "0", }
segment_name (fixp->fx_addsy else
? S_GET_SEGMENT (fixp->fx_addsy) /* FIXME: We should try more ways to resolve difference expressions
: absolute_section), here. At least this is better than silently ignoring the
S_GET_NAME (fixp->fx_subsy), subtrahend. */
segment_name (S_GET_SEGMENT (fixp->fx_addsy))); 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)));
} }
reloc->howto = bfd_reloc_type_lookup (stdoutput, fixp->fx_r_type); reloc->howto = bfd_reloc_type_lookup (stdoutput, fixp->fx_r_type);