NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: toolchain/51121: sparc64 can't build perl



The following reply was made to PR toolchain/51121; it has been noted by GNATS.

From: Martin Husemann <martin%duskware.de@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: toolchain/51121: sparc64  can't build perl
Date: Tue, 10 May 2016 12:15:08 +0200

 The jump to NULL happens here:
 
   50:   0a 68 00 04     bcs  %xcc, 60 <.text.exit+0x60>
   54:   82 10 20 00     clr  %g1
   58:   10 68 00 08     b  %xcc, 78 <.text.exit+0x78>
   5c:   03 00 00 00     sethi  %hi(0), %g1
                         5c: R_SPARC_GOT22       __deregister_frame_info
   60:   9f c0 40 00     call  %g1
   64:   ba 07 60 08     add  %i5, 8, %i5
 
 (from /usr/lib/crtbegin.o), which at runtime looks like:
 
 0x34bdcc        cmp  %i5, %i4
 0x34bdd0        bcs  %xcc, 0x34bde0
 0x34bdd4        clr  %g1
 0x34bdd8        b  %xcc, 0x34bdf8
 0x34bddc        sethi  %hi(0xe000), %g1
 0x34bde0        call  %g1
 0x34bde4        add  %i5, 8, %i5
 
 and in this case it %xcc has carry set (which means the DTOR list has been
 done) and it branches straight to .text.exit+0x60, with %g1 = 0.
 
 gcc output looks like this:
 
 .LLBB5:
         .loc 1 125 0
         cmp     %i5, %i4
         blu,pt  %xcc, .LL17
          mov    0, %g1
 .LLBE5:
         .loc 1 131 0
         ba,pt   %xcc, .LL22
          sethi  %hi(deregister_frame_info), %g1
 .LLVL5:
 .LL20:
 .LL17:
 .LLBB6:
         .loc 1 126 0
         call    %g1, 0
          add    %i5, 8, %i5
 
 
 so if the branch at the end of the dtor list to .LL17 is taken, %g1 will be
 cleared and we necessarily die jumping to NULL.
 
 Martin
 


Home | Main Index | Thread Index | Old Index