-
- Downloads
LoongArch: Use explicit relocs for TLS access with -mexplicit-relocs=auto
The linker does not know how to relax TLS access for LoongArch, so let's emit machine instructions with explicit relocs for TLS. gcc/ChangeLog: * config/loongarch/loongarch.cc (loongarch_explicit_relocs_p): Return true for TLS symbol types if -mexplicit-relocs=auto. (loongarch_call_tls_get_addr): Replace TARGET_EXPLICIT_RELOCS with la_opt_explicit_relocs != EXPLICIT_RELOCS_NONE. (loongarch_legitimize_tls_address): Likewise. * config/loongarch/loongarch.md (@tls_low<mode>): Remove TARGET_EXPLICIT_RELOCS from insn condition. gcc/testsuite/ChangeLog: * gcc.target/loongarch/explicit-relocs-auto-tls-ld-gd.c: New test. * gcc.target/loongarch/explicit-relocs-auto-tls-le-ie.c: New test.
Showing
- gcc/config/loongarch/loongarch.cc 24 additions, 13 deletionsgcc/config/loongarch/loongarch.cc
- gcc/config/loongarch/loongarch.md 1 addition, 1 deletiongcc/config/loongarch/loongarch.md
- gcc/testsuite/gcc.target/loongarch/explicit-relocs-auto-tls-ld-gd.c 9 additions, 0 deletions...ite/gcc.target/loongarch/explicit-relocs-auto-tls-ld-gd.c
- gcc/testsuite/gcc.target/loongarch/explicit-relocs-auto-tls-le-ie.c 6 additions, 0 deletions...ite/gcc.target/loongarch/explicit-relocs-auto-tls-le-ie.c
Loading
Please register or sign in to comment