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

Comments

@gopherbot
Copy link

@gopherbot 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.

@dmitshur
Copy link
Contributor

@dmitshur dmitshur commented Feb 18, 2021

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.

Loading

@qmuntal
Copy link
Contributor

@qmuntal qmuntal commented Feb 18, 2021

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

Loading

@toothrot toothrot removed this from the Go1.15.9 milestone Mar 10, 2021
@toothrot toothrot added this to the Go1.15.10 milestone Mar 10, 2021
@toothrot
Copy link
Contributor

@toothrot toothrot commented Mar 10, 2021

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

Loading

@qmuntal
Copy link
Contributor

@qmuntal qmuntal commented Mar 10, 2021

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

Sure

Loading

@gopherbot
Copy link
Author

@gopherbot gopherbot commented Mar 10, 2021

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

Loading

@gopherbot
Copy link
Author

@gopherbot gopherbot commented Mar 10, 2021

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

Loading

@cagedmantis cagedmantis removed this from the Go1.15.10 milestone Mar 11, 2021
@cagedmantis cagedmantis added this to the Go1.15.11 milestone Mar 11, 2021
@gopherbot
Copy link
Author

@gopherbot gopherbot commented Mar 31, 2021

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

Loading

@gopherbot gopherbot closed this Mar 31, 2021
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants