[PATCH] powerpc64: Implement TLS using PC-relative addressing
Florian Weimer
fweimer@redhat.com
Thu Oct 1 08:49:43 GMT 2020
* Tulio Magno Quites Machado Filho via Libc-alpha:
> diff --git a/sysdeps/powerpc/mod-tlsopt-powerpc.c b/sysdeps/powerpc/mod-tlsopt-powerpc.c
> index ee0db12a73..5856dab60b 100644
> --- a/sysdeps/powerpc/mod-tlsopt-powerpc.c
> +++ b/sysdeps/powerpc/mod-tlsopt-powerpc.c
> @@ -24,7 +24,14 @@ tls_get_addr_opt_test (void)
> tls_index *tls_arg;
> #ifdef __powerpc64__
> register unsigned long thread_pointer __asm__ ("r13");
> + /* PC-relative addressing is available when compiling with -mpcrel.
> + The first releases of GCC 10 do support -mpcrel, but do not export
> + __PCREL__. */
> +# if defined(__PCREL__) || __GNUC__ <= 10 && defined(_ARCH_PWR10)
> + asm ("pla %0,foo@got@tlsgd@pcrel" : "=r" (tls_arg));
> +# else
> asm ("addi %0,2,foo@got@tlsgd" : "=r" (tls_arg));
> +# endif
Should this check for binutils support for @pcrel? Or won't GCC enable
_ARCH_PWR10 in this case?
Thanks,
Florian
--
Red Hat GmbH, https://de.redhat.com/ , Registered seat: Grasbrunn,
Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Charles Cachera, Brian Klemm, Laurie Krebs, Michael O'Neill
More information about the Libc-alpha
mailing list