This is the mail archive of the
libc-ports@sources.redhat.com
mailing list for the libc-ports project.
Re: MIPS: PSEUDO define for n32 abi is broken for non-pic
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Chandrakala Chavva <cchavva at caviumnetworks dot com>
- Cc: libc-ports at sourceware dot org
- Date: Thu, 12 Aug 2010 22:43:07 +0000 (UTC)
- Subject: Re: MIPS: PSEUDO define for n32 abi is broken for non-pic
- References: <1281132670.2787.156.camel@chandra-amd.caveonetworks.com>
On Fri, 6 Aug 2010, Chandrakala Chavva wrote:
> The toolchain by default generates non-pic executable for n32 ABI.
>
> When compiling glibc the PSEUDO define generates the following code:
>
> j __syscall_error
> li v0, SYSCALL_NAME
> syscall
>
> SYSCALL_NAME is loaded in jump delay slot, which overwrites the errno
> returned by syscall.
>
> Please let me know is the attached patch okay to apply, ran glibc
> testsuite with the patch.
>
> Thanks
> Chandra
>
> ports/ChangeLog.mips:
>
> * sysdeps/unix/mips/mips64/n32/sysdep.h (PSEUDO): Add 'nop' in the
> delay slot for calling __syscall_error.
Could you clarify why you are changing just this particular jump to have a
nop after it? As far as I can see, each of the three ABIs has such jumps
for both the PIC and non-PIC cases, and there is only one such nop present
(for the o32 non-PIC case); what is it that makes the other four cases,
with no existing nop and where your patch does not add a nop, safe?
--
Joseph S. Myers
joseph@codesourcery.com