Commit 6252b419 authored by Russ Cox's avatar Russ Cox

runtime: remove OABI check from ARM startup

The code in question is trying to print a nice error message
when a Go EABI binary runs on an OABI machine.
Unfortunately, the only way to do that is to use
ARM Thumb instructions, which we otherwise don't use.

There exist ARM EABI machines that do not support Thumb.
We could run on them if not for this OABI check, so disable it.

Fixes #5685.

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/13234050
parent 9c21ce54
...@@ -22,31 +22,36 @@ TEXT _rt0_arm_linux1(SB),NOSPLIT,$-4 ...@@ -22,31 +22,36 @@ TEXT _rt0_arm_linux1(SB),NOSPLIT,$-4
// Save argc and argv // Save argc and argv
MOVM.DB.W [R0-R1], (R13) MOVM.DB.W [R0-R1], (R13)
// set up sa_handler
MOVW $bad_abi<>(SB), R0 // sa_handler // Thumb mode OABI check disabled because there are some
MOVW $0, R1 // sa_flags // EABI systems that do not support Thumb execution.
MOVW $0, R2 // sa_restorer // We can run on them except for this check!
MOVW $0, R3 // sa_mask
MOVM.DB.W [R0-R3], (R13) // // set up sa_handler
MOVW $4, R0 // SIGILL // MOVW $bad_abi<>(SB), R0 // sa_handler
MOVW R13, R1 // sa // MOVW $0, R1 // sa_flags
SUB $16, R13 // MOVW $0, R2 // sa_restorer
MOVW R13, R2 // old_sa // MOVW $0, R3 // sa_mask
MOVW $8, R3 // c // MOVM.DB.W [R0-R3], (R13)
MOVW $174, R7 // sys_sigaction // MOVW $4, R0 // SIGILL
BL oabi_syscall<>(SB) // MOVW R13, R1 // sa
// SUB $16, R13
// MOVW R13, R2 // old_sa
// MOVW $8, R3 // c
// MOVW $174, R7 // sys_sigaction
// BL oabi_syscall<>(SB)
// do an EABI syscall // do an EABI syscall
MOVW $20, R7 // sys_getpid MOVW $20, R7 // sys_getpid
SWI $0 // this will trigger SIGILL on OABI systems SWI $0 // this will trigger SIGILL on OABI systems
MOVW $4, R0 // SIGILL // MOVW $4, R0 // SIGILL
MOVW R13, R1 // sa // MOVW R13, R1 // sa
MOVW $0, R2 // old_sa // MOVW $0, R2 // old_sa
MOVW $8, R3 // c // MOVW $8, R3 // c
MOVW $174, R7 // sys_sigaction // MOVW $174, R7 // sys_sigaction
SWI $0 // restore signal handler // SWI $0 // restore signal handler
ADD $32, R13 // ADD $32, R13
SUB $4, R13 // fake a stack frame for runtime·setup_auxv SUB $4, R13 // fake a stack frame for runtime·setup_auxv
BL runtime·setup_auxv(SB) BL runtime·setup_auxv(SB)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment