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]
Other format: [Raw text]

Re: R_SPARC_RELATIVE vs R_SPARC_UA32 & unaligned unwind tables - again


On Tue, Dec 18, 2001 at 10:01:48PM -0500, DJ Delorie wrote:
> 
> Right, I found that bug.  We started out using R_SPARC_RELATIVE for
> R_SPARC_32.  We later used it for R_SPARC_UA32 also, but that caused
> aborts in ld.so, so we took it out.  However, now it seems (to me at
> least) that something still needs to be done about those relocs.  Ian
> disagrees, and I'm going to debug it some more, but that's what I'm
> seeing right now...

Making a wild guess at the problem, and solution...

Index: elf32-sparc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-sparc.c,v
retrieving revision 1.34
diff -u -p -r1.34 elf32-sparc.c
--- elf32-sparc.c	2001/12/17 00:52:35	1.34
+++ elf32-sparc.c	2001/12/19 03:14:58
@@ -1530,6 +1530,13 @@ elf32_sparc_relocate_section (output_bfd
 			      bfd_set_error (bfd_error_bad_value);
 			      return false;
 			    }
+
+			  /* We are turning this relocation into one
+			     against a section symbol, so subtract out
+			     the output section's address but not the
+			     offset of the input section in the output
+			     section.  */
+			  relocation -= osec->vma;
 			}
 
 		      outrel.r_info = ELF32_R_INFO (indx, r_type);


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