I also tried using UNSPEC_PCREL instead of making a new UNSPEC_TLS_WIN32 enumeration, but it unfortunately didn't recognise the resulting RTL. Perhaps something for another day
On Tue, Oct 8, 2024 at 5:19 PM Eric Botcazou <botca...@adacore.com> wrote: > > Thanks for the patch! You certainly worked that out faster than I could > > create a reproducer. It's a bit late for me now, so I'll have to try it > out > > tomorrow. Note however that in the final patch I will be only doing TLS > for > > mingw32.h and not cygming.h. The reason for this is that Cygwin likely > > cannot support Windows TLS since it lacks the special TLS slot marker > > _tls_index. Essentially, only the MinGW runtime supports Windows TLS, > > whatever runtime Cygwin uses does not, so implementing this for Cygwin as > > well would not work out > > I see, thanks, revised patch attached. And while adding support for > 32-bit > TLS, I realized that the massaging code added to legitimize_pic_address > pessimizes the generated code and all of this can be avoided by tweaking > the > PIC part of ix86_legitimate_address_p and treating UNSPEC_SECREL32 > specially. > > -- > Eric Botcazou