This is the mail archive of the libc-ports@sources.redhat.com mailing list for the libc-ports project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: MIPS: PSEUDO define for n32 abi is broken for non-pic


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]