From 81afb49809eb4edb7701bed82a8adc64f4bd5bd2 Mon Sep 17 00:00:00 2001 From: Charles Crayne Date: Sat, 1 Nov 2008 17:09:36 -0700 Subject: Document differences between TLS coding in ELF32 and ELF64 Absolute relocation wrt ..tlsie for ELF32 Relative relocation wrt ..gottpoff for ELF64 --- doc/nasmdoc.src | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'doc') diff --git a/doc/nasmdoc.src b/doc/nasmdoc.src index 35ba19b..a79a318 100644 --- a/doc/nasmdoc.src +++ b/doc/nasmdoc.src @@ -5397,9 +5397,18 @@ shared libraries entirely in NASM is given in \k{picdll}. \S{elftls} \i{Thread Local Storage}\I{TLS}: \c{elf} Special Symbols and \i\c{WRT} +\b In ELF32 mode, referring to an external or global symbol using +\c{wrt ..tlsie} \I\c{..tlsie} +causes the linker to build an entry \e{in} the GOT containing the +offset of the symbol within the TLS block, so you can access the value +of the symbol with code such as: + +\c mov eax,[tid wrt ..tlsie] +\c mov dword [gs:eax],ebx -\b Referring to an external or global symbol using \c{wrt ..gottpoff} \I\c{..gottpoff} +\b In ELF64 mode, referring to an external or global symbol using +\c{wrt ..gottpoff} \I\c{..gottpoff} causes the linker to build an entry \e{in} the GOT containing the offset of the symbol within the TLS block, so you can access the value of the symbol with code such as: @@ -5407,7 +5416,6 @@ of the symbol with code such as: \c mov rax,[rel tid wrt ..gottpoff] \c mov rcx, [fs:rax] -(Please note that this feature is currently implemented only for ELF64.) \S{elfglob} \c{elf} Extensions to the \c{GLOBAL} Directive\I{GLOBAL, elf extensions to}\I{GLOBAL, aoutb extensions to} -- cgit v1.2.3