This is the mail archive of the
libc-ports@sources.redhat.com
mailing list for the libc-ports project.
MIPS: PSEUDO define for n32 abi is broken for non-pic
- From: Chandrakala Chavva <cchavva at caviumnetworks dot com>
- To: libc-ports at sourceware dot org
- Date: Fri, 06 Aug 2010 15:11:10 -0700
- Subject: MIPS: PSEUDO define for n32 abi is broken for non-pic
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.
Index: ports/sysdeps/unix/mips/mips64/n32/sysdep.h
===================================================================
--- ports/sysdeps/unix/mips/mips64/n32/sysdep.h (revision 50239)
+++ ports/sysdeps/unix/mips/mips64/n32/sysdep.h (working copy)
@@ -45,6 +45,7 @@ L(syse1):
.set noreorder; \
.align 2; \
99: j __syscall_error; \
+ nop; \
ENTRY(name) \
.set noreorder; \
li v0, SYS_ify(syscall_name); \