NASM - The Netwide Assembler
NASM Forum => Programming with NASM => Topic started by: Sharlenehargrove on February 01, 2023, 09:20:01 AM
-
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
(https://www.dqfansurvey.one/)
-
Dunno.
Your code looks just like the manual.
Also see the next section on extensions to "global"... and that they are necessary! Could that be your problem?
Best,
Frank