aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-mn10300.c
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2001-09-25 08:51:52 +0000
committerAlexandre Oliva <aoliva@redhat.com>2001-09-25 08:51:52 +0000
commit6e22e505ed8f0562dfd75b53f845091df952ba9e (patch)
tree85d1ac2826f5b4686420d16e8760790550adb456 /gas/config/tc-mn10300.c
parent83c81bfe970d372e0f337478cd6a0d98e051225a (diff)
downloadfsf-binutils-gdb-6e22e505ed8f0562dfd75b53f845091df952ba9e.zip
fsf-binutils-gdb-6e22e505ed8f0562dfd75b53f845091df952ba9e.tar.gz
fsf-binutils-gdb-6e22e505ed8f0562dfd75b53f845091df952ba9e.tar.bz2
* config/tc-mn10300.c (tc_gen_reloc): Don't emit an *ABS*
relocation for differences between symbols in a section other than the one in which the difference is to be placed; apply the relocation instead.
Diffstat (limited to 'gas/config/tc-mn10300.c')
-rw-r--r--gas/config/tc-mn10300.c37
1 files changed, 33 insertions, 4 deletions
diff --git a/gas/config/tc-mn10300.c b/gas/config/tc-mn10300.c
index 6782240..a2acc75 100644
--- a/gas/config/tc-mn10300.c
+++ b/gas/config/tc-mn10300.c
@@ -1824,12 +1824,41 @@ tc_gen_reloc (seg, fixp)
{
as_bad_where (fixp->fx_file, fixp->fx_line,
"Difference of symbols in different sections is not supported");
- return NULL;
}
+ else
+ {
+ char *fixpos = fixp->fx_where + fixp->fx_frag->fr_literal;
+
+ reloc->addend = (S_GET_VALUE (fixp->fx_addsy)
+ - S_GET_VALUE (fixp->fx_subsy) + fixp->fx_offset);
+
+ switch (fixp->fx_r_type)
+ {
+ case BFD_RELOC_8:
+ md_number_to_chars (fixpos, reloc->addend, 1);
+ break;
+
+ case BFD_RELOC_16:
+ md_number_to_chars (fixpos, reloc->addend, 2);
+ break;
- reloc->sym_ptr_ptr = (asymbol **) &bfd_abs_symbol;
- reloc->addend = (S_GET_VALUE (fixp->fx_addsy)
- - S_GET_VALUE (fixp->fx_subsy) + fixp->fx_offset);
+ case BFD_RELOC_24:
+ md_number_to_chars (fixpos, reloc->addend, 3);
+ break;
+
+ case BFD_RELOC_32:
+ md_number_to_chars (fixpos, reloc->addend, 4);
+ break;
+
+ default:
+ reloc->sym_ptr_ptr = (asymbol **) &bfd_abs_symbol;
+ return reloc;
+ }
+ }
+
+ free (reloc->sym_ptr_ptr);
+ free (reloc);
+ return NULL;
}
else
{