public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH][AArch64] Add more cfi annotations to tlsdesc entry points
@ 2016-12-09 13:23 Szabolcs Nagy
  2016-12-09 17:38 ` Richard Henderson
  0 siblings, 1 reply; 9+ messages in thread
From: Szabolcs Nagy @ 2016-12-09 13:23 UTC (permalink / raw)
  To: GNU C Library; +Cc: nd, Marcus Shawcroft, Florian Weimer

[-- Attachment #1: Type: text/plain, Size: 480 bytes --]

Backtrace through _dl_tlsdesc_resolve_rela was broken because the offset
of x30 from cfa was not in the debug info.

Add enough annotation so backtracing from the dynamic linker through
tlsdesc entry points works and the debugger shows registers correctly.

(manually tested with gdb.)

2016-12-09  Szabolcs Nagy  <szabolcs.nagy@arm.com>

	* sysdeps/aarch64/dl-tlsdesc.S (_dl_tlsdesc_dynamic): Add cfi
	annotation.
	(_dl_tlsdesc_resolve_rela, _dl_tlsdesc_resolve_hold): Likewise.

[-- Attachment #2: tlscfi.diff --]
[-- Type: text/x-patch, Size: 4705 bytes --]

diff --git a/sysdeps/aarch64/dl-tlsdesc.S b/sysdeps/aarch64/dl-tlsdesc.S
index 9e557dd..40a19d4 100644
--- a/sysdeps/aarch64/dl-tlsdesc.S
+++ b/sysdeps/aarch64/dl-tlsdesc.S
@@ -176,6 +176,8 @@ _dl_tlsdesc_dynamic:
 # define NSAVEXREGPAIRS 2
 	stp	x29, x30, [sp,#-(32+16*NSAVEXREGPAIRS)]!
 	cfi_adjust_cfa_offset (32+16*NSAVEXREGPAIRS)
+	cfi_rel_offset (x29, 0)
+	cfi_rel_offset (x30, 8)
 	mov	x29, sp
 	DELOUSE (0)
 
@@ -183,7 +185,11 @@ _dl_tlsdesc_dynamic:
 	   into slow path we will save additional registers.  */
 
 	stp	x1,  x2, [sp, #32+16*0]
+	cfi_rel_offset (x1, 32)
+	cfi_rel_offset (x2, 32+8)
 	stp	x3,  x4, [sp, #32+16*1]
+	cfi_rel_offset (x3, 32+16)
+	cfi_rel_offset (x4, 32+24)
 
 	mrs	x4, tpidr_el0
 	/* The ldar here happens after the load from [x0] at the call site
@@ -213,6 +219,8 @@ _dl_tlsdesc_dynamic:
 
 	ldp	x29, x30, [sp], #(32+16*NSAVEXREGPAIRS)
 	cfi_adjust_cfa_offset (-32-16*NSAVEXREGPAIRS)
+	cfi_restore (x29)
+	cfi_restore (x30)
 # undef NSAVEXREGPAIRS
 	RET
 2:
@@ -224,12 +232,26 @@ _dl_tlsdesc_dynamic:
 # define NSAVEXREGPAIRS 7
 	stp	 x5,  x6, [sp, #-16*NSAVEXREGPAIRS]!
 	cfi_adjust_cfa_offset (16*NSAVEXREGPAIRS)
+	cfi_rel_offset (x5, 0)
+	cfi_rel_offset (x6, 8)
 	stp	 x7,  x8, [sp, #16*1]
+	cfi_rel_offset (x7, 16)
+	cfi_rel_offset (x8, 16+8)
 	stp	 x9, x10, [sp, #16*2]
+	cfi_rel_offset (x9, 16*2)
+	cfi_rel_offset (x10, 16*2+8)
 	stp	x11, x12, [sp, #16*3]
+	cfi_rel_offset (x11, 16*3)
+	cfi_rel_offset (x12, 16*3+8)
 	stp	x13, x14, [sp, #16*4]
+	cfi_rel_offset (x13, 16*4)
+	cfi_rel_offset (x14, 16*4+8)
 	stp	x15, x16, [sp, #16*5]
+	cfi_rel_offset (x15, 16*5)
+	cfi_rel_offset (x16, 16*5+8)
 	stp	x17, x18, [sp, #16*6]
+	cfi_rel_offset (x17, 16*6)
+	cfi_rel_offset (x18, 16*6+8)
 
 	SAVE_Q_REGISTERS
 
@@ -268,18 +290,41 @@ _dl_tlsdesc_dynamic:
 	.align 2
 _dl_tlsdesc_resolve_rela:
 #define	NSAVEXREGPAIRS 9
+	/* The tlsdesc PLT entry pushes x2 and x3 to the stack.  */
+	cfi_adjust_cfa_offset (16)
+	cfi_rel_offset (x2, 0)
+	cfi_rel_offset (x3, 8)
 	stp	x29, x30, [sp, #-(32+16*NSAVEXREGPAIRS)]!
 	cfi_adjust_cfa_offset (32+16*NSAVEXREGPAIRS)
+	cfi_rel_offset (x29, 0)
+	cfi_rel_offset (x30, 8)
 	mov	x29, sp
 	stp	 x1,  x4, [sp, #32+16*0]
+	cfi_rel_offset (x1, 32)
+	cfi_rel_offset (x4, 32+8)
 	stp	 x5,  x6, [sp, #32+16*1]
+	cfi_rel_offset (x5, 32+16)
+	cfi_rel_offset (x6, 32+16+8)
 	stp	 x7,  x8, [sp, #32+16*2]
+	cfi_rel_offset (x7, 32+16*2)
+	cfi_rel_offset (x8, 32+16*2+8)
 	stp	 x9, x10, [sp, #32+16*3]
+	cfi_rel_offset (x9, 32+16*3)
+	cfi_rel_offset (x10, 32+16*3+8)
 	stp	x11, x12, [sp, #32+16*4]
+	cfi_rel_offset (x11, 32+16*4)
+	cfi_rel_offset (x12, 32+16*4+8)
 	stp	x13, x14, [sp, #32+16*5]
+	cfi_rel_offset (x13, 32+16*5)
+	cfi_rel_offset (x14, 32+16*5+8)
 	stp	x15, x16, [sp, #32+16*6]
+	cfi_rel_offset (x15, 32+16*6)
+	cfi_rel_offset (x16, 32+16*6+8)
 	stp	x17, x18, [sp, #32+16*7]
+	cfi_rel_offset (x17, 32+16*7)
+	cfi_rel_offset (x18, 32+16*7+8)
 	str	x0,       [sp, #32+16*8]
+	cfi_rel_offset (x0, 32+16*8)
 
 	SAVE_Q_REGISTERS
 
@@ -304,6 +349,8 @@ _dl_tlsdesc_resolve_rela:
 	ldp	x17, x18, [sp, #32+16*7]
 	ldp	x29, x30, [sp], #(32+16*NSAVEXREGPAIRS)
 	cfi_adjust_cfa_offset (-32-16*NSAVEXREGPAIRS)
+	cfi_restore (x29)
+	cfi_restore (x30)
 	ldp	x2, x3, [sp], #16
 	cfi_adjust_cfa_offset (-16)
 	RET
@@ -332,17 +379,38 @@ _dl_tlsdesc_resolve_hold:
 1:
 	stp	x29, x30, [sp, #-(32+16*NSAVEXREGPAIRS)]!
 	cfi_adjust_cfa_offset (32+16*NSAVEXREGPAIRS)
+	cfi_rel_offset (x29, 0)
+	cfi_rel_offset (x30, 8)
 	mov	x29, sp
 	stp	 x1,  x2, [sp, #32+16*0]
+	cfi_rel_offset (x1, 32)
+	cfi_rel_offset (x2, 32+8)
 	stp	 x3,  x4, [sp, #32+16*1]
+	cfi_rel_offset (x3, 32+16)
+	cfi_rel_offset (x4, 32+16+8)
 	stp	 x5,  x6, [sp, #32+16*2]
+	cfi_rel_offset (x5, 32+16*2)
+	cfi_rel_offset (x6, 32+16*2+8)
 	stp	 x7,  x8, [sp, #32+16*3]
+	cfi_rel_offset (x7, 32+16*3)
+	cfi_rel_offset (x8, 32+16*3+8)
 	stp	 x9, x10, [sp, #32+16*4]
+	cfi_rel_offset (x9, 32+16*4)
+	cfi_rel_offset (x10, 32+16*4+8)
 	stp	x11, x12, [sp, #32+16*5]
+	cfi_rel_offset (x11, 32+16*5)
+	cfi_rel_offset (x12, 32+16*5+8)
 	stp	x13, x14, [sp, #32+16*6]
+	cfi_rel_offset (x13, 32+16*6)
+	cfi_rel_offset (x14, 32+16*6+8)
 	stp	x15, x16, [sp, #32+16*7]
+	cfi_rel_offset (x15, 32+16*7)
+	cfi_rel_offset (x16, 32+16*7+8)
 	stp	x17, x18, [sp, #32+16*8]
+	cfi_rel_offset (x17, 32+16*8)
+	cfi_rel_offset (x18, 32+16*8+8)
 	str	x0,       [sp, #32+16*9]
+	cfi_rel_offset (x0, 32+16*9)
 
 	SAVE_Q_REGISTERS
 
@@ -367,6 +435,8 @@ _dl_tlsdesc_resolve_hold:
 	ldp	x17, x18, [sp, #32+16*8]
 	ldp	x29, x30, [sp], #(32+16*NSAVEXREGPAIRS)
 	cfi_adjust_cfa_offset (-32-16*NSAVEXREGPAIRS)
+	cfi_restore (x29)
+	cfi_restore (x30)
 	RET
 	cfi_endproc
 	.size	_dl_tlsdesc_resolve_hold, .-_dl_tlsdesc_resolve_hold

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH][AArch64] Add more cfi annotations to tlsdesc entry points
  2016-12-09 13:23 [PATCH][AArch64] Add more cfi annotations to tlsdesc entry points Szabolcs Nagy
@ 2016-12-09 17:38 ` Richard Henderson
  2016-12-13 12:35   ` [PATCH v2][AArch64] " Szabolcs Nagy
  2016-12-13 15:05   ` [PATCH][AArch64] " Florian Weimer
  0 siblings, 2 replies; 9+ messages in thread
From: Richard Henderson @ 2016-12-09 17:38 UTC (permalink / raw)
  To: Szabolcs Nagy, GNU C Library; +Cc: nd, Marcus Shawcroft, Florian Weimer

On 12/09/2016 05:23 AM, Szabolcs Nagy wrote:
>  	stp	x1,  x2, [sp, #32+16*0]
> +	cfi_rel_offset (x1, 32)
> +	cfi_rel_offset (x2, 32+8)
>  	stp	x3,  x4, [sp, #32+16*1]
> +	cfi_rel_offset (x3, 32+16)
> +	cfi_rel_offset (x4, 32+24)

FWIW, you'll produce equivalent, but smaller unwind info if you put all of the
cfi_rel_offsets together (constrained by the assembly for when the original
register values change.  So

	stp	x1, x2, [sp, #32+16*0]
	stp	x3, x4, [sp, #32+16*1]
	cfi_rel_offset (x1, 32)
	cfi_rel_offset (x2, 32+8)
	cfi_rel_offset (x3, 32+16)
	cfi_rel_offset (x4, 32+24)

>  	stp	 x5,  x6, [sp, #-16*NSAVEXREGPAIRS]!
>  	cfi_adjust_cfa_offset (16*NSAVEXREGPAIRS)
> +	cfi_rel_offset (x5, 0)
> +	cfi_rel_offset (x6, 8)
>  	stp	 x7,  x8, [sp, #16*1]
> +	cfi_rel_offset (x7, 16)
> +	cfi_rel_offset (x8, 16+8)
>  	stp	 x9, x10, [sp, #16*2]
> +	cfi_rel_offset (x9, 16*2)
> +	cfi_rel_offset (x10, 16*2+8)
>  	stp	x11, x12, [sp, #16*3]
> +	cfi_rel_offset (x11, 16*3)
> +	cfi_rel_offset (x12, 16*3+8)
>  	stp	x13, x14, [sp, #16*4]
> +	cfi_rel_offset (x13, 16*4)
> +	cfi_rel_offset (x14, 16*4+8)
>  	stp	x15, x16, [sp, #16*5]
> +	cfi_rel_offset (x15, 16*5)
> +	cfi_rel_offset (x16, 16*5+8)
>  	stp	x17, x18, [sp, #16*6]
> +	cfi_rel_offset (x17, 16*6)
> +	cfi_rel_offset (x18, 16*6+8)

Likewise.  But of course you can't move the cfi_adjust_cfa_offset.


r~

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v2][AArch64] Add more cfi annotations to tlsdesc entry points
  2016-12-09 17:38 ` Richard Henderson
@ 2016-12-13 12:35   ` Szabolcs Nagy
  2017-01-06 15:58     ` Szabolcs Nagy
  2017-06-21 14:05     ` Szabolcs Nagy
  2016-12-13 15:05   ` [PATCH][AArch64] " Florian Weimer
  1 sibling, 2 replies; 9+ messages in thread
From: Szabolcs Nagy @ 2016-12-13 12:35 UTC (permalink / raw)
  To: Richard Henderson, GNU C Library; +Cc: nd, Marcus Shawcroft, Florian Weimer

[-- Attachment #1: Type: text/plain, Size: 516 bytes --]

Backtrace through _dl_tlsdesc_resolve_rela was broken because the offset
of x30 from cfa was not in the debug info.

Add enough annotation so backtracing from the dynamic linker through
tlsdesc entry points works and the debugger shows registers correctly.

v2:
- group cfi_rel_offset annotations for smaller debug info.

2016-12-13  Szabolcs Nagy  <szabolcs.nagy@arm.com>

	* sysdeps/aarch64/dl-tlsdesc.S (_dl_tlsdesc_dynamic): Add cfi
	annotation.
	(_dl_tlsdesc_resolve_rela, _dl_tlsdesc_resolve_hold): Likewise.


[-- Attachment #2: tlscfi.diff --]
[-- Type: text/x-patch, Size: 4259 bytes --]

diff --git a/sysdeps/aarch64/dl-tlsdesc.S b/sysdeps/aarch64/dl-tlsdesc.S
index 9e557dd..4cad6fb 100644
--- a/sysdeps/aarch64/dl-tlsdesc.S
+++ b/sysdeps/aarch64/dl-tlsdesc.S
@@ -176,6 +176,8 @@ _dl_tlsdesc_dynamic:
 # define NSAVEXREGPAIRS 2
 	stp	x29, x30, [sp,#-(32+16*NSAVEXREGPAIRS)]!
 	cfi_adjust_cfa_offset (32+16*NSAVEXREGPAIRS)
+	cfi_rel_offset (x29, 0)
+	cfi_rel_offset (x30, 8)
 	mov	x29, sp
 	DELOUSE (0)
 
@@ -184,6 +186,10 @@ _dl_tlsdesc_dynamic:
 
 	stp	x1,  x2, [sp, #32+16*0]
 	stp	x3,  x4, [sp, #32+16*1]
+	cfi_rel_offset (x1, 32)
+	cfi_rel_offset (x2, 32+8)
+	cfi_rel_offset (x3, 32+16)
+	cfi_rel_offset (x4, 32+24)
 
 	mrs	x4, tpidr_el0
 	/* The ldar here happens after the load from [x0] at the call site
@@ -213,6 +219,8 @@ _dl_tlsdesc_dynamic:
 
 	ldp	x29, x30, [sp], #(32+16*NSAVEXREGPAIRS)
 	cfi_adjust_cfa_offset (-32-16*NSAVEXREGPAIRS)
+	cfi_restore (x29)
+	cfi_restore (x30)
 # undef NSAVEXREGPAIRS
 	RET
 2:
@@ -230,6 +238,20 @@ _dl_tlsdesc_dynamic:
 	stp	x13, x14, [sp, #16*4]
 	stp	x15, x16, [sp, #16*5]
 	stp	x17, x18, [sp, #16*6]
+	cfi_rel_offset (x5, 0)
+	cfi_rel_offset (x6, 8)
+	cfi_rel_offset (x7, 16)
+	cfi_rel_offset (x8, 16+8)
+	cfi_rel_offset (x9, 16*2)
+	cfi_rel_offset (x10, 16*2+8)
+	cfi_rel_offset (x11, 16*3)
+	cfi_rel_offset (x12, 16*3+8)
+	cfi_rel_offset (x13, 16*4)
+	cfi_rel_offset (x14, 16*4+8)
+	cfi_rel_offset (x15, 16*5)
+	cfi_rel_offset (x16, 16*5+8)
+	cfi_rel_offset (x17, 16*6)
+	cfi_rel_offset (x18, 16*6+8)
 
 	SAVE_Q_REGISTERS
 
@@ -268,8 +290,14 @@ _dl_tlsdesc_dynamic:
 	.align 2
 _dl_tlsdesc_resolve_rela:
 #define	NSAVEXREGPAIRS 9
+	/* The tlsdesc PLT entry pushes x2 and x3 to the stack.  */
+	cfi_adjust_cfa_offset (16)
+	cfi_rel_offset (x2, 0)
+	cfi_rel_offset (x3, 8)
 	stp	x29, x30, [sp, #-(32+16*NSAVEXREGPAIRS)]!
 	cfi_adjust_cfa_offset (32+16*NSAVEXREGPAIRS)
+	cfi_rel_offset (x29, 0)
+	cfi_rel_offset (x30, 8)
 	mov	x29, sp
 	stp	 x1,  x4, [sp, #32+16*0]
 	stp	 x5,  x6, [sp, #32+16*1]
@@ -280,6 +308,23 @@ _dl_tlsdesc_resolve_rela:
 	stp	x15, x16, [sp, #32+16*6]
 	stp	x17, x18, [sp, #32+16*7]
 	str	x0,       [sp, #32+16*8]
+	cfi_rel_offset (x1, 32)
+	cfi_rel_offset (x4, 32+8)
+	cfi_rel_offset (x5, 32+16)
+	cfi_rel_offset (x6, 32+16+8)
+	cfi_rel_offset (x7, 32+16*2)
+	cfi_rel_offset (x8, 32+16*2+8)
+	cfi_rel_offset (x9, 32+16*3)
+	cfi_rel_offset (x10, 32+16*3+8)
+	cfi_rel_offset (x11, 32+16*4)
+	cfi_rel_offset (x12, 32+16*4+8)
+	cfi_rel_offset (x13, 32+16*5)
+	cfi_rel_offset (x14, 32+16*5+8)
+	cfi_rel_offset (x15, 32+16*6)
+	cfi_rel_offset (x16, 32+16*6+8)
+	cfi_rel_offset (x17, 32+16*7)
+	cfi_rel_offset (x18, 32+16*7+8)
+	cfi_rel_offset (x0, 32+16*8)
 
 	SAVE_Q_REGISTERS
 
@@ -304,6 +349,8 @@ _dl_tlsdesc_resolve_rela:
 	ldp	x17, x18, [sp, #32+16*7]
 	ldp	x29, x30, [sp], #(32+16*NSAVEXREGPAIRS)
 	cfi_adjust_cfa_offset (-32-16*NSAVEXREGPAIRS)
+	cfi_restore (x29)
+	cfi_restore (x30)
 	ldp	x2, x3, [sp], #16
 	cfi_adjust_cfa_offset (-16)
 	RET
@@ -332,6 +379,8 @@ _dl_tlsdesc_resolve_hold:
 1:
 	stp	x29, x30, [sp, #-(32+16*NSAVEXREGPAIRS)]!
 	cfi_adjust_cfa_offset (32+16*NSAVEXREGPAIRS)
+	cfi_rel_offset (x29, 0)
+	cfi_rel_offset (x30, 8)
 	mov	x29, sp
 	stp	 x1,  x2, [sp, #32+16*0]
 	stp	 x3,  x4, [sp, #32+16*1]
@@ -343,6 +392,25 @@ _dl_tlsdesc_resolve_hold:
 	stp	x15, x16, [sp, #32+16*7]
 	stp	x17, x18, [sp, #32+16*8]
 	str	x0,       [sp, #32+16*9]
+	cfi_rel_offset (x1, 32)
+	cfi_rel_offset (x2, 32+8)
+	cfi_rel_offset (x3, 32+16)
+	cfi_rel_offset (x4, 32+16+8)
+	cfi_rel_offset (x5, 32+16*2)
+	cfi_rel_offset (x6, 32+16*2+8)
+	cfi_rel_offset (x7, 32+16*3)
+	cfi_rel_offset (x8, 32+16*3+8)
+	cfi_rel_offset (x9, 32+16*4)
+	cfi_rel_offset (x10, 32+16*4+8)
+	cfi_rel_offset (x11, 32+16*5)
+	cfi_rel_offset (x12, 32+16*5+8)
+	cfi_rel_offset (x13, 32+16*6)
+	cfi_rel_offset (x14, 32+16*6+8)
+	cfi_rel_offset (x15, 32+16*7)
+	cfi_rel_offset (x16, 32+16*7+8)
+	cfi_rel_offset (x17, 32+16*8)
+	cfi_rel_offset (x18, 32+16*8+8)
+	cfi_rel_offset (x0, 32+16*9)
 
 	SAVE_Q_REGISTERS
 
@@ -367,6 +435,8 @@ _dl_tlsdesc_resolve_hold:
 	ldp	x17, x18, [sp, #32+16*8]
 	ldp	x29, x30, [sp], #(32+16*NSAVEXREGPAIRS)
 	cfi_adjust_cfa_offset (-32-16*NSAVEXREGPAIRS)
+	cfi_restore (x29)
+	cfi_restore (x30)
 	RET
 	cfi_endproc
 	.size	_dl_tlsdesc_resolve_hold, .-_dl_tlsdesc_resolve_hold

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH][AArch64] Add more cfi annotations to tlsdesc entry points
  2016-12-09 17:38 ` Richard Henderson
  2016-12-13 12:35   ` [PATCH v2][AArch64] " Szabolcs Nagy
@ 2016-12-13 15:05   ` Florian Weimer
  2016-12-13 15:11     ` Richard Henderson
  1 sibling, 1 reply; 9+ messages in thread
From: Florian Weimer @ 2016-12-13 15:05 UTC (permalink / raw)
  To: Richard Henderson, Szabolcs Nagy, GNU C Library; +Cc: nd, Marcus Shawcroft

On 12/09/2016 06:38 PM, Richard Henderson wrote:
> On 12/09/2016 05:23 AM, Szabolcs Nagy wrote:
>>  	stp	x1,  x2, [sp, #32+16*0]
>> +	cfi_rel_offset (x1, 32)
>> +	cfi_rel_offset (x2, 32+8)
>>  	stp	x3,  x4, [sp, #32+16*1]
>> +	cfi_rel_offset (x3, 32+16)
>> +	cfi_rel_offset (x4, 32+24)
>
> FWIW, you'll produce equivalent, but smaller unwind info if you put all of the
> cfi_rel_offsets together (constrained by the assembly for when the original
> register values change.  So
>
> 	stp	x1, x2, [sp, #32+16*0]
> 	stp	x3, x4, [sp, #32+16*1]
> 	cfi_rel_offset (x1, 32)
> 	cfi_rel_offset (x2, 32+8)
> 	cfi_rel_offset (x3, 32+16)
> 	cfi_rel_offset (x4, 32+24)

Will this cause problems with async cancellation?

Thanks,
Florian

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH][AArch64] Add more cfi annotations to tlsdesc entry points
  2016-12-13 15:05   ` [PATCH][AArch64] " Florian Weimer
@ 2016-12-13 15:11     ` Richard Henderson
  0 siblings, 0 replies; 9+ messages in thread
From: Richard Henderson @ 2016-12-13 15:11 UTC (permalink / raw)
  To: Florian Weimer, Szabolcs Nagy, GNU C Library; +Cc: nd, Marcus Shawcroft

On 12/13/2016 07:05 AM, Florian Weimer wrote:
> On 12/09/2016 06:38 PM, Richard Henderson wrote:
>> On 12/09/2016 05:23 AM, Szabolcs Nagy wrote:
>>>      stp    x1,  x2, [sp, #32+16*0]
>>> +    cfi_rel_offset (x1, 32)
>>> +    cfi_rel_offset (x2, 32+8)
>>>      stp    x3,  x4, [sp, #32+16*1]
>>> +    cfi_rel_offset (x3, 32+16)
>>> +    cfi_rel_offset (x4, 32+24)
>>
>> FWIW, you'll produce equivalent, but smaller unwind info if you put all of the
>> cfi_rel_offsets together (constrained by the assembly for when the original
>> register values change.  So
>>
>>     stp    x1, x2, [sp, #32+16*0]
>>     stp    x3, x4, [sp, #32+16*1]
>>     cfi_rel_offset (x1, 32)
>>     cfi_rel_offset (x2, 32+8)
>>     cfi_rel_offset (x3, 32+16)
>>     cfi_rel_offset (x4, 32+24)
>
> Will this cause problems with async cancellation?

No, because the registers have not been modified.  All this does is eliminate 
extra "advance" opcodes.

r~

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2][AArch64] Add more cfi annotations to tlsdesc entry points
  2016-12-13 12:35   ` [PATCH v2][AArch64] " Szabolcs Nagy
@ 2017-01-06 15:58     ` Szabolcs Nagy
  2017-01-23 11:31       ` Szabolcs Nagy
  2017-06-21 14:05     ` Szabolcs Nagy
  1 sibling, 1 reply; 9+ messages in thread
From: Szabolcs Nagy @ 2017-01-06 15:58 UTC (permalink / raw)
  To: Richard Henderson, GNU C Library; +Cc: nd, Marcus Shawcroft, Florian Weimer

On 13/12/16 12:34, Szabolcs Nagy wrote:
> Backtrace through _dl_tlsdesc_resolve_rela was broken because the offset
> of x30 from cfa was not in the debug info.
> 
> Add enough annotation so backtracing from the dynamic linker through
> tlsdesc entry points works and the debugger shows registers correctly.
> 
> v2:
> - group cfi_rel_offset annotations for smaller debug info.
> 
> 2016-12-13  Szabolcs Nagy  <szabolcs.nagy@arm.com>
> 
> 	* sysdeps/aarch64/dl-tlsdesc.S (_dl_tlsdesc_dynamic): Add cfi
> 	annotation.
> 	(_dl_tlsdesc_resolve_rela, _dl_tlsdesc_resolve_hold): Likewise.
> 

ping.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2][AArch64] Add more cfi annotations to tlsdesc entry points
  2017-01-06 15:58     ` Szabolcs Nagy
@ 2017-01-23 11:31       ` Szabolcs Nagy
  2017-02-07 20:26         ` Adhemerval Zanella
  0 siblings, 1 reply; 9+ messages in thread
From: Szabolcs Nagy @ 2017-01-23 11:31 UTC (permalink / raw)
  To: Richard Henderson, GNU C Library; +Cc: nd, Marcus Shawcroft, Florian Weimer

On 06/01/17 15:57, Szabolcs Nagy wrote:
> On 13/12/16 12:34, Szabolcs Nagy wrote:
>> Backtrace through _dl_tlsdesc_resolve_rela was broken because the offset
>> of x30 from cfa was not in the debug info.
>>
>> Add enough annotation so backtracing from the dynamic linker through
>> tlsdesc entry points works and the debugger shows registers correctly.
>>
>> v2:
>> - group cfi_rel_offset annotations for smaller debug info.
>>
>> 2016-12-13  Szabolcs Nagy  <szabolcs.nagy@arm.com>
>>
>> 	* sysdeps/aarch64/dl-tlsdesc.S (_dl_tlsdesc_dynamic): Add cfi
>> 	annotation.
>> 	(_dl_tlsdesc_resolve_rela, _dl_tlsdesc_resolve_hold): Likewise.
>>
> 
> ping.
> 

ping.

this is a bug fix which should go in 2.25 i think.
(e.g. the elf/tst-tls-manydynamic crash is hard to debug without this).

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2][AArch64] Add more cfi annotations to tlsdesc entry points
  2017-01-23 11:31       ` Szabolcs Nagy
@ 2017-02-07 20:26         ` Adhemerval Zanella
  0 siblings, 0 replies; 9+ messages in thread
From: Adhemerval Zanella @ 2017-02-07 20:26 UTC (permalink / raw)
  To: libc-alpha



On 23/01/2017 09:31, Szabolcs Nagy wrote:
> On 06/01/17 15:57, Szabolcs Nagy wrote:
>> On 13/12/16 12:34, Szabolcs Nagy wrote:
>>> Backtrace through _dl_tlsdesc_resolve_rela was broken because the offset
>>> of x30 from cfa was not in the debug info.
>>>
>>> Add enough annotation so backtracing from the dynamic linker through
>>> tlsdesc entry points works and the debugger shows registers correctly.
>>>
>>> v2:
>>> - group cfi_rel_offset annotations for smaller debug info.
>>>
>>> 2016-12-13  Szabolcs Nagy  <szabolcs.nagy@arm.com>
>>>
>>> 	* sysdeps/aarch64/dl-tlsdesc.S (_dl_tlsdesc_dynamic): Add cfi
>>> 	annotation.
>>> 	(_dl_tlsdesc_resolve_rela, _dl_tlsdesc_resolve_hold): Likewise.
>>>
>>
>> ping.
>>
> 
> ping.
> 
> this is a bug fix which should go in 2.25 i think.
> (e.g. the elf/tst-tls-manydynamic crash is hard to debug without this).
> 

Sorry if I did catch this up for 2.25, LGTM.  I think it is worth to at
least backport to 2.25 branch.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2][AArch64] Add more cfi annotations to tlsdesc entry points
  2016-12-13 12:35   ` [PATCH v2][AArch64] " Szabolcs Nagy
  2017-01-06 15:58     ` Szabolcs Nagy
@ 2017-06-21 14:05     ` Szabolcs Nagy
  1 sibling, 0 replies; 9+ messages in thread
From: Szabolcs Nagy @ 2017-06-21 14:05 UTC (permalink / raw)
  To: Richard Henderson, GNU C Library; +Cc: nd, Marcus Shawcroft, Florian Weimer

On 13/12/16 12:34, Szabolcs Nagy wrote:
> Backtrace through _dl_tlsdesc_resolve_rela was broken because the offset
> of x30 from cfa was not in the debug info.
> 
> Add enough annotation so backtracing from the dynamic linker through
> tlsdesc entry points works and the debugger shows registers correctly.
> 
> v2:
> - group cfi_rel_offset annotations for smaller debug info.
> 
> 2016-12-13  Szabolcs Nagy  <szabolcs.nagy@arm.com>
> 
> 	* sysdeps/aarch64/dl-tlsdesc.S (_dl_tlsdesc_dynamic): Add cfi
> 	annotation.
> 	(_dl_tlsdesc_resolve_rela, _dl_tlsdesc_resolve_hold): Likewise.
> 

committed.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-06-21 14:05 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-09 13:23 [PATCH][AArch64] Add more cfi annotations to tlsdesc entry points Szabolcs Nagy
2016-12-09 17:38 ` Richard Henderson
2016-12-13 12:35   ` [PATCH v2][AArch64] " Szabolcs Nagy
2017-01-06 15:58     ` Szabolcs Nagy
2017-01-23 11:31       ` Szabolcs Nagy
2017-02-07 20:26         ` Adhemerval Zanella
2017-06-21 14:05     ` Szabolcs Nagy
2016-12-13 15:05   ` [PATCH][AArch64] " Florian Weimer
2016-12-13 15:11     ` Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).