Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
memory corruption on linux/386 with float32 arithmetic, GO386=387, buildmode pie/c-archive [1.14 backport] #41619
This is a compiler bug that causes arbitrary corruption at the intersection of 387, PIE, and float32.
…bbering registers The 387 port needs to load a floating-point control word from a global location to implement float32 arithmetic. When compiling with -pie, loading that control word clobbers an integer register. If that register had something important in it, boom. Fix by using LEAL to materialize the address of the global location first. LEAL with -pie works because the destination register is used as the scratch register. 387 support is about to go away (#40255), so this will need to be backported to have any effect. No test. I have one, but it requires building with -pie, which requires cgo. Our testing infrastructure doesn't make that easy. Not worth it for a port which is about to vanish. Fixes #41619 Change-Id: I140f9fc8fdce4e74a52c2c046e2bd30ae476d295 Reviewed-on: https://go-review.googlesource.com/c/go/+/257277 Run-TryBot: Keith Randall <email@example.com> Reviewed-by: Cherry Zhang <firstname.lastname@example.org> Reviewed-by: Matthew Dempsky <email@example.com> TryBot-Result: Go Bot <firstname.lastname@example.org> Trust: Keith Randall <email@example.com> (cherry picked from commit ea106cc) Reviewed-on: https://go-review.googlesource.com/c/go/+/257208