Re: [PATCH 2/2] MIPS: Use $a0 instead of $v0 for __syscall_error() argument

2012-06-06 Thread Rich Felker
On Wed, Jun 06, 2012 at 03:11:33PM -0700, Kevin Cernekee wrote: > On Wed, Jun 6, 2012 at 12:06 PM, Rich Felker wrote: > > Why would lazy binding ever be used for __syscall_error? Shouldn't > > this be bound at link time via appropriate visibility or otherwise? I > > can't think of any reason you'd

Re: [PATCH 2/2] MIPS: Use $a0 instead of $v0 for __syscall_error() argument

2012-06-06 Thread Kevin Cernekee
On Wed, Jun 6, 2012 at 12:06 PM, Rich Felker wrote: > Why would lazy binding ever be used for __syscall_error? Shouldn't > this be bound at link time via appropriate visibility or otherwise? I > can't think of any reason you'd want it to be possible to override > it... Within libc.so itself, I be

Re: [PATCH 2/2] MIPS: Use $a0 instead of $v0 for __syscall_error() argument

2012-06-06 Thread Rich Felker
On Tue, Jun 05, 2012 at 03:05:20PM -0700, Kevin Cernekee wrote: > $a0 is saved across _dl_runtime_resolve(); $v0 is not. Unfortunately, > __syscall_error() uses $v0 for its argument, not $a0 as is the MIPS ABI > standard. This means that if lazy binding was used for __syscall_error(), > the errno

[PATCH 2/2] MIPS: Use $a0 instead of $v0 for __syscall_error() argument

2012-06-05 Thread Kevin Cernekee
$a0 is saved across _dl_runtime_resolve(); $v0 is not. Unfortunately, __syscall_error() uses $v0 for its argument, not $a0 as is the MIPS ABI standard. This means that if lazy binding was used for __syscall_error(), the errno value in $v0 could get corrupted. The problem can be easily seen in te