Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/link: go initialization fails missing _rt0_arm_linux1 #10067

Closed
rakyll opened this issue Mar 3, 2015 · 8 comments
Closed

cmd/link: go initialization fails missing _rt0_arm_linux1 #10067

rakyll opened this issue Mar 3, 2015 · 8 comments
Milestone

Comments

@rakyll
Copy link
Contributor

rakyll commented Mar 3, 2015

I'm building the basic example with the tip version of gomobile and Go.

gomobile install golang.org/x/mobile/example/basic # and run the app

W/linker  (17106): libbasic.so has text relocations. This is wasting memory and prevents security hardening. Please fix.
F/Go      (17106): missing _rt0_arm_linux1
F/libc    (17106): Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 17123 (Thread-1471)
I/libc    (17106): Suppressing debuggerd output because prctl(PR_GET_DUMPABLE)==0
I/Zygote  (  199): Process 17106 exited due to signal (11)
I/ActivityManager(  755): Process com.example.basic (pid 17106) has died
I/ActivityManager(  755): Start proc 17124:com.example.basic/u0a129 for activity com.example.basic/android.app.NativeActivity
@crawshaw
Copy link
Member

crawshaw commented Mar 3, 2015

What revision of Go?

Can you nm your .so file (with arm-linux-androideabi-nm) and see if the symbol is there, and what state it is in? The actual symbol is still in the runtime, so at a guess the symbol is in some unreachable state due to a recent linker change.

@rakyll
Copy link
Contributor Author

rakyll commented Mar 3, 2015

go version
go version devel +0153137 Tue Mar 3 20:34:07 2015 +0000 darwin/amd64

arm-linux-androideabi-nm lib/armeabi/libbasic.so | grep _rt0_arm_linux1
000cdb58 t _rt0_arm_linux1
00292558 b _rt0_arm_linux1

@minux
Copy link
Member

minux commented Mar 3, 2015 via email

@crawshaw
Copy link
Member

crawshaw commented Mar 3, 2015

Right, the lower case t and b mean the symbol is local. Until very recently it was exported (and nm showed an upper case T and B).

@crawshaw
Copy link
Member

crawshaw commented Mar 3, 2015

//go:cgo_export_dynamic _rt0_arm_linux1 is just where it has always been in os_android_arm.go.

I'm tempted to try git bisect to find which CL broke this, but my workspace is a mess with darwin/arm. Does someone else want to take it? If not, I'll probably get to this tomorrow afternoon.

@minux
Copy link
Member

minux commented Mar 3, 2015 via email

@minux
Copy link
Member

minux commented Mar 4, 2015

The problem is that in go.o, the symbol is GLOBAL with HIDDEN visibility:
1279: 00045360 16 FUNC GLOBAL HIDDEN 1 _rt0_arm_linux1

@minux minux self-assigned this Mar 4, 2015
@minux minux closed this as completed in 60b8908 Mar 4, 2015
@rakyll
Copy link
Contributor Author

rakyll commented Mar 4, 2015

I can confirm that gomobile apk builds are running properly now. Thanks @minux.

@mikioh mikioh changed the title mobile: go initialization fails missing _rt0_arm_linux1 cmd/link: go initialization fails missing _rt0_arm_linux1 Aug 5, 2015
@mikioh mikioh added this to the Go1.5 milestone Aug 5, 2015
@golang golang locked and limited conversation to collaborators Aug 5, 2016
@rsc rsc unassigned minux Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants