Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It's just a flag in the PE headers. It can be modified after the fact with a tool; the Go linker doesn't need to know.


But the reason why there is an explicit flag in the first place is that there's a lot of code out there that doesn't work with pointers >= 0x80000000, or when pointers could differ by more than that. Things like pointer "tagging", and signed integer overflow bugs, are examples of the sort of code that can be affected. Without knowing details about the Go code generation and runtime/garbage collection, it would be a bit risky to just set the flag and hope for the best.


Oh, I know; I've written bounds-checking logic for RTLs that use casts to integers and tests for negativity to check for overrun, implicitly assuming 31-bit address space. My only point is that a limitation of the Go linker does not preclude setting the flag.


No such problems in Go. I just checked and the flag is set by default in all Windows binaries.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: