From e30ddb24b30b2c4e6d1d7d44c7d1bc18da6c4aae Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Tue, 3 Jun 2003 16:24:06 +0000 Subject: Add pc-relative 32-bit reloc to v850 port. Fixes ld-elf/merge test failure. --- gas/config/tc-v850.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'gas/config') 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; } -- cgit v1.1