I want to try emulate this behaviour on aarch64 on Linux. When my assembler function is entered, I want it to do two things:
(1) Put the address of the indirect return object into the first parameter register, i.e. move X8 to X0
(2) Jump to a location specified by a global function pointer
So here's how I think my assembler function should look:
__asm("Invoke: \n"
" mov x0, x8 \n" // move return value address into 1st parameter
" mov x9, f \n" // Load address of code into register
" br x9 \n" // Jump to code
);
I don't know what's wrong here but it doesn't work.
If you're using gcc, you may need to specify volatile.
If you're using gcc, you may need to specify volatile.
If I change it to thread_local then try to re-compile, I get a linker error:In order to try understand how thread_local variables are accessed from aarch64 assembler, I wrote the following dynamic shared library in C:
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?
Can anyone please help me understand this? And explore how I would goSorry, you must have the wrong newsgroup. This is for *INTEL* x86
about writing aarch64 to access a thread_local variable called 'f'?
| Sysop: | Amessyroom |
|---|---|
| Location: | Fayetteville, NC |
| Users: | 65 |
| Nodes: | 6 (0 / 6) |
| Uptime: | 13:14:26 |
| Calls: | 862 |
| Files: | 1,311 |
| D/L today: |
7 files (11,196K bytes) |
| Messages: | 265,448 |