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]

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);						      \

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