Hacker News new | ask | show | jobs
by crest 282 days ago
Afaik runtime linkers can't convert a function call into a single non-call instruction.
1 comments

Linux kernel has an interesting optimization using the ALTERNATIVE macro, where you can directly specify one of two instructions and it will be patched at runtime depending on cpu flags. No function calls needed (although you can have a function call as one of the instructions). It's a bit more messy in userspace where you have to respect platform page flags, etc. but it should be possible.