patch for m32r (relocations)

Donald Lindsay dlindsay@cygnus.com
Thu Feb 10 16:53:00 GMT 2000


The following fixes a problem with the m32r, whereby the reloc for a
struct member was marked as being relative to the struct, but had an
offset which was instead relative to the front of the dsect. This change
causes the reloc to be restamped as dsect-relative (with the offset not
being changed). Hence the reloc becomes correct.

Sadly, the patch doesn't fix weak symbols, who still have the bug.

It's already in devo. Approved by Mike Meissner.


Index: tc-m32r.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gas/config/tc-m32r.c,v
retrieving revision 1.74
diff -p -r1.74 tc-m32r.c
*** tc-m32r.c	1999/10/05 00:29:59	1.74
--- tc-m32r.c	2000/02/10 20:01:50
*************** m32r_elf_section_change_hook ()
*** 1875,1880 ****
--- 1875,1883 ----
      (void) m32r_fill_insn (0);
  }
  
+ /* Return true if can adjust the reloc to be relative to its section
+    (such as .data) instead of relative to some symbol. */
+ 
  boolean
  m32r_fix_adjustable (fixP)
     fixS *fixP;
*************** m32r_fix_adjustable (fixP)
*** 1882,1891 ****
  
    if (fixP->fx_addsy == NULL)
      return 1;
!   
!   /* Prevent all adjustments to global symbols. */
!   if (S_IS_EXTERN (fixP->fx_addsy))
!     return 0;
    if (S_IS_WEAK (fixP->fx_addsy))
      return 0;
    
--- 1885,1893 ----
  
    if (fixP->fx_addsy == NULL)
      return 1;
! 
!   /* don't yet know the address of a weak symbol, 
!      so it isn't ready to be adjusted. */
    if (S_IS_WEAK (fixP->fx_addsy))
      return 0;
    




More information about the Binutils mailing list