diff options
author | Mikael Pettersson <[email protected]> | 2015-01-11 13:35:25 +0100 |
---|---|---|
committer | Mikael Pettersson <[email protected]> | 2015-01-11 13:35:25 +0100 |
commit | 132f27299130a5183d14122c71f9c23587e4945e (patch) | |
tree | 4ebf5f534cdf4c13373f454c77a41a8f08a52b00 /otp_build | |
parent | aee18f309d41691019fc323bd41c5f78be49953b (diff) | |
download | otp-132f27299130a5183d14122c71f9c23587e4945e.tar.gz otp-132f27299130a5183d14122c71f9c23587e4945e.tar.bz2 otp-132f27299130a5183d14122c71f9c23587e4945e.zip |
hipe: fix ARM/Thumb interworking
HiPE on ARM is currently severely broken if the rest of the VM is
compiled to run in Thumb mode -- calling native code quickly ends
up executing code in the wrong mode and crashing the VM. This is
a problem on e.g. Ubuntu which configures its system GCC to generate
Thumb by default. It can also be triggered by overriding CC or
CFLAGS when compiling the VM.
There were three issues that caused the breakage:
1. Assembly-coded functions in hipe_arm_glue.S weren't explicitly
tagged as functions, preventing the linker from generating the
correct mode-switching call instructions for calls from C to
these functions.
Fixed by tagging those symbols as functions.
2. A few BIF wrappers were so simple that they performed tailcalls
to the C BIFs. This fails to switch mode when C is in Thumb.
Fixed by performing ordinary recursive calls when C is in Thumb.
3. The assembly-coded source files weren't explicitly tagged as ARM.
Tested with the HiPE testsuite on ARMv7, with the VM built as ARM
and as Thumb. Also manually inspected the object code for the beam
executable and checked that call sites from C to HiPE's ARM runtime
code and vice versa used the correct mode-switching instructions.
Diffstat (limited to 'otp_build')
0 files changed, 0 insertions, 0 deletions