Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.lang.asm.x86    |    Ahh, the lost art of x86 assembly    |    4,675 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 4,617 of 4,675    |
|    Frederick Virchanza Gotham to Frederick Gotham    |
|    Re: aarch64 (64-Bit ARM) - return by val    |
|    18 Jul 23 03:56:15    |
   
   From: cauldwell.thomas@nospicedham.gmail.com   
      
   On Monday 17 July 2023, Frederick Gotham wrote:   
   >   
   > If I change it to thread_local then try to re-compile, I get a linker error:    
   >    
   > R_AARCH64_ADR_PREL_LO21 used with TLS symbol f    
   >    
   > Do you know what syntax I use to access the thread_local variable from   
   assembler? Will I need to write a separate function as follows?    
      
      
   In order to try understand how thread_local variables are accessed from   
   aarch64 assembler, I wrote the following dynamic shared library in C:   
      
    __thread void (*f)(void);   
      
    void (*g)(void);   
      
    void Func(void)   
    {   
    g = f;   
    }   
      
   I compiled this to 'libtest.so" and then used 'objdump' on it to see:   
      
   
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca