* Conditionally include ntdll.dll
* Use text relocation instead of GOT
* Use FlushInstructionCache instead of clear_cache for arm64
* Load address in two stages (adrp, add)
* objc_msgSend.aarch64.S add comments
* Add seh directives
* Move .seh_proc into slow sloop section
* Comment out cfi directives
* Substitute raw .seh directives with macros
* Add documentation of SEH annotations
* Detect CPU Architecture with preprocessor
* Cleanup CMakeLists.txt
Co-authored-by: David Chisnall <davidchisnall@users.noreply.github.com>
* Remove line in objc_msgSend.aarch64.S
Co-authored-by: David Chisnall <davidchisnall@users.noreply.github.com>
* Change Test CMakeList to use ARCHITECTURE var
* Use existing clear cache macro
* Change _WIN64 to _WIN32 and reorder labels
* Remove macro and replace _WIN64 with _WIN32
* Remove argument from non-win32 macro
---------
Co-authored-by: David Chisnall <davidchisnall@users.noreply.github.com>
This was generating a relocation that didn't do the right thing and
didn't raise linker errors. Now it is using GOT-relative addressing.
In combination with the last two commits, this now makes all of the
objc_msgSend tests pass on AArch64.
Fixes#105
If we called into C to find the IMP (e.g. for forwarding), we were then
reloading all of the arguments but failing to adjust the stack pointer
by the correct amount, leaving it around 192 bytes offset from its
correct location. This, unsurprisingly, led to crashing and other
exciting behaviour.
An interesting feature of the AArch64 ABI simplifies this code relative to other platforms. AArch64 reserves an extra register (x8) for the address of struct returns, giving the