aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-m32r.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2005-07-20 11:35:03 +0000
committerNick Clifton <nickc@redhat.com>2005-07-20 11:35:03 +0000
commit157e7bd196cc83495a38f37b1528d2505d554b2e (patch)
tree4c78dde5569e0909da71fd5c2970c505d6a7bf4c /gas/config/tc-m32r.c
parent6c76e4a1c9743ba5ea19e5b11f71e1a39e73d291 (diff)
downloadgdb-157e7bd196cc83495a38f37b1528d2505d554b2e.zip
gdb-157e7bd196cc83495a38f37b1528d2505d554b2e.tar.gz
gdb-157e7bd196cc83495a38f37b1528d2505d554b2e.tar.bz2
Add support for a 32bit PC relative reloc
Diffstat (limited to 'gas/config/tc-m32r.c')
-rw-r--r--gas/config/tc-m32r.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/gas/config/tc-m32r.c b/gas/config/tc-m32r.c
index 5f17337..978f373 100644
--- a/gas/config/tc-m32r.c
+++ b/gas/config/tc-m32r.c
@@ -2258,6 +2258,17 @@ tc_gen_reloc (asection * section, fixS * fixP)
reloc->sym_ptr_ptr = 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_pcrel)
+ {
+ if (fixP->fx_r_type == BFD_RELOC_32)
+ fixP->fx_r_type = BFD_RELOC_32_PCREL;
+ else if (fixP->fx_r_type == BFD_RELOC_16)
+ {
+ fixP->fx_r_type = BFD_RELOC_16_PCREL;
+ bfd_set_error (bfd_error_bad_value);
+ }
+ }
code = fixP->fx_r_type;
if (pic_code)
@@ -2327,7 +2338,8 @@ printf(" => %s\n",reloc->howto->name);
/* Use fx_offset for these cases. */
if ( fixP->fx_r_type == BFD_RELOC_VTABLE_ENTRY
- || fixP->fx_r_type == BFD_RELOC_VTABLE_INHERIT)
+ || fixP->fx_r_type == BFD_RELOC_VTABLE_INHERIT
+ || fixP->fx_r_type == BFD_RELOC_32_PCREL)
reloc->addend = fixP->fx_offset;
else if ((!pic_code
&& code != BFD_RELOC_M32R_26_PLTREL)