Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This got me curious so I looked it up. My understanding is yes on ARM32, not sure on ARM64, and yes with only minor indirection on x86 and x86_64. For example (x86, untested):

  call 0
  pop eax
  shl eax 1
  jmp eax
Note that using call 0 in this way doesn't trash the return address predictor because it is special cased (since at least Pentium Pro as far as I could find).


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: