public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Reloc overflowing on SPARC 64-bit
@ 2005-01-04 16:28 Eric Botcazou
  2005-01-04 23:08 ` Alan Modra
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Botcazou @ 2005-01-04 16:28 UTC (permalink / raw)
  To: Alan Modra; +Cc: binutils

[-- Attachment #1: Type: text/plain, Size: 1809 bytes --]

Hi Alan,

As part of a big patch you commited in November 2002, there was

	* elf64-sparc.c (sparc64_elf_relocate_section): Ignore overflows
	from discarded relocs.

However, the entry is slightly misleading because it doesn't describe the 
whole change, which is:

Index: elf64-sparc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-sparc.c,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -r1.62 -r1.63
--- elf64-sparc.c	11 Nov 2002 23:42:29 -0000	1.62
+++ elf64-sparc.c	12 Nov 2002 06:21:05 -0000	1.63
@@ -2584,11 +2584,10 @@
 	    /* 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.  */
+	       overflows for discarded entries.  */
 	    if (r_type == R_SPARC_32
-		&& (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)


As you can see, the patch also fiddled with STABS support.  Of course we don't 
really care since nobody uses STABS on SPARC 64-bit, but the GCC testsuite 
contains many debug testcases that are compiled with various -gstabs* 
options.  This leads to gazillions of failures in the testsuite with GNU ld, 
while it is clean with Sun ld (for the reason stated in the comment).

So I'd like to put back the code you lifted, so as to revert to the 2.14 
behaviour.


2005-01-04  Eric Botcazou  <ebotcazou@libertysurf.fr>

	* elf64-sparc.c (sparc64_elf_relocate_section): Ignore overflows
	from STABS debugging sections again.


-- 
Eric Botcazou

[-- Attachment #2: bfd_sparc64_stabs.diff --]
[-- Type: text/x-diff, Size: 1117 bytes --]

Index: elf64-sparc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-sparc.c,v
retrieving revision 1.82.6.2
diff -u -p -r1.82.6.2 elf64-sparc.c
--- elf64-sparc.c	16 Apr 2004 03:41:35 -0000	1.82.6.2
+++ elf64-sparc.c	4 Jan 2005 15:44:10 -0000
@@ -2635,10 +2635,14 @@ sparc64_elf_relocate_section (output_bfd
 	    /* 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 for discarded entries.  */
+	       overflows in this case and also for discarded entries.  */
 	    if ((r_type == R_SPARC_32 || r_type == R_SPARC_DISP32)
-		&& _bfd_elf_section_offset (output_bfd, info, input_section,
-					    rel->r_offset) == (bfd_vma) -1)
+		&& (((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)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Reloc overflowing on SPARC 64-bit
  2005-01-04 16:28 [PATCH] Reloc overflowing on SPARC 64-bit Eric Botcazou
@ 2005-01-04 23:08 ` Alan Modra
  2005-01-05  5:19   ` Eric Botcazou
  0 siblings, 1 reply; 4+ messages in thread
From: Alan Modra @ 2005-01-04 23:08 UTC (permalink / raw)
  To: Eric Botcazou; +Cc: binutils

On Tue, Jan 04, 2005 at 05:25:18PM +0100, Eric Botcazou wrote:
> As part of a big patch you commited in November 2002, there was
[snip]
> So I'd like to put back the code you lifted, so as to revert to the 2.14 
> behaviour.

Please go ahead.  I don't know why I removed the stabs code.  Probably
happened by accident.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Reloc overflowing on SPARC 64-bit
  2005-01-04 23:08 ` Alan Modra
@ 2005-01-05  5:19   ` Eric Botcazou
  2005-01-05 15:05     ` Daniel Jacobowitz
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Botcazou @ 2005-01-05  5:19 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: Alan Modra, binutils

> Please go ahead.  I don't know why I removed the stabs code.  Probably
> happened by accident.

Thanks!

Daniel, given that I already backported a few fixes after the 2.15 release, 
may I put this one on the 2.15 branch as well?

-- 
Eric Botcazou

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Reloc overflowing on SPARC 64-bit
  2005-01-05  5:19   ` Eric Botcazou
@ 2005-01-05 15:05     ` Daniel Jacobowitz
  0 siblings, 0 replies; 4+ messages in thread
From: Daniel Jacobowitz @ 2005-01-05 15:05 UTC (permalink / raw)
  To: Eric Botcazou; +Cc: Alan Modra, binutils

On Wed, Jan 05, 2005 at 06:18:52AM +0100, Eric Botcazou wrote:
> > Please go ahead.  I don't know why I removed the stabs code.  Probably
> > happened by accident.
> 
> Thanks!
> 
> Daniel, given that I already backported a few fixes after the 2.15 release, 
> may I put this one on the 2.15 branch as well?

I suppose you might as well :-)  Go ahead.

-- 
Daniel Jacobowitz

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-01-05 15:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-04 16:28 [PATCH] Reloc overflowing on SPARC 64-bit Eric Botcazou
2005-01-04 23:08 ` Alan Modra
2005-01-05  5:19   ` Eric Botcazou
2005-01-05 15:05     ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).