go/src/cmd
Keith Randall ea106cc07a cmd/compile: prevent 387+float32+pie from clobbering 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 #41503

Change-Id: I140f9fc8fdce4e74a52c2c046e2bd30ae476d295
Reviewed-on: https://go-review.googlesource.com/c/go/+/257277
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Keith Randall <khr@golang.org>
2020-09-24 22:45:05 +00:00
..
addr2line cmd/addr2line: don't assume that GOROOT_FINAL is clean 2020-09-17 19:25:09 +00:00
api cmd/api: omit outside dependencies when listing the packages in "std" 2020-09-14 19:45:28 +00:00
asm cmd/asm: make asm -S flag consistent with compile -S flag 2020-09-17 23:22:25 +00:00
buildid
cgo all: add GOOS=ios 2020-09-23 18:12:59 +00:00
compile cmd/compile: prevent 387+float32+pie from clobbering registers 2020-09-24 22:45:05 +00:00
cover all: replace Replace(..., -1) with ReplaceAll(...) 2020-08-17 04:07:23 +00:00
dist all: add GOOS=ios 2020-09-23 18:12:59 +00:00
doc all: add GOOS=ios 2020-09-23 18:12:59 +00:00
fix cmd/fix: remove un-used code 2020-08-26 16:38:34 +00:00
go cmd/go: error when -c or -i are used with unknown flags 2020-09-24 20:27:51 +00:00
gofmt go/printer: remove exported StdFormat flag 2020-07-17 02:15:01 +00:00
internal cmd/compile,cmd/asm: fix buglet in -S=2 output 2020-09-24 21:51:51 +00:00
link all: add GOOS=ios 2020-09-23 18:12:59 +00:00
nm all: add GOOS=ios 2020-09-23 18:12:59 +00:00
objdump cmd/objdump: skip cgo test in testGoAndCgoDisasm on AIX 2020-08-22 03:46:17 +00:00
pack [dev.link] cmd/pack: use cmd/internal/archive package 2020-08-11 23:11:29 +00:00
pprof
test2json cmd/test2json: do not emit a final Action if the result is not known 2020-08-17 19:43:21 +00:00
trace cmd/trace: move viewer data structs into cmd/internal/traceviewer 2020-08-12 18:34:48 +00:00
vendor all: update vendored dependencies during Go 1.16 development 2020-09-21 22:10:00 +00:00
vet
README.vendor
go.mod all: update vendored dependencies during Go 1.16 development 2020-09-21 22:10:00 +00:00
go.sum all: update vendored dependencies during Go 1.16 development 2020-09-21 22:10:00 +00:00

README.vendor

See src/README.vendor for information on loading vendored packages
and updating the vendor directory.