Subject: Re: nbgroff chokes on -current sparc64
To: David Brownlee <abs@netbsd.org>
From: Michael Rauch <mrauch@netbsd.org>
List: tech-toolchain
Date: 11/22/2001 11:27:24
--jq0ap7NbKX2Kqbes
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Thu, Nov 22, 2001 at 09:56:06AM +0000, David Brownlee wrote:
> On Thu, 22 Nov 2001, Michael Rauch wrote:
> 
> > On Thu, Nov 22, 2001 at 12:07:04AM +0000, David Brownlee wrote:
> > > /usr/lib/libstdc++.so.4: Undefined symbol "" (reloc type = 54, symnum = 18)
> > >[...]
> > just to make sure it isn't the sparc64 instance of misc/13927 (although
> > this libstdc++.so problem seems to be older):
> >
> > Can you please run
> >  objdump -R /usr/lib/libstdc++.so.4
> > and look for occurrences of R_SPARC_UAdd, where dd are two digits
> > (presumably 64)?
> 
> 	There are a few... :)
> 
> % objdump -R /usr/lib/libstdc++.so.4|grep R_SPARC_UA
> 000000000014aa9c R_SPARC_UA64      .gcc_except_table+0x0000000000151ed0
> [...]

That looks just like misc/13927. 
I've attached a patch (applies to 
gnusrc/gnu/dist/toolchain/bfd/elf64_sparc.c) that should solve at least 
this problem. But the more I look at this code, the more it looks like 
there might be other instances still hidden. 
Can you please try the patch and report back whether it fixes the problem?
(The safest way is to probably start building from scratch again so there 
are no traces of it left anywhere.)
If it does, I'll try to talk with the binutils maintainers if there's a 
more systematic way to find this kind of bugs. 


Michael

--jq0ap7NbKX2Kqbes
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="sparc64_bfd.patch"

Index: elf64-sparc.c
===================================================================
RCS file: /cvsroot/gnusrc/gnu/dist/toolchain/bfd/elf64-sparc.c,v
retrieving revision 1.2
diff -u -r1.2 elf64-sparc.c
--- elf64-sparc.c	2001/08/14 11:37:10	1.2
+++ elf64-sparc.c	2001/11/22 10:14:23
@@ -2228,7 +2228,7 @@
 		  }
 		else
 		  {
-		    if (r_type == R_SPARC_64)
+		    if ( (r_type == R_SPARC_64) || (r_type == R_SPARC_UA64) )
 		      {
 			outrel.r_info = ELF64_R_INFO (0, R_SPARC_RELATIVE);
 			outrel.r_addend = relocation + rel->r_addend;

--jq0ap7NbKX2Kqbes--