]> Cypherpunks repositories - gostls13.git/commit
cmd/link: only check PIE size difference when the linkmode is the same
authorJoel Sing <joel@sing.id.au>
Wed, 12 Mar 2025 13:39:27 +0000 (00:39 +1100)
committerJoel Sing <joel@sing.id.au>
Thu, 13 Mar 2025 11:22:49 +0000 (04:22 -0700)
commit8cdef129fb078a118c3b5032ea7e0b103bf61995
tree654ea7e574b4350bc48c31ed01e0302f62e7b5f0
parentb143c981693a0f405f16eade1cccf4933fde8e21
cmd/link: only check PIE size difference when the linkmode is the same

Currently we check the size difference between non-PIE and PIE binaries
without specifying a linkmode (and that is presumed to be internal).
However, on some platforms (like openbsd/arm64), the use of
-buildmode=pie results in external linking. Ensure that we only test
internally linked non-PIE against internally linked PIE and externally
linked non-PIE against externally linked PIE, avoiding unexpected
differences.

Fixes #72818

Change-Id: I7e1da0976a4b5de387a59d0d6c04f58498a8eca0
Reviewed-on: https://go-review.googlesource.com/c/go/+/657035
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Than McIntosh <thanm@golang.org>
src/cmd/link/elf_test.go