From 6252b41981a5e5566b727de14cda5aece4bee98f Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Mon, 9 Sep 2013 15:06:05 -0400 Subject: [PATCH] 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 --- src/pkg/runtime/rt0_linux_arm.s | 45 ++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/src/pkg/runtime/rt0_linux_arm.s b/src/pkg/runtime/rt0_linux_arm.s index 63133e9ade..309fa2f79d 100644 --- a/src/pkg/runtime/rt0_linux_arm.s +++ b/src/pkg/runtime/rt0_linux_arm.s @@ -22,31 +22,36 @@ TEXT _rt0_arm_linux1(SB),NOSPLIT,$-4 // Save argc and argv MOVM.DB.W [R0-R1], (R13) - // set up sa_handler - MOVW $bad_abi<>(SB), R0 // sa_handler - MOVW $0, R1 // sa_flags - MOVW $0, R2 // sa_restorer - MOVW $0, R3 // sa_mask - MOVM.DB.W [R0-R3], (R13) - MOVW $4, R0 // SIGILL - 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) + + // Thumb mode OABI check disabled because there are some + // EABI systems that do not support Thumb execution. + // We can run on them except for this check! + + // // set up sa_handler + // MOVW $bad_abi<>(SB), R0 // sa_handler + // MOVW $0, R1 // sa_flags + // MOVW $0, R2 // sa_restorer + // MOVW $0, R3 // sa_mask + // MOVM.DB.W [R0-R3], (R13) + // MOVW $4, R0 // SIGILL + // 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 MOVW $20, R7 // sys_getpid SWI $0 // this will trigger SIGILL on OABI systems - MOVW $4, R0 // SIGILL - MOVW R13, R1 // sa - MOVW $0, R2 // old_sa - MOVW $8, R3 // c - MOVW $174, R7 // sys_sigaction - SWI $0 // restore signal handler - ADD $32, R13 + // MOVW $4, R0 // SIGILL + // MOVW R13, R1 // sa + // MOVW $0, R2 // old_sa + // MOVW $8, R3 // c + // MOVW $174, R7 // sys_sigaction + // SWI $0 // restore signal handler + // ADD $32, R13 SUB $4, R13 // fake a stack frame for runtime·setup_auxv BL runtime·setup_auxv(SB) -- 2.48.1