crt: Use naked functions for ARM64 assembly functions.
On ARM64EC, function declarations have additional nuances:
- Function names are mangled by prefixing them with "#"
- An unmangled symbol is defined as a weak anti-dependency alias to the mangled
symbol
- An entry thunk is generated to convert from the x86_64 calling convention to
the ARM64EC calling convention, used by the emulator
- A .hybmp section entry is generated to associate the function with its entry
thunk
The compiler can handle all of this if provided with the necessary information.
Naked functions are the most convenient way to achieve this.
Use naked functions only on Clang. GCC doesn’t support them on ARM targets and
has broken behavior on x86_64 by emitting .seh_endprologue.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
6 files changed