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/ld: unhandled relocation using swig and cgo #5545

Closed
gopherbot opened this issue May 23, 2013 · 5 comments
Closed

cmd/ld: unhandled relocation using swig and cgo #5545

gopherbot opened this issue May 23, 2013 · 5 comments
Milestone

Comments

@gopherbot
Copy link

by extrafLIU:

What steps will reproduce the problem?
If possible, include a link to a program on play.golang.org.
1. unzip test.zip
2. cd ./test make make the current dir as GOPATH
3. go build exe

What is the expected output?

compile success

What do you see instead?

# exe
x_wrap_CPPTester_GetLen: unhandled relocation for _wrap_CPPTester_GetLen (type 28 rtype
120)
x_wrap_CPPTester_GetLen: missing section for _wrap_CPPTester_GetLen
x_wrap_new_CPPTester: unhandled relocation for _wrap_new_CPPTester (type 28 rtype 120)
x_wrap_new_CPPTester: missing section for _wrap_new_CPPTester
x_wrap_CPPTester_GetLen: reloc 120 to non-elf symbol _wrap_CPPTester_GetLen
(outer=_wrap_CPPTester_GetLen) 28
x_wrap_new_CPPTester: reloc 120 to non-elf symbol _wrap_new_CPPTester
(outer=_wrap_new_CPPTester) 28

Which compiler are you using (5g, 6g, 8g, gccgo)?

6g

Which operating system are you using?

ubuntu 12.10 x64

Which version are you using?  (run 'go version')

1.1

Please provide any additional information below.

Attachments:

  1. test.zip (8920 bytes)
@rsc
Copy link
Contributor

rsc commented Jul 30, 2013

Comment 1:

Do you still see this if you pass -ldflags=-linkmode=external to the go command?

Labels changed: added priority-later, removed priority-triage.

Status changed to Accepted.

@rsc
Copy link
Contributor

rsc commented Jul 30, 2013

Comment 2:

Labels changed: added go1.2.

@ianlancetaylor
Copy link
Contributor

Comment 3:

This should be fixed on tip.  Please reopen if not.  Thanks.

Status changed to Fixed.

@gopherbot
Copy link
Author

Comment 4 by Sbarra.Paul:

I'm still seeing this behavior when trying to build the swig tutorial example from tip.
compiler: 6g
OS: Arch linux
go version devel +24ea55b48f9f Sun Sep 29 10:34:41 2013 +1000 linux/amd64
procedure:
extract attached and set GOPATH to the root folder
cd go/src/example
go build
go install
cd ../hello
go build
result:
# hello
x_wrap_fact: unhandled relocation for _wrap_fact (type 28 rtype 120)
x_wrap_fact: missing section for _wrap_fact
x_wrap_fact: reloc 120 to non-elf symbol _wrap_fact (outer=_wrap_fact) 28

Attachments:

  1. example.zip (1696 bytes)

@ianlancetaylor
Copy link
Contributor

Comment 5:

Thanks for the example, but please open a new issue as this one is fixed.  We don't want
to keep reopening the issue just because we see similar symptoms; it's still a different
bug.  Thanks.

@rsc rsc added this to the Go1.2 milestone Apr 14, 2015
@rsc rsc removed the go1.2 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
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

3 participants