[parisc-linux] Re: Found the r19 problem!

John David Anglin dave@hiauly1.hia.nrc.ca
Sun, 21 Sep 2003 15:12:39 -0400 (EDT)


> > So use a caller saves register, place it in the clobbers, and let gcc
> > work around the usage (e.g. r4).
> >  
> > > > 	...
> > > > 	(Many insn later)
> > > > 	(stub) (dyncall) -> libpthread.so
> > > > 	-> libc.so
> > > 
> > > The above is an indirect call. r19 should be restored after the call
> > > if it is used after the call.
> > 
> > It is, but only after the asm(...) that lists r19 in the clobber.
> > 
> 
> Sorry "It is" should read "It is used" :)

Well that's why the restore is deleted.  So, the clobber must go
and r19 must be preserved across the asm(...).  As I said, you can't
clobber r19 when generating pic code.  It's treated as fixed register,
so clobbering it can lead to undefined behavior.

If the syscall used r19, it could include a use of r19 in the asm.
This would ensure the restore occurs before the syscall.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)