aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/rt0_android_386.s
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2017-10-12 19:46:42 -0700
committerIan Lance Taylor <iant@golang.org>2017-10-17 04:03:16 +0000
commit378de1ae43c6406ae5159f235f834da73403a541 (patch)
treeeec430c0572070482cb70e678fd48d54a77fe3c6 /src/runtime/rt0_android_386.s
parent151c66b59fb657c90d2cad4c72b2059319806a9c (diff)
downloadgo-378de1ae43c6406ae5159f235f834da73403a541.tar.gz
go-378de1ae43c6406ae5159f235f834da73403a541.zip
runtime: unify 386 entry point code
Unify the 386 entry point code as much as possible. The main function could not be unified because on Windows 386 it is called _main. Putting main in asm_386.s caused multiple definition errors when using the external linker. Add the _lib entry point to various operating systems. A future CL will enable c-archive/c-shared mode for those targets. Fix _rt0_386_windows_lib_go--it was passing arguments as though it were amd64. Change-Id: Ic73f1c95cdbcbea87f633f4a29bbc218a5db4f58 Reviewed-on: https://go-review.googlesource.com/70530 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Austin Clements <austin@google.com>
Diffstat (limited to 'src/runtime/rt0_android_386.s')
-rw-r--r--src/runtime/rt0_android_386.s14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/runtime/rt0_android_386.s b/src/runtime/rt0_android_386.s
index 9d20fc8f89..eabdf81235 100644
--- a/src/runtime/rt0_android_386.s
+++ b/src/runtime/rt0_android_386.s
@@ -4,21 +4,13 @@
#include "textflag.h"
-TEXT _rt0_386_android(SB),NOSPLIT,$8
- MOVL 8(SP), AX // argc
- LEAL 12(SP), BX // argv
- MOVL AX, 0(SP)
- MOVL BX, 4(SP)
- CALL main(SB)
- INT $3
+TEXT _rt0_386_android(SB),NOSPLIT,$0
+ JMP _rt0_386(SB)
TEXT _rt0_386_android_lib(SB),NOSPLIT,$0
PUSHL $_rt0_386_android_argv(SB) // argv
PUSHL $1 // argc
- CALL _rt0_386_linux_lib(SB)
- POPL AX
- POPL AX
- RET
+ JMP _rt0_386_lib(SB)
DATA _rt0_386_android_argv+0x00(SB)/4,$_rt0_386_android_argv0(SB)
DATA _rt0_386_android_argv+0x04(SB)/4,$0 // argv terminate