Following is a simple shared object with thread local storage. The syntax in the section TLS_Test_fn is taken from section "7.9.4 Thread Local Storage in ELF: elf Special Symbols and WRT" in the NASM 2.13.02 manual (corresponding to the version installed on my Ubuntu 18.04).
The two lines that that uses the TLS variable are:
mov rax,[rel MQ_FDes_Core wrt ..gottpoff]
mov rcx,[fs:rax]
I assemble with NASM assembler:
sudo nasm -f elf64 -g -F dwarf TLS_Test.asm
and I get:
"TLS_Test.asm:24: error: unable to find a suitable global symbol for this reference"
If I write it as mov rax,[MQ_FDes_Core wrt ..gottpoff] I get the same error.
DQFanSurvey.com