about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2006-03-06 07:33:30 +0000
committerJakub Jelinek <jakub@redhat.com>2006-03-06 07:33:30 +0000
commit008a1add5e19cde902d2255d03cca1d5fff26126 (patch)
tree4c95836853966754a3a4a1e39931adbee7820752
parentb3643a38588a0d7217ef933735b9cf142ccdbf2d (diff)
downloadglibc-008a1add5e19cde902d2255d03cca1d5fff26126.tar.gz
glibc-008a1add5e19cde902d2255d03cca1d5fff26126.tar.xz
glibc-008a1add5e19cde902d2255d03cca1d5fff26126.zip
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
	(LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
	LLL_STUB_UNWIND_INFO_5, LLL_STUB_UNWIND_INFO_6): Define.
	(lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
	lll_robust_mutex_cond_lock, lll_mutex_timedlock,
	lll_robust_mutex_timedlock, lll_mutex_unlock,
	lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
	Add _L_*_ symbols around the subsection.
	* sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Add unwind info.
	* sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
-rw-r--r--ChangeLog14
-rw-r--r--nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S59
-rw-r--r--nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h294
-rw-r--r--nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S41
4 files changed, 325 insertions, 83 deletions
diff --git a/ChangeLog b/ChangeLog
index 8a9c70e5b8..bdfd1c7ee3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2006-03-03  Jakub Jelinek  <jakub@redhat.com>
+	    Roland McGrath  <roland@redhat.com>
+
+	* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
+	(LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
+	LLL_STUB_UNWIND_INFO_5, LLL_STUB_UNWIND_INFO_6): Define.
+	(lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
+	lll_robust_mutex_cond_lock, lll_mutex_timedlock,
+	lll_robust_mutex_timedlock, lll_mutex_unlock,
+	lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
+	Add _L_*_ symbols around the subsection.
+	* sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Add unwind info.
+	* sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
+
 2006-03-05  Roland McGrath  <roland@redhat.com>
 
 	* malloc/malloc.c (MALLOC_ALIGNMENT): Revert to (2 * SIZE_SZ) value.
diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S b/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
index 3a49e25dd2..90f10e6f4f 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
 
@@ -43,9 +43,13 @@
 	.hidden	__lll_mutex_lock_wait
 	.align	16
 __lll_mutex_lock_wait:
+	cfi_startproc
 	pushq	%r10
+	cfi_adjust_cfa_offset(8)
 	pushq	%rdx
-
+	cfi_adjust_cfa_offset(8)
+	cfi_offset(%r10, -16)
+	cfi_offset(%rdx, -24)
 	xorq	%r10, %r10	/* No timeout.  */
 	movl	$2, %edx
 #if FUTEX_WAIT == 0
@@ -67,8 +71,13 @@ __lll_mutex_lock_wait:
 	jnz	1b
 
 	popq	%rdx
+	cfi_adjust_cfa_offset(-8)
+	cfi_restore(%rdx)
 	popq	%r10
+	cfi_adjust_cfa_offset(-8)
+	cfi_restore(%r10)
 	retq
+	cfi_endproc
 	.size	__lll_mutex_lock_wait,.-__lll_mutex_lock_wait
 
 
@@ -78,18 +87,30 @@ __lll_mutex_lock_wait:
 	.hidden	__lll_mutex_timedlock_wait
 	.align	16
 __lll_mutex_timedlock_wait:
+	cfi_startproc
 	/* Check for a valid timeout value.  */
 	cmpq	$1000000000, 8(%rdx)
 	jae	3f
 
 	pushq	%r8
+	cfi_adjust_cfa_offset(8)
 	pushq	%r9
+	cfi_adjust_cfa_offset(8)
 	pushq	%r12
+	cfi_adjust_cfa_offset(8)
 	pushq	%r13
+	cfi_adjust_cfa_offset(8)
 	pushq	%r14
+	cfi_adjust_cfa_offset(8)
+	cfi_offset(%r8, -16)
+	cfi_offset(%r9, -24)
+	cfi_offset(%r12, -32)
+	cfi_offset(%r13, -40)
+	cfi_offset(%r14, -48)
 
 	/* Stack frame for the timespec and timeval structs.  */
 	subq	$16, %rsp
+	cfi_adjust_cfa_offset(16)
 
 	movq	%rdi, %r12
 	movq	%rdx, %r13
@@ -147,13 +168,33 @@ __lll_mutex_timedlock_wait:
 	jnz	7f
 
 6:	addq	$16, %rsp
+	cfi_adjust_cfa_offset(-16)
 	popq	%r14
+	cfi_adjust_cfa_offset(-8)
+	cfi_restore(%r14)
 	popq	%r13
+	cfi_adjust_cfa_offset(-8)
+	cfi_restore(%r13)
 	popq	%r12
+	cfi_adjust_cfa_offset(-8)
+	cfi_restore(%r12)
 	popq	%r9
+	cfi_adjust_cfa_offset(-8)
+	cfi_restore(%r9)
 	popq	%r8
+	cfi_adjust_cfa_offset(-8)
+	cfi_restore(%r8)
+	retq
+
+3:	movl	$EINVAL, %eax
 	retq
 
+	cfi_adjust_cfa_offset(56)
+	cfi_offset(%r8, -16)
+	cfi_offset(%r9, -24)
+	cfi_offset(%r12, -32)
+	cfi_offset(%r13, -40)
+	cfi_offset(%r14, -48)
 	/* Check whether the time expired.  */
 7:	cmpq	$-ETIMEDOUT, %rcx
 	je	5f
@@ -165,11 +206,9 @@ __lll_mutex_timedlock_wait:
 	jz	6b
 	jmp	1b
 
-3:	movl	$EINVAL, %eax
-	retq
-
 5:	movl	$ETIMEDOUT, %eax
 	jmp	6b
+	cfi_endproc
 	.size	__lll_mutex_timedlock_wait,.-__lll_mutex_timedlock_wait
 #endif
 
@@ -199,8 +238,13 @@ lll_unlock_wake_cb:
 	.hidden	__lll_mutex_unlock_wake
 	.align	16
 __lll_mutex_unlock_wake:
+	cfi_startproc
 	pushq	%rsi
+	cfi_adjust_cfa_offset(8)
 	pushq	%rdx
+	cfi_adjust_cfa_offset(8)
+	cfi_offset(%rsi, -16)
+	cfi_offset(%rdx, -24)
 
 	movl	$0, (%rdi)
 	movl	$FUTEX_WAKE, %esi
@@ -209,8 +253,13 @@ __lll_mutex_unlock_wake:
 	syscall
 
 	popq	%rdx
+	cfi_adjust_cfa_offset(-8)
+	cfi_restore(%rdx)
 	popq	%rsi
+	cfi_adjust_cfa_offset(-8)
+	cfi_restore(%rsi)
 	retq
+	cfi_endproc
 	.size	__lll_mutex_unlock_wake,.-__lll_mutex_unlock_wake
 
 
diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h b/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
index 95e6923d4d..5047e4fe4d 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
@@ -46,6 +46,110 @@
 #define BUSY_WAIT_NOP          asm ("rep; nop")
 
 
+#ifdef USE_CFA_VAL_EXPRESSION
+# define LLL_STUB_UNWIND_INFO_START \
+	".section	.eh_frame,\"a\",@progbits\n" 		\
+"7:\t"	".long	9f-8f	# Length of Common Information Entry\n" \
+"8:\t"	".long	0x0	# CIE Identifier Tag\n\t" 		\
+	".byte	0x1	# CIE Version\n\t" 			\
+	".ascii \"zR\\0\"	# CIE Augmentation\n\t" 	\
+	".uleb128 0x1	# CIE Code Alignment Factor\n\t" 	\
+	".sleb128 -8	# CIE Data Alignment Factor\n\t" 	\
+	".byte	0x10	# CIE RA Column\n\t" 			\
+	".uleb128 0x1	# Augmentation size\n\t" 		\
+	".byte	0x1b	# FDE Encoding (pcrel sdata4)\n\t" 	\
+	".byte	0x12	# DW_CFA_def_cfa_sf\n\t" 		\
+	".uleb128 0x7\n\t" 					\
+	".sleb128 16\n\t" 					\
+	".align 8\n" 						\
+"9:\t"	".long	23f-10f	# FDE Length\n" 			\
+"10:\t"	".long	10b-7b	# FDE CIE offset\n\t" 			\
+	".long	1b-.	# FDE initial location\n\t" 		\
+	".long	6b-1b	# FDE address range\n\t" 		\
+	".uleb128 0x0	# Augmentation size\n\t" 		\
+	".byte	0x16	# DW_CFA_val_expression\n\t" 		\
+	".uleb128 0x10\n\t" 					\
+	".uleb128 12f-11f\n" 					\
+"11:\t"	".byte	0x80	# DW_OP_breg16\n\t" 			\
+	".sleb128 4b-1b\n"
+# define LLL_STUB_UNWIND_INFO_END \
+	".byte	0x16	# DW_CFA_val_expression\n\t" 		\
+	".uleb128 0x10\n\t" 					\
+	".uleb128 14f-13f\n" 					\
+"13:\t"	".byte	0x80	# DW_OP_breg16\n\t" 			\
+	".sleb128 4b-2b\n" 					\
+"14:\t"	".byte	0x40 + (3b-2b) # DW_CFA_advance_loc\n\t" 	\
+	".byte	0x0e	# DW_CFA_def_cfa_offset\n\t" 		\
+	".uleb128 0\n\t" 					\
+	".byte	0x16	# DW_CFA_val_expression\n\t" 		\
+	".uleb128 0x10\n\t" 					\
+	".uleb128 16f-15f\n" 					\
+"15:\t"	".byte	0x80	# DW_OP_breg16\n\t" 			\
+	".sleb128 4b-3b\n" 					\
+"16:\t"	".byte	0x40 + (4b-3b-1) # DW_CFA_advance_loc\n\t" 	\
+	".byte	0x0e	# DW_CFA_def_cfa_offset\n\t" 		\
+	".uleb128 128\n\t" 					\
+	".byte	0x16	# DW_CFA_val_expression\n\t" 		\
+	".uleb128 0x10\n\t" 					\
+	".uleb128 20f-17f\n" 					\
+"17:\t"	".byte	0x80	# DW_OP_breg16\n\t" 			\
+	".sleb128 19f-18f\n\t" 					\
+	".byte	0x0d	# DW_OP_const4s\n" 			\
+"18:\t"	".4byte	4b-.\n\t" 					\
+	".byte	0x1c	# DW_OP_minus\n\t" 			\
+	".byte	0x0d	# DW_OP_const4s\n" 			\
+"19:\t"	".4byte	24f-.\n\t" 					\
+	".byte	0x22	# DW_OP_plus\n" 			\
+"20:\t"	".byte	0x40 + (5b-4b+1) # DW_CFA_advance_loc\n\t" 	\
+	".byte	0x13	# DW_CFA_def_cfa_offset_sf\n\t" 	\
+	".sleb128 16\n\t" 					\
+	".byte	0x16	# DW_CFA_val_expression\n\t" 		\
+	".uleb128 0x10\n\t" 					\
+	".uleb128 22f-21f\n" 					\
+"21:\t"	".byte	0x80	# DW_OP_breg16\n\t" 			\
+	".sleb128 4b-5b\n" 					\
+"22:\t"	".align 8\n" 						\
+"23:\t"	".previous\n"
+
+/* Unwind info for
+   1: leaq ..., %rdi
+   2: subq $128, %rsp
+   3: callq ...
+   4: addq $128, %rsp
+   5: jmp 24f
+   6:
+   snippet.  */
+# define LLL_STUB_UNWIND_INFO_5 \
+LLL_STUB_UNWIND_INFO_START					\
+"12:\t"	".byte	0x40 + (2b-1b) # DW_CFA_advance_loc\n\t" 	\
+LLL_STUB_UNWIND_INFO_END
+
+/* Unwind info for
+   1: leaq ..., %rdi
+   0: movq ..., %rdx
+   2: subq $128, %rsp
+   3: callq ...
+   4: addq $128, %rsp
+   5: jmp 24f
+   6:
+   snippet.  */
+# define LLL_STUB_UNWIND_INFO_6 \
+LLL_STUB_UNWIND_INFO_START					\
+"12:\t"	".byte	0x40 + (0b-1b) # DW_CFA_advance_loc\n\t" 	\
+	".byte	0x16	# DW_CFA_val_expression\n\t" 		\
+	".uleb128 0x10\n\t" 					\
+	".uleb128 26f-25f\n" 					\
+"25:\t"	".byte	0x80	# DW_OP_breg16\n\t" 			\
+	".sleb128 4b-0b\n" 					\
+"26:\t"	".byte	0x40 + (2b-0b) # DW_CFA_advance_loc\n\t" 	\
+LLL_STUB_UNWIND_INFO_END
+
+#else
+# define LLL_STUB_UNWIND_INFO_5
+# define LLL_STUB_UNWIND_INFO_6
+#endif
+
+
 #define lll_futex_wait(futex, val) \
   ({									      \
     int __status;							      \
@@ -135,14 +239,18 @@ extern int __lll_mutex_unlock_wait (int *__futex) attribute_hidden;
   (void) ({ int ignore1, ignore2, ignore3;				      \
 	    __asm __volatile (LOCK_INSTR "cmpxchgl %0, %2\n\t"		      \
 			      "jnz 1f\n\t"				      \
-			      ".subsection 1\n"				      \
-			      "1:\tleaq %2, %%rdi\n\t"			      \
-			      "subq $128, %%rsp\n\t"			      \
-			      "callq __lll_mutex_lock_wait\n\t"		      \
-			      "addq $128, %%rsp\n\t"			      \
-			      "jmp 2f\n\t"				      \
+			      ".subsection 1\n\t"			      \
+			      ".type  _L_mutex_lock_%=, @function\n"	      \
+			      "_L_mutex_lock_%=:\n"			      \
+			      "1:\tleaq %2, %%rdi\n"			      \
+			      "2:\tsubq $128, %%rsp\n"			      \
+			      "3:\tcallq __lll_mutex_lock_wait\n"	      \
+			      "4:\taddq $128, %%rsp\n"			      \
+			      "5:\tjmp 24f\n"				      \
+			      "6:\t.size _L_mutex_lock_%=, 6b-1b\n\t"	      \
 			      ".previous\n"				      \
-			      "2:"					      \
+			      LLL_STUB_UNWIND_INFO_5			      \
+			      "24:"					      \
 			      : "=S" (ignore1), "=&D" (ignore2), "=m" (futex),\
 				"=a" (ignore3)				      \
 			      : "0" (1), "m" (futex), "3" (0)		      \
@@ -150,17 +258,21 @@ extern int __lll_mutex_unlock_wait (int *__futex) attribute_hidden;
 
 
 #define lll_robust_mutex_lock(futex, id) \
-  ({ int result, ignore1, ignore2;				      \
+  ({ int result, ignore1, ignore2;					      \
     __asm __volatile (LOCK_INSTR "cmpxchgl %0, %2\n\t"			      \
 		      "jnz 1f\n\t"					      \
-		      ".subsection 1\n"					      \
-		      "1:\tleaq %2, %%rdi\n\t"				      \
-		      "subq $128, %%rsp\n\t"				      \
-		      "callq __lll_robust_mutex_lock_wait\n\t"		      \
-		      "addq $128, %%rsp\n\t"				      \
-		      "jmp 2f\n\t"					      \
+		      ".subsection 1\n\t"				      \
+		      ".type  _L_robust_mutex_lock_%=, @function\n"	      \
+		      "_L_robust_mutex_lock_%=:\n"			      \
+		      "1:\tleaq %2, %%rdi\n"				      \
+		      "2:\tsubq $128, %%rsp\n"				      \
+		      "3:\tcallq __lll_robust_mutex_lock_wait\n"	      \
+		      "4:\taddq $128, %%rsp\n"				      \
+		      "5:\tjmp 24f\n"					      \
+		      "6:\t.size _L_robust_mutex_lock_%=, 6b-1b\n\t"	      \
 		      ".previous\n"					      \
-		      "2:"						      \
+		      LLL_STUB_UNWIND_INFO_5				      \
+		      "24:"						      \
 		      : "=S" (ignore1), "=&D" (ignore2), "=m" (futex),	      \
 			"=a" (result)					      \
 		      : "0" (id), "m" (futex), "3" (0)			      \
@@ -172,14 +284,18 @@ extern int __lll_mutex_unlock_wait (int *__futex) attribute_hidden;
   (void) ({ int ignore1, ignore2, ignore3;				      \
 	    __asm __volatile (LOCK_INSTR "cmpxchgl %0, %2\n\t"		      \
 			      "jnz 1f\n\t"				      \
-			      ".subsection 1\n"				      \
-			      "1:\tleaq %2, %%rdi\n\t"			      \
-			      "subq $128, %%rsp\n\t"			      \
-			      "callq __lll_mutex_lock_wait\n\t"		      \
-			      "addq $128, %%rsp\n\t"			      \
-			      "jmp 2f\n\t"				      \
+			      ".subsection 1\n\t"			      \
+			      ".type  _L_mutex_cond_lock_%=, @function\n"     \
+			      "_L_mutex_cond_lock_%=:\n"		      \
+			      "1:\tleaq %2, %%rdi\n"			      \
+			      "2:\tsubq $128, %%rsp\n"			      \
+			      "3:\tcallq __lll_mutex_lock_wait\n"	      \
+			      "4:\taddq $128, %%rsp\n"			      \
+			      "5:\tjmp 24f\n"				      \
+			      "6:\t.size _L_mutex_cond_lock_%=, 6b-1b\n\t"    \
 			      ".previous\n"				      \
-			      "2:"					      \
+			      LLL_STUB_UNWIND_INFO_5			      \
+			      "24:"					      \
 			      : "=S" (ignore1), "=&D" (ignore2), "=m" (futex),\
 				"=a" (ignore3)				      \
 			      : "0" (2), "m" (futex), "3" (0)		      \
@@ -190,14 +306,18 @@ extern int __lll_mutex_unlock_wait (int *__futex) attribute_hidden;
   ({ int result, ignore1, ignore2;					      \
     __asm __volatile (LOCK_INSTR "cmpxchgl %0, %2\n\t"			      \
 		      "jnz 1f\n\t"					      \
-		      ".subsection 1\n"					      \
-		      "1:\tleaq %2, %%rdi\n\t"				      \
-		      "subq $128, %%rsp\n\t"				      \
-		      "callq __lll_robust_mutex_lock_wait\n\t"		      \
-		      "addq $128, %%rsp\n\t"				      \
-		      "jmp 2f\n\t"					      \
+		      ".subsection 1\n\t"				      \
+		      ".type  _L_robust_mutex_cond_lock_%=, @function\n"      \
+		      "_L_robust_mutex_cond_lock_%=:\n"			      \
+		      "1:\tleaq %2, %%rdi\n"				      \
+		      "2:\tsubq $128, %%rsp\n"				      \
+		      "3:\tcallq __lll_robust_mutex_lock_wait\n"	      \
+		      "4:\taddq $128, %%rsp\n"				      \
+		      "5:\tjmp 24f\n"					      \
+		      "6:\t.size _L_robust_mutex_cond_lock_%=, 6b-1b\n\t"     \
 		      ".previous\n"					      \
-		      "2:"						      \
+		      LLL_STUB_UNWIND_INFO_5				      \
+		      "24:"						      \
 		      : "=S" (ignore1), "=&D" (ignore2), "=m" (futex),	      \
 			"=a" (result)					      \
 		      : "0" (id | FUTEX_WAITERS), "m" (futex), "3" (0)	      \
@@ -209,15 +329,19 @@ extern int __lll_mutex_unlock_wait (int *__futex) attribute_hidden;
   ({ int result, ignore1, ignore2, ignore3;				      \
      __asm __volatile (LOCK_INSTR "cmpxchgl %2, %4\n\t"			      \
 		       "jnz 1f\n\t"					      \
-		       ".subsection 1\n"				      \
-		       "1:\tleaq %4, %%rdi\n\t"				      \
-		       "movq %8, %%rdx\n\t"				      \
-		       "subq $128, %%rsp\n\t"				      \
-		       "callq __lll_mutex_timedlock_wait\n\t"		      \
-		       "addq $128, %%rsp\n\t"				      \
-		       "jmp 2f\n\t"					      \
+		       ".subsection 1\n\t"				      \
+		       ".type  _L_mutex_timedlock_%=, @function\n"	      \
+		       "_L_mutex_timedlock_%=:\n"			      \
+		       "1:\tleaq %4, %%rdi\n"				      \
+		       "0:\tmovq %8, %%rdx\n"				      \
+		       "2:\tsubq $128, %%rsp\n"				      \
+		       "3:\tcallq __lll_mutex_timedlock_wait\n"		      \
+		       "4:\taddq $128, %%rsp\n"				      \
+		       "5:\tjmp 24f\n"					      \
+		       "6:\t.size _L_mutex_timedlock_%=, 6b-1b\n\t"	      \
 		       ".previous\n"					      \
-		       "2:"						      \
+		       LLL_STUB_UNWIND_INFO_6				      \
+		       "24:"						      \
 		       : "=a" (result), "=&D" (ignore1), "=S" (ignore2),      \
 			 "=&d" (ignore3), "=m" (futex)			      \
 		       : "0" (0), "2" (1), "m" (futex), "m" (timeout)	      \
@@ -229,15 +353,19 @@ extern int __lll_mutex_unlock_wait (int *__futex) attribute_hidden;
   ({ int result, ignore1, ignore2, ignore3;				      \
      __asm __volatile (LOCK_INSTR "cmpxchgl %2, %4\n\t"			      \
 		       "jnz 1f\n\t"					      \
-		       ".subsection 1\n"				      \
-		       "1:\tleaq %4, %%rdi\n\t"				      \
-		       "movq %8, %%rdx\n\t"				      \
-		       "subq $128, %%rsp\n\t"				      \
-		       "callq __lll_robust_mutex_timedlock_wait\n\t"	      \
-		       "addq $128, %%rsp\n\t"				      \
-		       "jmp 2f\n\t"					      \
+		       ".subsection 1\n\t"				      \
+		       ".type  _L_robust_mutex_timedlock_%=, @function\n"     \
+		       "_L_robust_mutex_timedlock_%=:\n"		      \
+		       "1:\tleaq %4, %%rdi\n"				      \
+		       "0:\tmovq %8, %%rdx\n"				      \
+		       "2:\tsubq $128, %%rsp\n"				      \
+		       "3:\tcallq __lll_robust_mutex_timedlock_wait\n"	      \
+		       "4:\taddq $128, %%rsp\n"				      \
+		       "5:\tjmp 24f\n"					      \
+		       "6:\t.size _L_robust_mutex_timedlock_%=, 6b-1b\n\t"    \
 		       ".previous\n"					      \
-		       "2:"						      \
+		       LLL_STUB_UNWIND_INFO_6				      \
+		       "24:"						      \
 		       : "=a" (result), "=&D" (ignore1), "=S" (ignore2),      \
 			 "=&d" (ignore3), "=m" (futex)			      \
 		       : "0" (0), "2" (id), "m" (futex), "m" (timeout)	      \
@@ -249,14 +377,18 @@ extern int __lll_mutex_unlock_wait (int *__futex) attribute_hidden;
   (void) ({ int ignore;							      \
             __asm __volatile (LOCK_INSTR "decl %0\n\t"			      \
 			      "jne 1f\n\t"				      \
-			      ".subsection 1\n"				      \
-			      "1:\tleaq %0, %%rdi\n\t"			      \
-			      "subq $128, %%rsp\n\t"			      \
-			      "callq __lll_mutex_unlock_wake\n\t"	      \
-			      "addq $128, %%rsp\n\t"			      \
-			      "jmp 2f\n\t"				      \
+			      ".subsection 1\n\t"			      \
+			      ".type  _L_mutex_unlock_%=, @function\n"	      \
+			      "_L_mutex_unlock_%=:\n"			      \
+			      "1:\tleaq %0, %%rdi\n"			      \
+			      "2:\tsubq $128, %%rsp\n"			      \
+			      "3:\tcallq __lll_mutex_unlock_wake\n"	      \
+			      "4:\taddq $128, %%rsp\n"			      \
+			      "5:\tjmp 24f\n"				      \
+			      "6:\t.size _L_mutex_unlock_%=, 6b-1b\n\t"	      \
 			      ".previous\n"				      \
-			      "2:"					      \
+			      LLL_STUB_UNWIND_INFO_5			      \
+			      "24:"					      \
 			      : "=m" (futex), "=&D" (ignore)		      \
 			      : "m" (futex)				      \
 			      : "ax", "cx", "r11", "cc", "memory"); })
@@ -266,14 +398,18 @@ extern int __lll_mutex_unlock_wait (int *__futex) attribute_hidden;
   (void) ({ int ignore;							      \
 	    __asm __volatile (LOCK_INSTR "andl %2, %0\n\t"		      \
 			      "jne 1f\n\t"				      \
-			      ".subsection 1\n"				      \
-			      "1:\tleaq %0, %%rdi\n\t"			      \
-			      "subq $128, %%rsp\n\t"			      \
-			      "callq __lll_mutex_unlock_wake\n\t"	      \
-			      "addq $128, %%rsp\n\t"			      \
-			      "jmp 2f\n\t"				      \
+			      ".subsection 1\n\t"			      \
+			      ".type  _L_robust_mutex_unlock_%=, @function\n" \
+			      "_L_robust_mutex_unlock_%=:\n"		      \
+			      "1:\tleaq %0, %%rdi\n"			      \
+			      "2:\tsubq $128, %%rsp\n"			      \
+			      "3:\tcallq __lll_mutex_unlock_wake\n"	      \
+			      "4:\taddq $128, %%rsp\n"			      \
+			      "5:\tjmp 24f\n"				      \
+			      "6:\t.size _L_robust_mutex_unlock_%=, 6b-1b\n\t"\
 			      ".previous\n"				      \
-			      "2:"					      \
+			      LLL_STUB_UNWIND_INFO_5			      \
+			      "24:"					      \
 			      : "=m" (futex), "=&D" (ignore)		      \
 			      : "i" (FUTEX_WAITERS), "m" (futex)	      \
 			      : "ax", "cx", "r11", "cc", "memory"); })
@@ -348,17 +484,21 @@ extern int lll_unlock_wake_cb (int *__futex) attribute_hidden;
 			      "je 0f\n\t"				      \
 			      "lock; cmpxchgl %0, %2\n\t"		      \
 			      "jnz 1f\n\t"				      \
-		  	      "jmp 2f\n"				      \
+		  	      "jmp 24f\n"				      \
 			      "0:\tcmpxchgl %0, %2\n\t"			      \
 			      "jnz 1f\n\t"				      \
-			      ".subsection 1\n"				      \
-			      "1:\tleaq %2, %%rdi\n\t"			      \
-			      "subq $128, %%rsp\n\t"			      \
-			      "callq __lll_mutex_lock_wait\n\t"		      \
-			      "addq $128, %%rsp\n\t"			      \
-			      "jmp 2f\n\t"				      \
+			      ".subsection 1\n\t"			      \
+			      ".type  _L_lock_%=, @function\n"		      \
+			      "_L_lock_%=:\n"				      \
+			      "1:\tleaq %2, %%rdi\n"			      \
+			      "2:\tsubq $128, %%rsp\n"			      \
+			      "3:\tcallq __lll_mutex_lock_wait\n"	      \
+			      "4:\taddq $128, %%rsp\n"			      \
+			      "5:\tjmp 24f\n"				      \
+			      "6:\t.size _L_lock_%=, 6b-1b\n\t"		      \
 			      ".previous\n"				      \
-			      "2:"					      \
+			      LLL_STUB_UNWIND_INFO_5			      \
+			      "24:"					      \
 			      : "=S" (ignore1), "=&D" (ignore2), "=m" (futex),\
 				"=a" (ignore3)				      \
 			      : "0" (1), "m" (futex), "3" (0)		      \
@@ -371,17 +511,21 @@ extern int lll_unlock_wake_cb (int *__futex) attribute_hidden;
 			      "je 0f\n\t"				      \
 			      "lock; decl %0\n\t"			      \
 			      "jne 1f\n\t"				      \
-		  	      "jmp 2f\n"				      \
+		  	      "jmp 24f\n"				      \
 			      "0:\tdecl %0\n\t"				      \
 			      "jne 1f\n\t"				      \
-			      ".subsection 1\n"				      \
-			      "1:\tleaq %0, %%rdi\n\t"			      \
-			      "subq $128, %%rsp\n\t"			      \
-			      "callq __lll_mutex_unlock_wake\n\t"	      \
-			      "addq $128, %%rsp\n\t"			      \
-			      "jmp 2f\n\t"				      \
+			      ".subsection 1\n\t"			      \
+			      ".type  _L_unlock_%=, @function\n"	      \
+			      "_L_unlock_%=:\n"				      \
+			      "1:\tleaq %0, %%rdi\n"			      \
+			      "2:\tsubq $128, %%rsp\n"			      \
+			      "3:\tcallq __lll_mutex_unlock_wake\n"	      \
+			      "4:\taddq $128, %%rsp\n"			      \
+			      "5:\tjmp 24f\n"				      \
+			      "6:\t.size _L_unlock_%=, 6b-1b\n\t"	      \
 			      ".previous\n"				      \
-			      "2:"					      \
+			      LLL_STUB_UNWIND_INFO_5			      \
+			      "24:"					      \
 			      : "=m" (futex), "=&D" (ignore)		      \
 			      : "m" (futex)				      \
 			      : "ax", "cx", "r11", "cc", "memory"); })
diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S b/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
index 1a088e27b1..69243950d7 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
@@ -46,8 +46,13 @@
 	.hidden	__lll_robust_mutex_lock_wait
 	.align	16
 __lll_robust_mutex_lock_wait:
+	cfi_startproc
 	pushq	%r10
+	cfi_adjust_cfa_offset(8)
 	pushq	%rdx
+	cfi_adjust_cfa_offset(8)
+	cfi_offset(%r10, -16)
+	cfi_offset(%rdx, -24)
 
 	xorq	%r10, %r10	/* No timeout.  */
 #if FUTEX_WAIT == 0
@@ -85,8 +90,13 @@ __lll_robust_mutex_lock_wait:
 	/* NB:	 %rax == 0 */
 
 3:	popq	%rdx
+	cfi_adjust_cfa_offset(-8)
+	cfi_restore(%rdx)
 	popq	%r10
+	cfi_adjust_cfa_offset(-8)
+	cfi_restore(%r10)
 	retq
+	cfi_endproc
 	.size	__lll_robust_mutex_lock_wait,.-__lll_robust_mutex_lock_wait
 
 
@@ -95,17 +105,27 @@ __lll_robust_mutex_lock_wait:
 	.hidden	__lll_robust_mutex_timedlock_wait
 	.align	16
 __lll_robust_mutex_timedlock_wait:
+	cfi_startproc
 	/* Check for a valid timeout value.  */
 	cmpq	$1000000000, 8(%rdx)
 	jae	3f
 
 	pushq	%r8
+	cfi_adjust_cfa_offset(8)
 	pushq	%r9
+	cfi_adjust_cfa_offset(8)
 	pushq	%r12
+	cfi_adjust_cfa_offset(8)
 	pushq	%r13
+	cfi_adjust_cfa_offset(8)
+	cfi_offset(%r8, -16)
+	cfi_offset(%r9, -24)
+	cfi_offset(%r12, -32)
+	cfi_offset(%r13, -40)
 
 	/* Stack frame for the timespec and timeval structs.  */
 	subq	$24, %rsp
+	cfi_adjust_cfa_offset(24)
 
 	movq	%rdi, %r12
 	movq	%rdx, %r13
@@ -176,19 +196,34 @@ __lll_robust_mutex_timedlock_wait:
 	jnz	7f
 
 6:	addq	$24, %rsp
+	cfi_adjust_cfa_offset(-24)
 	popq	%r13
+	cfi_adjust_cfa_offset(-8)
+	cfi_restore(%r13)
 	popq	%r12
+	cfi_adjust_cfa_offset(-8)
+	cfi_restore(%r12)
 	popq	%r9
+	cfi_adjust_cfa_offset(-8)
+	cfi_restore(%r9)
 	popq	%r8
+	cfi_adjust_cfa_offset(-8)
+	cfi_restore(%r8)
 	retq
 
+3:	movl	$EINVAL, %eax
+	retq
+
+	cfi_adjust_cfa_offset(56)
+	cfi_offset(%r8, -16)
+	cfi_offset(%r9, -24)
+	cfi_offset(%r12, -32)
+	cfi_offset(%r13, -40)
 	/* Check whether the time expired.  */
 7:	cmpq	$-ETIMEDOUT, %rcx
 	jne	1b
 
 8:	movl	$ETIMEDOUT, %eax
 	jmp	6b
-
-3:	movl	$EINVAL, %eax
-	retq
+	cfi_endproc
 	.size	__lll_robust_mutex_timedlock_wait,.-__lll_robust_mutex_timedlock_wait