-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/link: reject >2GB static data #9862
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
Comments
Are you sure Linux can handle that code? On my linux/amd64 system, it also prints 2.
In general, our toolchain can't handle static data (or text, for that matter) |
You're right, on my linux/amd64 system at tip it prints 2. Turns out I was in the wrong directory and tested go 1.2.1. Go 1.2.1 generates the correctly sized bss, at least. |
I've experimented with various released version of Go:
It's broken since Go 1.3. |
Possibly related: #7980 |
CL https://golang.org/cl/11715 mentions this issue. |
The following code prints 2!
It seems that when bss is big, bad things happen on darwin. At 1<<30, it works (prints 0). It also fails at 1<<31, 1<<32, 1<<33. We get a compile error at 1<<31 - 1:
We should fail instead of silently generating bad code.
Linux works correctly: succeeds for up to close to 1<<32, fails with the above error for larger sizes.
The text was updated successfully, but these errors were encountered: