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

Reinstate bypass for 32-bit relocs overflow on SPARC


Hi,

It was presumably ditched when DaveM merged the 32-bit and 64-bit code.
We need it on Solaris because 64-bit GCC has STABS enabled on this platform 
and this yields gazillions of failures in the testsuite otherwise.

Tested on SPARC/Solaris 10 and SPARC64/Solaris 9.  GCC 4.1pre was also 
bootstrapped/regtested.  Applied as semi-obvious. :-)


2006-01-31  Eric Botcazou  <ebotcazou@libertysurf.fr>

	* elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Reinstate bypass
	for 32-bit relocs overflow.


-- 
Eric Botcazou
Index: elfxx-sparc.c
===================================================================
RCS file: /cvs/src/src/bfd/elfxx-sparc.c,v
retrieving revision 1.15
diff -u -p -r1.15 elfxx-sparc.c
--- elfxx-sparc.c	25 Oct 2005 16:19:08 -0000	1.15
+++ elfxx-sparc.c	31 Jan 2006 16:49:00 -0000
@@ -3357,6 +3357,21 @@ _bfd_sparc_elf_relocate_section (bfd *ou
 	      {
 		const char *name;
 
+		/* The Solaris native linker silently disregards overflows. 
+		   We don't, but this breaks stabs debugging info, whose
+		   relocations are only 32-bits wide.  Ignore overflows in
+		   this case and also for discarded entries.  */
+		if ((r_type == R_SPARC_32 || r_type == R_SPARC_DISP32)
+		    && (((input_section->flags & SEC_DEBUGGING) != 0
+			 && strcmp (bfd_section_name (input_bfd,
+						      input_section),
+				    ".stab") == 0)
+			|| _bfd_elf_section_offset (output_bfd, info,
+						    input_section,
+						    rel->r_offset)
+			     == (bfd_vma)-1))
+		  break;
+
 		if (h != NULL)
 		  name = NULL;
 		else

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