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

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


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

Broken cancelable syscalls in librt w/ linuxthreads


When building with linuxthreads the functions __librt_enable_asynccancel
and __librt_disable_asynccancel are just aliases to the libc variants,
thus part of libc instead of librt.  The ia64 syscall stubs don't expect
that and don't save gp around these calls.  That hasn't been a problem
before, because librt didn't include any cancelable functions that were
implemented as direct syscalls.

Andreas.

2004-08-20  Andreas Schwab  <schwab@suse.de>

	* sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Save gp
	around CENABLE/CDISABLE calls.

--- linuxthreads/sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h.~1.9.~	2003-07-08 12:00:51.000000000 +0200
+++ linuxthreads/sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h	2004-08-20 15:03:54.831834009 +0200
@@ -45,13 +45,15 @@ ENTRY (name)								      \
 __GC_##name:								      \
 .Lpseudo_cancel:							      \
      .prologue;								      \
-     .regstk args, 5, args, 0;						      \
+     .regstk args, 6, args, 0;						      \
      .save ar.pfs, loc0;						      \
-     alloc loc0 = ar.pfs, args, 5, args, 0;				      \
+     alloc loc0 = ar.pfs, args, 6, args, 0;				      \
      .save rp, loc1;							      \
-     mov loc1 = rp;;							      \
+     mov loc1 = rp;							      \
+     mov loc5 = gp;;							      \
      .body;								      \
      CENABLE;;								      \
+     mov gp = loc5;							      \
      mov loc2 = r8;							      \
      COPY_ARGS_##args							      \
      mov r15 = SYS_ify(syscall_name);					      \
@@ -60,6 +62,7 @@ __GC_##name:								      \
      mov loc4 = r10;							      \
      mov out0 = loc2;							      \
      CDISABLE;;								      \
+     mov gp = loc5;							      \
      cmp.eq p6,p0=-1,loc4;						      \
 (p6) br.cond.spnt.few __syscall_error_##args;				      \
      mov r8 = loc3;							      \
@@ -76,14 +79,13 @@ __GC_##name:								      \
      .size __syscall_error_##args, 64;					      \
 __syscall_error_##args:							      \
      .prologue;								      \
-     .regstk args, 5, args, 0;						      \
+     .regstk args, 6, args, 0;						      \
      .save ar.pfs, loc0;						      \
      .save rp, loc1;							      \
      .body;								      \
-     mov loc4 = r1;;							      \
      br.call.sptk.many b0 = __errno_location;;				      \
      st4 [r8] = loc3;							      \
-     mov r1 = loc4;							      \
+     mov gp = loc5;							      \
      mov rp = loc1;							      \
      mov r8 = -1;							      \
      mov ar.pfs = loc0

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


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