Re: [PATCH 06/27] [AARCH64] Use PTR_REG/PTR_SIZE/PTR_SIZE_LOG in dl-tlsesc.S

From: Andreas Schwab
Date: Tue Jun 21 2016 - 04:06:29 EST


Yury Norov <ynorov@xxxxxxxxxxxxxxxxxx> writes:

> From: Andrew Pinski <apinski@xxxxxxxxxx>
>
> This converts dl-tlsdesc.S code over to use the new macros which allows for
> sharing between ILP32 and LP64 code.
>
> * sysdeps/aarch64/dl-tlsdesc.S (_dl_tlsdesc_return): Use PTR_REG.
> (_dl_tlsdesc_undefweak): Use PTR_REG, PTR_SIZE.
> (_dl_tlsdesc_dynamic): Likewise.
> (_dl_tlsdesc_resolve_rela): Likewise.
> (_dl_tlsdesc_resolve_hold): Likewise.

I think you also need to fix _dl_tlsdesc_return_lazy.

>
> Signed-off-by: Yury Norov <ynorov@xxxxxxxxxxxxxxxxxx>
> ---
> sysdeps/aarch64/dl-tlsdesc.S | 36 ++++++++++++++++++------------------
> 1 file changed, 18 insertions(+), 18 deletions(-)
>
> diff --git a/sysdeps/aarch64/dl-tlsdesc.S b/sysdeps/aarch64/dl-tlsdesc.S
> index 05be370..fe8a17d 100644
> --- a/sysdeps/aarch64/dl-tlsdesc.S
> +++ b/sysdeps/aarch64/dl-tlsdesc.S
> @@ -74,7 +74,7 @@
> cfi_startproc
> .align 2
> _dl_tlsdesc_return:
> - ldr x0, [x0, #8]
> + ldr PTR_REG (0), [x0, #PTR_SIZE]
> RET
> cfi_endproc
> .size _dl_tlsdesc_return, .-_dl_tlsdesc_return
> @@ -126,9 +126,9 @@ _dl_tlsdesc_undefweak:
> td->entry in _dl_tlsdesc_resolve_rela_fixup ensuring that the load
> from [x0,#8] here happens after the initialization of td->arg. */
> ldar xzr, [x0]

Does that need to be PTR_REG(zr)?

> - ldr x0, [x0, #8]
> + ldr PTR_REG (0), [x0, #PTR_SIZE]
> mrs x1, tpidr_el0
> - sub x0, x0, x1
> + sub PTR_REG (0), PTR_REG (0), PTR_REG (1)
> ldr x1, [sp], #16
> cfi_adjust_cfa_offset (-16)
> RET
> @@ -189,20 +189,20 @@ _dl_tlsdesc_dynamic:
> td->entry in _dl_tlsdesc_resolve_rela_fixup ensuring that the load
> from [x0,#8] here happens after the initialization of td->arg. */
> ldar xzr, [x0]

Likewise.

Andreas.

--
Andreas Schwab, SUSE Labs, schwab@xxxxxxx
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."