aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2003-06-03 16:24:06 +0000
committerNick Clifton <nickc@redhat.com>2003-06-03 16:24:06 +0000
commite30ddb24b30b2c4e6d1d7d44c7d1bc18da6c4aae (patch)
tree06d7fefe31049cd7b24aea7730c4a9b9e5ac3117 /gas
parent9aab5aa3a012943e4edacebcdf68a0da7835bce8 (diff)
downloadgdb-e30ddb24b30b2c4e6d1d7d44c7d1bc18da6c4aae.zip
gdb-e30ddb24b30b2c4e6d1d7d44c7d1bc18da6c4aae.tar.gz
gdb-e30ddb24b30b2c4e6d1d7d44c7d1bc18da6c4aae.tar.bz2
Add pc-relative 32-bit reloc to v850 port. Fixes ld-elf/merge test failure.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog6
-rw-r--r--gas/config/tc-v850.c26
2 files changed, 22 insertions, 10 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 0dcedba..8085cd3 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,9 @@
+2003-06-03 Nick Clifton <nickc@redhat.com>
+
+ * tc-v850.c (tc-gen_reloc): Translate BFD_RELOC_32 into
+ BFD_RELOC_32_PCREL if the reloc is pc-relative. Do this
+ before calling bfd_reloc_type_lookup.
+
2003-06-02 Alan Modra <amodra@bigpond.net.au>
* read.c (emit_expr): Set dot_value.
diff --git a/gas/config/tc-v850.c b/gas/config/tc-v850.c
index 59b68e1..81c12fd 100644
--- a/gas/config/tc-v850.c
+++ b/gas/config/tc-v850.c
@@ -2239,6 +2239,22 @@ tc_gen_reloc (seg, fixp)
reloc->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
*reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
+
+ if ( fixp->fx_r_type == BFD_RELOC_VTABLE_ENTRY
+ || fixp->fx_r_type == BFD_RELOC_VTABLE_INHERIT
+ || fixp->fx_r_type == BFD_RELOC_V850_LONGCALL
+ || fixp->fx_r_type == BFD_RELOC_V850_LONGJUMP
+ || fixp->fx_r_type == BFD_RELOC_V850_ALIGN)
+ reloc->addend = fixp->fx_offset;
+ else
+ {
+ if (fixp->fx_r_type == BFD_RELOC_32
+ && fixp->fx_pcrel)
+ fixp->fx_r_type = BFD_RELOC_32_PCREL;
+
+ reloc->addend = fixp->fx_addnumber;
+ }
+
reloc->howto = bfd_reloc_type_lookup (stdoutput, fixp->fx_r_type);
if (reloc->howto == (reloc_howto_type *) NULL)
@@ -2253,16 +2269,6 @@ tc_gen_reloc (seg, fixp)
return NULL;
}
- if (fixp->fx_r_type == BFD_RELOC_VTABLE_ENTRY
- || fixp->fx_r_type == BFD_RELOC_VTABLE_INHERIT)
- reloc->addend = fixp->fx_offset;
- else if ( fixp->fx_r_type == BFD_RELOC_V850_LONGCALL
- || fixp->fx_r_type == BFD_RELOC_V850_LONGJUMP
- || fixp->fx_r_type == BFD_RELOC_V850_ALIGN)
- reloc->addend = fixp->fx_offset;
- else
- reloc->addend = fixp->fx_addnumber;
-
return reloc;
}