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: illegal text-relocation for c-archive darwin/amd64 #14217

Closed
azinman opened this issue Feb 4, 2016 · 5 comments
Closed

cmd/link: illegal text-relocation for c-archive darwin/amd64 #14217

azinman opened this issue Feb 4, 2016 · 5 comments

Comments

@azinman
Copy link
Contributor

azinman commented Feb 4, 2016

When compiling using buildmode c-archive on darwin/amd64 (targeting the iOS simulator), I run into this error when trying to link the resulting archive to my Swift code:

ld: illegal text-relocation to 'type..eq.[0]encoding/xml.Attr' in .../lib.a(go.o) from 'runtime.rodata' in .../lib.a(go.o) for architecture x86_64

Looking at the cmd/link/internal/ld/macho.go, it seems that it currently is only checking for shared archives on amd64 when it chooses to use the DATA segment over TEXT.

@azinman
Copy link
Contributor Author

azinman commented Feb 4, 2016

Proposed CL is here: https://go-review.googlesource.com/#/c/19206

@ianlancetaylor ianlancetaylor modified the milestones: Go1.6Maybe, Go1.7 Feb 4, 2016
@gopherbot
Copy link

CL https://golang.org/cl/19206 mentions this issue.

@dcu
Copy link

dcu commented Mar 29, 2016

would it be possible to include this for go 1.6.1? It's kind of blocking my team

@ianlancetaylor ianlancetaylor modified the milestones: Go1.6.1, Go1.7 Mar 29, 2016
@minux
Copy link
Member

minux commented Mar 30, 2016 via email

@adg adg added the Release-OK label Apr 7, 2016
@adg adg modified the milestones: Go1.6.1, Go1.6.2 Apr 7, 2016
@gopherbot
Copy link

CL https://golang.org/cl/22046 mentions this issue.

gopherbot pushed a commit that referenced this issue Apr 14, 2016
The existing implementation deals with absolute relocations in __TEXT
for darwin/amd64 in build-mode c-shared, but it ignores c-archive.
This results in issues when trying to use a c-archive in an iOS
app on the 64-bit simulator. This patch adds c-archive to the
handling of this issue.

Fixes #14217

Change-Id: I2e4d5193caa531171ad22fd0cd420a8bfb4646a6
Reviewed-on: https://go-review.googlesource.com/19206
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-on: https://go-review.googlesource.com/22046
@golang golang locked and limited conversation to collaborators Apr 19, 2017
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

6 participants