]> Cypherpunks repositories - gostls13.git/commit
cmd/link: fix suspicious code in emitPcln
authorCherry Zhang <cherryyz@google.com>
Wed, 6 Mar 2019 22:57:35 +0000 (17:57 -0500)
committerCherry Zhang <cherryyz@google.com>
Thu, 7 Mar 2019 23:09:46 +0000 (23:09 +0000)
commit3a62f4ee40212c363ae7ebf5e28954efb7ff7ee6
treec997f8cc864e9dca8baab5d4eb187bca20adc9e2
parent7afd58d4581925788e1ef28ff817784d2585b92f
cmd/link: fix suspicious code in emitPcln

In cmd/link/internal/ld/pcln.go:emitPcln, the code and the
comment don't match. I think the comment is right. Fix the code.

As a consequence, on Linux/AMD64, internal linking with PIE
buildmode with cgo (at least the cgo packages in the standard
library) now works. Add a test.

Change-Id: I091cf81ba89571052bc0ec1fa0a6a688dec07b04
Reviewed-on: https://go-review.googlesource.com/c/go/+/166017
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
src/cmd/dist/test.go
src/cmd/link/internal/ld/pcln.go