PC-relative TLS support

Segher Boessenkool segher@kernel.crashing.org
Thu Aug 15 19:47:00 GMT 2019


Hi!

On Thu, Aug 15, 2019 at 01:35:10PM +0930, Alan Modra wrote:
> Supporting TLS for -mpcrel turns out to be relatively simple, in part
> due to deciding that !TARGET_TLS_MARKERS with -mpcrel is silly.  No
> assembler that I know of supporting prefix insns lacks TLS marker
> support.

Will this stay that way?  (Or do we not care, not now anyway?)

> Also, at some point powerpc gcc ought to remove
> !TARGET_TLS_MARKERS generally and simplify all the occurrences of
> IS_NOMARK_TLSGETADDR in rs6000.md rather than complicating them.

The last time this came up (a year ago) the conclusion was that we first
would have to remove AIX support.

>         * config/rs6000/predicates.md (unspec_tls): Allow const0_rtx for got
> 	element of unspec vec.
>         * config/rs6000/rs6000.c (rs6000_option_override_internal): Disable
> 	-mpcrel if -mno-tls-markers.
> 	(rs6000_legitimize_tls_address): Support PC-relative TLS.
>         * config/rs6000/rs6000.md (UNSPEC_TLSTLS_PCREL): New unspec.
> 	(tls_gd_pcrel, tls_ld_pcrel): New insns.
>         (tls_dtprel, tls_tprel): Set attr prefixed when tls_size is not 16.
>         (tls_got_tprel_pcrel, tls_tls_pcrel): New insns.

(Changelog has whitespace damage, I guess that is just from how you
mailed this?  Please fix when applying it).

The patch is fine when its prerequisites are in.  Thanks,


Segher



More information about the Gcc-patches mailing list