Open lhmouse opened 1 year ago
It looks like
__asm__ ("jmp qword ptr [my_fptr]");
is not valid; I have to add the base register rip
explicitly:
__asm__ ("jmp qword ptr [rip + my_fptr]");
Then the issue is the other way around: If the first piece of code is not valid, clang shall not have accepted it and generated something unspecified.
@llvm/issue-subscribers-backend-x86
Godbolt: https://gcc.godbolt.org/z/acP7Ee73b
The inline asm statement gets compiled as a direct call and will jump to nonexecutable data. (the at&t syntax however doesn't suffer from this issue.)