aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2005-03-03 13:50:02 +0000
committerNick Clifton <nickc@redhat.com>2005-03-03 13:50:02 +0000
commit77ccfee5d29b979b4edf12310a112167f8986df7 (patch)
tree7c1a1da6aeb13f21a4d05a86dbd96cb6023c5cc6 /gas
parent406a7f05f4c15ff9139c25ec0b4f8050d3113e5f (diff)
downloadgdb-77ccfee5d29b979b4edf12310a112167f8986df7.zip
gdb-77ccfee5d29b979b4edf12310a112167f8986df7.tar.gz
gdb-77ccfee5d29b979b4edf12310a112167f8986df7.tar.bz2
(tc_gen_reloc): Handle the case where the reloc is the difference of two
symbols defined in the same section.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog4
-rw-r--r--gas/config/tc-mn10200.c29
2 files changed, 22 insertions, 11 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index b1592b2..9bcfa10 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,9 @@
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
as otherwise this breaks #APP/#NO_APP processing.
diff --git a/gas/config/tc-mn10200.c b/gas/config/tc-mn10200.c
index 6412551..ad7b756 100644
--- a/gas/config/tc-mn10200.c
+++ b/gas/config/tc-mn10200.c
@@ -1235,17 +1235,24 @@ tc_gen_reloc (seg, fixp)
if (fixp->fx_subsy != NULL)
{
- /* FIXME: We should resolve difference expressions if possible
- 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)));
+ if (S_GET_SEGMENT (fixp->fx_addsy) == S_GET_SEGMENT (fixp->fx_subsy)
+ && S_IS_DEFINED (fixp->fx_subsy))
+ {
+ fixp->fx_offset -= S_GET_VALUE (fixp->fx_subsy);
+ fixp->fx_subsy = NULL;
+ }
+ else
+ /* 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)));
}
reloc->howto = bfd_reloc_type_lookup (stdoutput, fixp->fx_r_type);