[PATCH] mips/o32: fix internal_syscall5/6/7
Aurelien Jarno
aurelien@aurel32.net
Sat Aug 19 12:45:00 GMT 2017
On 2017-08-18 23:27, Maciej W. Rozycki wrote:
> On Fri, 18 Aug 2017, Aurelien Jarno wrote:
>
> > > > I am using GCC 6, so if the fix went in GCC 7, that's normal the issue
> > > > is present.
> > >
> > > OK then; you can use the workaround I suggested to verify MIPS16
> > > compilation then.
> >
> > The workaround didn't work.
>
> Hmm, that means there's something wrong with binutils which needs fixing.
> Can you please send me the failing .s file and the command line used to
> assemble it (from `gcc -v')?
Please find that attached.
> > > > That's an interesting idea. If we use a different stub depending on the
> > > > number of arguments, we can actually pass the syscall number last, which
> > > > is probably more readable. Could also be used for mips16 in all cases?
> > >
> > > MIPS16 wrappers do that already, which is also why there is an individual
> > > one for each syscall argument count.
> >
> > Please find below a new patch implementing that. It started to be
> > complicated to get the MIPS16 related defines used to build the
> > equivalent code through GCC to work, so I decided to also implement
> > __libc_do_syscall0 to __libc_do_syscall4 in libc-do-syscall.S. I looked
> > at the original code generated by GCC, it's very similar to what I used,
> > sometimes just a bit longer (sometimes GCC saves the syscall number to
> > the stack to reload it just after).
>
> The MIPS16 wrappers were split into individual files so that only ones
> that are actually used by `ld.so' are pulled. I think it would be good if
> we preserved that. I'll see if I can experiment with keeping the original
> MIPS16 0-3 wrappers.
For what I have seen, ld.so already uses syscalls with 1 to 4 arguments.
It doesn't use any syscall without argument though. So it's only 4
instructions overhead.
Aurelien
--
Aurelien Jarno GPG: 4096R/1DDD8C9B
aurelien@aurel32.net http://www.aurel32.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dl-tunables.cmd.gz
Type: application/gzip
Size: 2187 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20170819/918b6f2b/attachment.gz>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dl-tunables.s.gz
Type: application/gzip
Size: 27046 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20170819/918b6f2b/attachment-0001.gz>
More information about the Libc-alpha
mailing list