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]

[patch] m32r fix_adjustable is wrong.


I noticed this mistake while working on another problem.  Ports
which use the cgen assembler do not carry a valid relocation type
in the fx structure.  It needs to be looked up.  This patch
adds code to do that in m32r_fix_adjustable.  Ok?

2000-03-09  Catherine Moore  <clm@cygnus.com>

	* config/tc-m32r.c (m32r_fix_adjustable):  Look up the
	relocation type based on the entry in the fixup structure.

Index: tc-m32r.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-m32r.c,v
retrieving revision 1.9
diff -p -r1.9 tc-m32r.c
*** tc-m32r.c	2000/03/07 00:06:52	1.9
--- tc-m32r.c	2000/03/09 21:46:36
*************** m32r_fix_adjustable (fixP)
*** 1887,1892 ****
--- 1887,1904 ----
     fixS *fixP;
  {
  
+   bfd_reloc_code_real_type reloc_type;
+  
+   if ((int) fixP->fx_r_type >= (int) BFD_RELOC_UNUSED)
+     {
+       const CGEN_INSN *insn = NULL;
+       int opindex = (int) fixP->fx_r_type - (int) BFD_RELOC_UNUSED;
+       const CGEN_OPERAND *operand = cgen_operand_lookup_by_num(gas_cgen_cpu_desc, opindex);
+       reloc_type = md_cgen_lookup_reloc (insn, operand, fixP);
+     }
+   else
+     reloc_type = fixP->fx_r_type;
+ 
    if (fixP->fx_addsy == NULL)
      return 1;
    
*************** m32r_fix_adjustable (fixP)
*** 1897,1904 ****
      return 0;
    
    /* We need the symbol name for the VTABLE entries */
!   if (fixP->fx_r_type == BFD_RELOC_VTABLE_INHERIT
!       || fixP->fx_r_type == BFD_RELOC_VTABLE_ENTRY)
      return 0;
  
    return 1;
--- 1909,1916 ----
      return 0;
    
    /* We need the symbol name for the VTABLE entries */
!   if (reloc_type == BFD_RELOC_VTABLE_INHERIT
!       || reloc_type == BFD_RELOC_VTABLE_ENTRY)
      return 0;
  
    return 1;

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