Re: _syscall2 in PIC code on ix86

From: H. Peter Anvin (hpa@transmeta.com)
Date: Fri Jan 14 2000 - 15:32:17 EST


Followup to: <Pine.LNX.4.10.10001140916500.1983-100000@mullet.itr.unisa.edu.au>
By author: Alan Modra <alan@SPRI.Levels.UniSA.Edu.Au>
In newsgroup: linux.dev.kernel
>
> On Thu, 13 Jan 2000, Keith Owens wrote:
>
> > Has anybody succeeded in using _syscall2 in code compiled with -fPIC on
> > ix86? I'm trying to convert modutils to a shared library and the
>
> If you want to use the standard syscall macros, then you're out of luck,
> I'm afraid. %ebx is a reserved register in x86 PIC code, and all syscalls
> (except for syscall0) use ebx. Have a look at the definition of _syscall6
> for a way to code your own syscall macros that work with PIC.
>

We probably should add a set of macros that include PIC support
(_syscallX_pic)... it seems to me the obvious way to deal with this
seems to push/pop %ebx around the syscall.

      -hpa

-- 
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
"Unix gives you enough rope to shoot yourself in the foot."

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Jan 15 2000 - 21:00:25 EST