🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Henrik Nordstrom Tue, 16 Jan 1996 00:00
Solaris2.5 libc.so broken
#6226
Author: Henrik Nordstrom
Date: Tue, 16 Jan 1996 00:00
175 lines
5476 bytes
We recently upgraded some of our computers to Solaris2.5, and suddenly
our gcc compiled gnudiff couldn't handle directories any more.

Here is a explanation what I beleives is the reason:

A deap investigation shows that Sun has changed the behavior of _init() in 
libc.so in a way that it destroys the functions .mul .umul .div .udiv (which 
by some strange reason they have placed in the data area of libc.so).
Programs compiled with SunSofts SparcCompiler includes a dummy _init function 
that does nothing, but programs kompiled with gcc uses the version from 
libc.so and is therefore affected by this change in libc in a very bad way.

I am pretty shure about this, but please verify.

I have this problem open with SunService here in Sweden, and I am currently
waiting for a response to this from them.

_init(), as compiled into SC3.0.1 compiled programs, or in 2.4 libc.so:
<_init>:        save  %sp, -96, %sp
<_init+4>:      ret 
<_init+8>:      restore 

Solaris 2.5 _init()
<_init>:     save  %sp, -96, %sp
<_init+4>:   call  <__urem64+772>
<_init+8>:   nop 
<_init+12>:  call  <_PROCEDURE_LINKAGE_TABLE_+7152>
<_init+16>:  nop 
<_init+20>:  ret 
<_init+24>:  restore 

And it it probably the call to __urem64+772 that kills the .mul... functions.


.mul... before the call to _init: (or with dummy init)
<..mul>:        smul  %o0, %o1, %o0
<.mul+4>:       rd  %y, %o1
<.mul+8>:       sra  %o0, 0x1f, %o2
<.mul+12>:      retl 
<.mul+16>:      cmp  %o1, %o2
<.mul+20>:      sra  %o0, 0x1f, %o2
<.mul+24>:      retl 
<.mul+28>:      cmp  %o1, %o2
 
<..umul>:       umul  %o0, %o1, %o0
<.umul+4>:      rd  %y, %o1
<.umul+8>:      retl 
<.umul+12>:     tst  %o1
<.umul+16>:     rd  %y, %o1
<.umul+20>:     retl 
<.umul+24>:     tst  %o1
 
<.div>:         sra  %o0, 0x1f, %o2
<.div+4>:       wr  %g0, %o2, %y
<.div+8>:       nop 
<.div+12>:      nop 
<.div+16>:      nop 
<.div+20>:      sdivcc  %o0, %o1, %o0
<.div+24>:      bvs,a   <.div+32>
<.div+28>:      xnor  %o0, %g0, %o0
<.div+32>:      retl 
<.div+36>:      nop 
<.div+40>:      xnor  %o0, %g0, %o0
<.div+44>:      retl 
<.div+48>:      nop 
 
<..udiv>:       mov  %g0, %y
<.udiv+4>:      nop 
<.udiv+8>:      nop 
<.udiv+12>:     retl 
<.udiv+16>:     udiv  %o0, %o1, %o0
<.udiv+20>:     nop 
<.udiv+24>:     retl 
<.udiv+28>:     udiv  %o0, %o1, %o0
 
<.rem>:         sra  %o0, 0x1f, %o4
<..rem+4>:      mov  %o4, %y
<..rem+8>:      nop 
<..rem+12>:     nop 
<..rem+16>:     nop 
<..rem+20>:     sdivcc  %o0, %o1, %o2
<..rem+24>:     bvs,a   <..rem+32>
<..rem+28>:     xnor  %o2, %g0, %o2
<..rem+32>:     smul  %o2, %o1, %o2
<..rem+36>:     retl 
<..rem+40>:     sub  %o0, %o2, %o0
<..rem+44>:     smul  %o2, %o1, %o2
<..rem+48>:     retl 
<..rem+52>:     sub  %o0, %o2, %o0
 
<..urem>:       mov  %g0, %y
<..urem+4>:     nop 
<..urem+8>:     nop 
<..urem+12>:    nop 
<..urem+16>:    udiv  %o0, %o1, %o2
<..urem+20>:    umul  %o2, %o1, %o2
<..urem+24>:    retl 
<..urem+28>:    sub  %o0, %o2, %o0
<..urem+32>:    umul  %o2, %o1, %o2
<..urem+36>:    retl 
<..urem+40>:    sub  %o0, %o2, %o0

.mul... after cal to _init:
<..mul>:        retl 
<.mul+4>:       cmp  %o1, %o2
<.mul+8>:       sra  %o0, 0x1f, %o2
<.mul+12>:      retl 
<.mul+16>:      cmp  %o1, %o2
<.mul+20>:      sra  %o0, 0x1f, %o2
<.mul+24>:      retl 
<.mul+28>:      cmp  %o1, %o2
 
<..umul>:       tst  %o1
<.umul+4>:      rd  %y, %o1
<.umul+8>:      retl 
<.umul+12>:     tst  %o1
<.umul+16>:     rd  %y, %o1
<.umul+20>:     retl 
<.umul+24>:     tst  %o1
 
<.div>:         nop 
<.div+4>:       nop 
<.div+8>:       sdivcc  %o0, %o1, %o0
<.div+12>:      bvs,a   <.div+20>
<.div+16>:      xnor  %o0, %g0, %o0
<.div+20>:      retl 
<.div+24>:      nop 
<.div+28>:      xnor  %o0, %g0, %o0
<.div+32>:      retl 
<.div+36>:      nop 
<.div+40>:      xnor  %o0, %g0, %o0
<.div+44>:      retl 
<.div+48>:      nop 
 
<..udiv>:       retl 
<.udiv+4>:      udiv  %o0, %o1, %o0
<.udiv+8>:      nop 
<.udiv+12>:     retl 
<.udiv+16>:     udiv  %o0, %o1, %o0
<.udiv+20>:     nop 
<.udiv+24>:     retl 
<.udiv+28>:     udiv  %o0, %o1, %o0
 
<.rem>:         nop 
<..rem+4>:      nop 
<..rem+8>:      sdivcc  %o0, %o1, %o2
<..rem+12>:     bvs,a   <..rem+20>
<..rem+16>:     xnor  %o2, %g0, %o2
<..rem+20>:     smul  %o2, %o1, %o2
<..rem+24>:     retl 
<..rem+28>:     sub  %o0, %o2, %o0
<..rem+32>:     smul  %o2, %o1, %o2
<..rem+36>:     retl 
<..rem+40>:     sub  %o0, %o2, %o0
<..rem+44>:     smul  %o2, %o1, %o2
<..rem+48>:     retl 
<..rem+52>:     sub  %o0, %o2, %o0
 
<..urem>:       nop 
<..urem+4>:     udiv  %o0, %o1, %o2
<..urem+8>:     umul  %o2, %o1, %o2
<..urem+12>:    retl 
<..urem+16>:    sub  %o0, %o2, %o0
<..urem+20>:    umul  %o2, %o1, %o2
<..urem+24>:    retl 
<..urem+28>:    sub  %o0, %o2, %o0
<..urem+32>:    umul  %o2, %o1, %o2
<..urem+36>:    retl 
<..urem+40>:    sub  %o0, %o2, %o0

---
Henrik Nordstrvm
University of Skoevde
Sweden
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads