about summary refs log tree commit diff
path: root/nptl
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2012-11-26 16:42:38 -0800
committerH.J. Lu <hjl.tools@gmail.com>2012-11-26 16:45:36 -0800
commitc515fb5148f1d81d5f7736825e14c7502c15432a (patch)
treebffe0f355bac8c00df91b12a1feddc768677bc5d /nptl
parent4cf77aa9847aac13bf65c977396b6e8a66337238 (diff)
downloadglibc-c515fb5148f1d81d5f7736825e14c7502c15432a.tar.gz
glibc-c515fb5148f1d81d5f7736825e14c7502c15432a.tar.xz
glibc-c515fb5148f1d81d5f7736825e14c7502c15432a.zip
Cast to __intptr_t before casting pointer to int64
Diffstat (limited to 'nptl')
-rw-r--r--nptl/ChangeLog11
-rw-r--r--nptl/sysdeps/i386/tls.h5
-rw-r--r--nptl/sysdeps/x86_64/tls.h5
-rw-r--r--nptl/unwind.c2
4 files changed, 18 insertions, 5 deletions
diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index 7c8736cac3..a9b00e7c78 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,3 +1,14 @@
+2012-11-26  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* unwind.c (__pthread_unwind): Pass address of unwind_cleanup
+	to THREAD_SETMEM.
+	* sysdeps/i386/tls.h: Include <libc-internal.h>.
+	(THREAD_SETMEM): Use cast_to_integer before casting to uint64_t.
+	(THREAD_SETMEM_NC): Likewise.
+	* sysdeps/x86_64/tls.h: Include <libc-internal.h>.
+	(THREAD_SETMEM): Use cast_to_integer before casting to uint64_t.
+	(THREAD_SETMEM_NC): Likewise.
+
 2012-11-21  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/sem_post.c (__old_sem_post): Cast result
diff --git a/nptl/sysdeps/i386/tls.h b/nptl/sysdeps/i386/tls.h
index eb1ca312f9..90c7a534bf 100644
--- a/nptl/sysdeps/i386/tls.h
+++ b/nptl/sysdeps/i386/tls.h
@@ -26,6 +26,7 @@
 # include <stdint.h>
 # include <stdlib.h>
 # include <sysdep.h>
+# include <libc-internal.h>
 # include <kernel-features.h>
 
 
@@ -343,7 +344,7 @@ union user_desc_init
 									      \
 	 asm volatile ("movl %%eax,%%gs:%P1\n\t"			      \
 		       "movl %%edx,%%gs:%P2" :				      \
-		       : "A" ((uint64_t) (value)),			      \
+		       : "A" ((uint64_t) cast_to_integer (value)),	      \
 			 "i" (offsetof (struct pthread, member)),	      \
 			 "i" (offsetof (struct pthread, member) + 4));	      \
        }})
@@ -370,7 +371,7 @@ union user_desc_init
 									      \
 	 asm volatile ("movl %%eax,%%gs:%P1(,%2,8)\n\t"			      \
 		       "movl %%edx,%%gs:4+%P1(,%2,8)" :			      \
-		       : "A" ((uint64_t) (value)),			      \
+		       : "A" ((uint64_t) cast_to_integer (value)),	      \
 			 "i" (offsetof (struct pthread, member)),	      \
 			 "r" (idx));					      \
        }})
diff --git a/nptl/sysdeps/x86_64/tls.h b/nptl/sysdeps/x86_64/tls.h
index bc60a511fb..f3b76495b3 100644
--- a/nptl/sysdeps/x86_64/tls.h
+++ b/nptl/sysdeps/x86_64/tls.h
@@ -26,6 +26,7 @@
 # include <stdint.h>
 # include <stdlib.h>
 # include <sysdep.h>
+# include <libc-internal.h>
 # include <kernel-features.h>
 
 /* Replacement type for __m128 since this file is included by ld.so,
@@ -263,7 +264,7 @@ typedef struct
 	   abort ();							      \
 									      \
 	 asm volatile ("movq %q0,%%fs:%P1" :				      \
-		       : IMM_MODE ((uint64_t) (value)),			      \
+		       : IMM_MODE ((uint64_t) cast_to_integer (value)),	      \
 			 "i" (offsetof (struct pthread, member)));	      \
        }})
 
@@ -288,7 +289,7 @@ typedef struct
 	   abort ();							      \
 									      \
 	 asm volatile ("movq %q0,%%fs:%P1(,%q2,8)" :			      \
-		       : IMM_MODE ((uint64_t) (value)),			      \
+		       : IMM_MODE ((uint64_t) cast_to_integer (value)),	      \
 			 "i" (offsetof (struct pthread, member[0])),	      \
 			 "r" (idx));					      \
        }})
diff --git a/nptl/unwind.c b/nptl/unwind.c
index 7ccb21382b..aedd037452 100644
--- a/nptl/unwind.c
+++ b/nptl/unwind.c
@@ -124,7 +124,7 @@ __pthread_unwind (__pthread_unwind_buf_t *buf)
   /* This is not a catchable exception, so don't provide any details about
      the exception type.  We do need to initialize the field though.  */
   THREAD_SETMEM (self, exc.exception_class, 0);
-  THREAD_SETMEM (self, exc.exception_cleanup, unwind_cleanup);
+  THREAD_SETMEM (self, exc.exception_cleanup, &unwind_cleanup);
 
   _Unwind_ForcedUnwind (&self->exc, unwind_stop, ibuf);
 #else