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

go build: linker error: ld: sectionForAddress(0xA7233E) address not in any section file #41217

Closed
martinrode opened this issue Sep 4, 2020 · 2 comments

Comments

@martinrode
Copy link

martinrode commented Sep 4, 2020

What version of Go are you using (go version)?

$ go version
go version go1.15 darwin/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN="/Users/martin/go/bin"
GOCACHE="/Users/martin/Library/Caches/go-build"
GOENV="/Users/martin/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/martin/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/martin/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/martin/go/src/github.com/programmfabrik/fylr/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/4f/l31kb4n521d6g89qxrwcx69h0000gp/T/go-build442514421=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

Run "go build"

The code failing is in a private repo. I can give someone access if needed.

What did you expect to see?

go build should not fail

What did you see instead?

/usr/local/go/pkg/tool/darwin_amd64/link: running clang failed: exit status 1
ld: sectionForAddress(0xA7233E) address not in any section file '/var/folders/4f/l31kb4n521d6g89qxrwcx69h0000gp/T/go-link-742064742/go.o' for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

make: *** [ctl] Error 2
  • Other programs in my go environment compile fine
  • I ran "go clean -cache -modcache -r", did not help
  • First time I see such a problem
  • Code compiles fine with go1.14.3
@tpaschalis
Copy link
Contributor

tpaschalis commented Sep 4, 2020

Hello, and thanks for opening this issue! Do you think this is a duplicate of #40974?
The OP there also had this problem after upgrading to 1.15; people have already started a small discussion there too.

@martinrode
Copy link
Author

Hello, and thanks for opening this issue! Do you think this is a duplicate of #40974?
The OP there also had this problem after upgrading to 1.15; people have already started a small discussion there too.

Checking one of the solutions suggested in #40974 I assume that the problems are the same and that this ticket can be closed as duplicate.

martin:~/go/src/github.com/programmfabrik/fylr/fylrctl$ go build -ldflags='-w' 
martin:~/go/src/github.com/programmfabrik/fylr/fylrctl$ go build 
# github.com/programmfabrik/fylr/fylrctl
/usr/local/go/pkg/tool/darwin_amd64/link: running clang failed: exit status 1
ld: sectionForAddress(0xA7231E) address not in any section file '/var/folders/4f/l31kb4n521d6g89qxrwcx69h0000gp/T/go-link-846450234/go.o' for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@golang golang locked and limited conversation to collaborators Sep 4, 2021
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