This is the mail archive of the binutils@sourceware.cygnus.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]

Mcore fixes checked in


Hi Guys,

  This is just to let you know that I have checked in the following
  patches to fix the mcore-pe toolchain's generation of RVA relocs.

Cheers
	Nick


1999-11-18  Nick Clifton  <nickc@cygnus.com>

	* coff-mcore.c (coff_mcore_rtype_to_howto): Special case handling
	for RVA relocs.
	(coff_mcore_relocate_section): Initialise addend to 0.
	Special case processing of RVA reloc.

Index: bfd/coff-mcore.c
===================================================================
RCS file: /cvs/binutils/binutils/bfd/coff-mcore.c,v
retrieving revision 1.8
diff -p -r1.8 coff-mcore.c
*** coff-mcore.c	1999/08/19 13:04:45	1.8
--- coff-mcore.c	1999/11/18 18:36:05
*************** coff_mcore_rtype_to_howto (abfd, sec, re
*** 339,345 ****
    if (rel->r_type == IMAGE_REL_MCORE_RVA)
      * addendp -= pe_data (sec->output_section->owner)->pe_opthdr.ImageBase;
    
!   if (howto->pc_relative)
      {
        * addendp = sec->vma - 2; /* XXX guess - is this right ? */
        
--- 339,345 ----
    if (rel->r_type == IMAGE_REL_MCORE_RVA)
      * addendp -= pe_data (sec->output_section->owner)->pe_opthdr.ImageBase;
    
!   else if (howto->pc_relative)
      {
        * addendp = sec->vma - 2; /* XXX guess - is this right ? */
        
*************** coff_mcore_relocate_section (output_bfd,
*** 440,445 ****
--- 440,447 ----
  	  sym = syms + symndx;
  	}
  
+       addend = 0;
+       
        /* Get the howto and initialise the addend.  */
        howto = bfd_coff_rtype_to_howto (input_bfd, input_section, rel, h,
  				       sym, & addend);
*************** coff_mcore_relocate_section (output_bfd,
*** 527,533 ****
--- 529,543 ----
  	case IMAGE_REL_MCORE_PCREL_JSR_IMM11BY2:
  	case IMAGE_REL_MCORE_ADDR32:
  	case IMAGE_REL_MCORE_RVA:
+ 	  /* XXX fixme - shouldn't this be like the code for the RVA reloc ? */
  	  rstat = _bfd_relocate_contents (howto, input_bfd, val, loc);
+ 	  break;
+ 	  
+ 	case IMAGE_REL_MCORE_RVA:
+ 	  rstat = _bfd_final_link_relocate
+ 	    (howto, input_bfd,
+ 	     input_section, contents, rel->r_vaddr - input_section->vma,
+ 	     val, addend);
  	  break;
  	}
        

1999-11-18  Nick Clifton  <nickc@cygnus.com>

	* config/tc-mcore.h (TC_FORCE_RELOCATION): Define for Mcore-pe
	target.
	
	* config/tc-mcore.c (tc_gen_reloc): Support generation of RVA
	relocs.
	(mcore_force_relocation): Force relocations to be generated for
	RVA relocs.

Index: gas/config/tc-mcore.c
===================================================================
RCS file: /cvs/binutils/binutils/gas/config/tc-mcore.c,v
retrieving revision 1.11
diff -p -r1.11 tc-mcore.c
*** tc-mcore.c	1999/10/25 16:48:26	1.11
--- tc-mcore.c	1999/11/18 18:37:00
*************** tc_gen_reloc (section, fixp)
*** 2193,2198 ****
--- 2193,2199 ----
      case BFD_RELOC_MCORE_PCREL_IMM8BY4:
      case BFD_RELOC_MCORE_PCREL_IMM11BY2:
      case BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2:
+     case BFD_RELOC_RVA:      
        code = fixp->fx_r_type;
        break;
      
*************** mcore_force_relocation (fix)
*** 2246,2252 ****
       fixS * fix;
  {
    if (   fix->fx_r_type == BFD_RELOC_VTABLE_INHERIT
!       || fix->fx_r_type == BFD_RELOC_VTABLE_ENTRY)
      return 1;
  
    return 0;
--- 2247,2254 ----
       fixS * fix;
  {
    if (   fix->fx_r_type == BFD_RELOC_VTABLE_INHERIT
!       || fix->fx_r_type == BFD_RELOC_VTABLE_ENTRY
!       || fixP->fx_r_type == BFD_RELOC_RVA)
      return 1;
  
    return 0;

Index: gas/config/tc-mcore.h
===================================================================
RCS file: /cvs/binutils/binutils/gas/config/tc-mcore.h,v
retrieving revision 1.4
diff -p -r1.4 tc-mcore.h
*** tc-mcore.h	1999/11/03 18:18:03	1.4
--- tc-mcore.h	1999/11/18 18:37:00
*************** struct mcore_tc_sy
*** 74,79 ****
--- 74,83 ----
  
  #define TC_SYMFIELD_TYPE struct mcore_tc_sy
  
+ # if defined TE_PE
+ #  define TC_FORCE_RELOCATION(x) ((x)->fx_r_type == BFD_RELOC_RVA)
+ # endif
+ 
  #endif /* OBJ_COFF */
  
  

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