I noticed that, unlike GNU as (GAS), the LLVM-internal assembler, which is used by Rust, doesn't allow using jmp %rax
. The compiler errors with "mnemonic without a size suffix". If I try adding a size suffix like this jmpq %rax
, it doesn't work either.
Minimal reproducer:
core::arch::global_asm!(
"foo:",
"mov $ffffffff88000000, %rax",
"jmp %rax"
, options(att_syntax));
fn main() {
}
When I compile this assembly code with GAS, objdump
shows jmpq *%rax
.