This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

v850 bfd patch


Hi Guys,

  I am going to apply the patch below, since it appears to be fix a
  problem reported by one of our customers.  I am not 100% sure that
  this fix is correct, (hence the inclusion of an example), but I am
  having problems building the v850 toolchain at the moment, so I
  cannot test it thoroughly.

Cheers
	Nick

2001-02-04  Nick Clifton  <nickc@redhat.com>

	* elf32-v850.c (v850_elf_reloc): Do not convert reloc addend to PC
	rel, it will be handled later on.

Index: bfd/elf32-v850.c
===================================================================
RCS file: /cvs/src//src/bfd/elf32-v850.c,v
retrieving revision 1.8
diff -p -r1.8 elf32-v850.c
*** elf32-v850.c	2001/01/23 11:45:53	1.8
--- elf32-v850.c	2001/02/04 22:11:30
*************** v850_elf_reloc (abfd, reloc, symbol, dat
*** 1300,1305 ****
--- 1300,1320 ----
    relocation += symbol->section->output_offset;
    relocation += reloc->addend;
  
+ #if 0 /* Since this reloc is going to be processed later on, we should
+ 	 not make it pc-relative here.  To test this, try assembling and
+ 	 linking this program:
+ 
+ 	 	.text
+ 		.globl _start
+ 		nop
+ 	_start:         
+         	jr foo
+ 
+ 	        .section ".foo","ax"
+ 		nop
+ 	foo:
+         	nop
+       */
    if (reloc->howto->pc_relative == true)
      {
        /* Here the variable relocation holds the final address of the
*************** v850_elf_reloc (abfd, reloc, symbol, dat
*** 1309,1315 ****
        /* Deal with pcrel_offset */
        relocation -= reloc->address;
      }
! 
    reloc->addend = relocation;
    return bfd_reloc_ok;
  }
--- 1324,1330 ----
        /* Deal with pcrel_offset */
        relocation -= reloc->address;
      }
! #endif
    reloc->addend = relocation;
    return bfd_reloc_ok;
  }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]