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: missing section for relocation target #30768

Open
csqshz opened this Issue Mar 12, 2019 · 3 comments

Comments

Projects
None yet
2 participants
@csqshz
Copy link

csqshz commented Mar 12, 2019

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

$ go version
go version go1.12 linux/amd64

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

My host is ubuntu 1404.

go env Output
$ go env
GOARCH="amd64"                                                                                                                               
GOBIN=""
GOCACHE="/folk/hsong/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/ala-lpggp22/hsong/poky/build/tmp/work/core2-64-poky-linux/consul/git-r0/build"
GOPROXY=""
GORACE=""
GOROOT="/ala-lpggp22/hsong/poky/build/tmp/work/core2-64-poky-linux/consul/git-r0/recipe-sysroot/usr/lib/go"
GOTMPDIR="/ala-lpggp22/hsong/poky/build/tmp/work/core2-64-poky-linux/consul/git-r0/go-tmp"
GOTOOLDIR="/ala-lpggp22/hsong/poky/build/tmp/work/core2-64-poky-linux/consul/git-r0/recipe-sysroot-native/usr/lib/x86_64-poky-linux/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="x86_64-poky-linux-gcc -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/ala-lpggp22/hsong/poky/build/tmp/work/core2-64-poky-linux/consul/git-r0/recipe-sysroot"
CXX="x86_64-poky-linux-g++ -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/ala-lpggp22/hsong/poky/build/tmp/work/core2-64-poky-linux/consul/git-r0/recipe-sysroot"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=/ala-lpggp22/hsong/poky/build/tmp/work/core2-64-poky-linux/consul/git-r0=/usr/src/debug/consul/git-r0 -fdebug-prefix-map=/ala-lpggp22/hsong/poky/build/tmp/work/core2-64-poky-linux/consul/git-r0=/usr/src/debug/consul/git-r0 -fdebug-prefix-map=/ala-lpggp22/hsong/poky/build/tmp/work/core2-64-poky-linux/consul/git-r0/recipe-sysroot= -fdebug-prefix-map=/ala-lpggp22/hsong/poky/build/tmp/work/core2-64-poky-linux/consul/git-r0/recipe-sysroot-native="
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=/ala-lpggp22/hsong/poky/build/tmp/work/core2-64-poky-linux/consul/git-r0=/usr/src/debug/consul/git-r0 -fdebug-prefix-map=/ala-lpggp22/hsong/poky/build/tmp/work/core2-64-poky-linux/consul/git-r0=/usr/src/debug/consul/git-r0 -fdebug-prefix-map=/ala-lpggp22/hsong/poky/build/tmp/work/core2-64-poky-linux/consul/git-r0/recipe-sysroot= -fdebug-prefix-map=/ala-lpggp22/hsong/poky/build/tmp/work/core2-64-poky-linux/consul/git-r0/recipe-sysroot-native= -fvisibility-inlines-hidden"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fstack-protector-strong -Wl,-z,relro,-z,now"
PKG_CONFIG="pkg-config"

What did you do?

I use Yocto-project to build consul.
It works with go-1.11 but compile failed with go-1.12.
I found that If I remove -linkshared argument, it also works with go-1.12

The error info is as following:
# github.com/hashicorp/consul/connect/certgen
type..eUfRrckI: missing section for relocation target type..FEeY9FdU
type..eUfRrckI: reloc 8 (R_CALL) to non-elf symbol type..FEeY9FdU (outer=type..FEeY9FdU) 49 (SABIALIAS)
# github.com/hashicorp/consul
type..eUfRrckI: missing section for relocation target type..FEeY9FdU
type..K6Uq9NPs: missing section for relocation target type..tBBUxeDj

The above prompts are from /usr/lib/go-1.12/src/cmd/link/internal/ld/data.go

Attachment is my bash script which contains go install command.
It failed at line:130(-linkshared):

run.do_compile.txt

Could someone give me some direction to fix or locate the issue? Maybe the issue is related with my environment.
Thanks.

How to reproduce.

We should build a Yocto Project.

  1. ~$: git clone git://git.yoctoproject.org/poky
  2. ~$: cd poky/
  3. ~/poky: git clone git://git.yoctoproject.org/meta-cloud-services
    ~/poky: git clone git://git.yoctoproject.org/meta-virtualization
    ~/poky: git clone git://git.openembedded.org/meta-openembedded
  4. ~/poky: source ../oe-init-build-env
  5. ~/poky/build: vi conf/bblayers.conf
    Add six paths to BBLAYERS:
    BBLAYERS ?= " \
    /ala-lpggp22/hsong/poky-qcon/meta
    /ala-lpggp22/hsong/poky-qcon/meta-poky
    /ala-lpggp22/hsong/poky-qcon/meta-yocto-bsp
    /ala-lpggp22/hsong/poky-qcon/meta-virtualization
    /ala-lpggp22/hsong/poky-qcon/meta-cloud-services
    /ala-lpggp22/hsong/poky-qcon/meta-openembedded/meta-python
    /ala-lpggp22/hsong/poky-qcon/meta-openembedded/meta-networking
    /ala-lpggp22/hsong/poky-qcon/meta-openembedded/meta-filesystems
    /ala-lpggp22/hsong/poky-qcon/meta-openembedded/meta-oe
    "
  6. bitbake consul
    This command will build consul and its dependencies.
    Then the issue will prompt when doing do_compile of consul.

If you have any question about Yocto Project with please contact me.

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

ianlancetaylor commented Mar 12, 2019

Please cut and paste text. Please do not post screenshots, as they are read and harder to work with. Thanks.

Can you tell us exactly how to recreate the problem? Thanks.

@ianlancetaylor ianlancetaylor changed the title I met some Error: type..eUfRrckI: missing section for relocation target type..FEeY9FdU cmd/link: missing section for relocation target Mar 12, 2019

@ianlancetaylor ianlancetaylor added this to the Go1.13 milestone Mar 12, 2019

@csqshz

This comment has been minimized.

Copy link
Author

csqshz commented Mar 13, 2019

Please cut and paste text. Please do not post screenshots, as they are read and harder to work with. Thanks.

Can you tell us exactly how to recreate the problem? Thanks.

Thanks for your reply. I have remedied my content that adding attachment and appending how to reproduce the issue.

@csqshz

This comment has been minimized.

Copy link
Author

csqshz commented Mar 18, 2019

I found the following commit introduced the issue.
Golang: 685aca4
https://github.com/golang/go/commit/685aca45dc8435df7b7e8059a42a8a98efdaf22c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.