Re: _syscall2 in PIC code on ix86

From: Alan Modra (alan@SPRI.Levels.UniSA.Edu.Au)
Date: Sat Jan 15 2000 - 05:05:12 EST


On 14 Jan 2000, H. Peter Anvin wrote:

> 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.

Yup. Hence my comment about looking at _syscall6 which does the same for
%ebp. It's more than just a bit tricky to make a PIC version of _syscall6
though.

-
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:26 EST