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: "x86_64-w64-mingw32/bin/ld.exe: Error: export ordinal too large" after upgrading to Go 1.15 [1.15 backport] #43592

Closed
gopherbot opened this issue Jan 8, 2021 · 7 comments
Labels
CherryPickApproved Used during the release process for point releases FrozenDueToAge
Milestone

Comments

@gopherbot
Copy link

gopherbot commented Jan 8, 2021

@networkimprov requested issue #40795 (fixed by e463c28 in Go 1.16) to be considered for backport to the next 1.15 minor release.

@gopherbot please backport to 1.15

buildmode=pie became the default in 1.15, so folks have to manually set buildmode=exe to work around this bug.

@gopherbot gopherbot added the CherryPickCandidate Used during the release process for point releases label Jan 8, 2021
@gopherbot gopherbot added this to the Go1.15.7 milestone Jan 8, 2021
@dmitshur dmitshur modified the milestones: Go1.15.7, Go1.15.8 Jan 19, 2021
@cagedmantis cagedmantis modified the milestones: Go1.15.8, Go1.15.9 Feb 4, 2021
@dmitshur
Copy link
Contributor

Approving per discussion in a release meeting as a serious issue without a good workaround (setting -buildmode=exe is a workaround, but this doesn't scale across developers). Only Go 1.15 needs this backport.

@dmitshur dmitshur added CherryPickApproved Used during the release process for point releases and removed CherryPickCandidate Used during the release process for point releases labels Feb 18, 2021
@qmuntal
Copy link
Contributor

qmuntal commented Feb 18, 2021

Take into account #43591 (comment) before backporting this issue.

@toothrot toothrot modified the milestones: Go1.15.9, Go1.15.10 Mar 10, 2021
@toothrot
Copy link
Contributor

Hi @qmuntal. Could you please create a backport CL per https://github.com/golang/go/wiki/MinorReleases?

@qmuntal
Copy link
Contributor

qmuntal commented Mar 10, 2021

Hi @qmuntal. Could you please create a backport CL per https://github.com/golang/go/wiki/MinorReleases?

Sure

@gopherbot
Copy link
Author

Change https://golang.org/cl/300693 mentions this issue: [release-branch.go1.15] [release-branch.go.1.15] cmd/link,cmd/cgo: avoid exporting all symbols on windows buildmode=c-shared/pie

@gopherbot
Copy link
Author

Change https://golang.org/cl/300692 mentions this issue: [release-branch.go1.15] [release-branch.go.1.15] cmd/link: avoid exporting all symbols on windows buildmode=pie

@cagedmantis cagedmantis modified the milestones: Go1.15.10, Go1.15.11 Mar 11, 2021
@gopherbot
Copy link
Author

Closed by merging 82f9c6c to release-branch.go1.15.

gopherbot pushed a commit that referenced this issue Mar 31, 2021
…ows buildmode=pie

Marking one functions with __declspec(dllexport) forces mingw to
create .reloc section without having to export all symbols.

See https://insights.sei.cmu.edu/cert/2018/08/when-aslr-is-not-really-aslr---the-case-of-incorrect-assumptions-and-bad-defaults.html for more info.

This change cuts 73kb of a "hello world" pie binary.

Updates #6853.
Updates #40795.
Fixes #43592.

Change-Id: I3cc57c3b64f61187550bc8751dfa085f106c8475
Reviewed-on: https://go-review.googlesource.com/c/go/+/264459
Trust: Alex Brainman <alex.brainman@gmail.com>
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/300692
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: David Chase <drchase@google.com>
@golang golang locked and limited conversation to collaborators Mar 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CherryPickApproved Used during the release process for point releases FrozenDueToAge
Projects
None yet
Development

No branches or pull requests

5 participants