This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[PATCH] Reloc overflowing on SPARC 64-bit
- From: Eric Botcazou <ebotcazou at libertysurf dot fr>
- To: Alan Modra <amodra at bigpond dot net dot au>
- Cc: binutils at sources dot redhat dot com
- Date: Tue, 4 Jan 2005 17:25:18 +0100
- Subject: [PATCH] Reloc overflowing on SPARC 64-bit
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
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)