diff options
| author | Russ Cox <rsc@golang.org> | 2020-01-17 13:54:30 -0500 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2020-03-13 19:05:54 +0000 |
| commit | fc8a6336d1ad29acf2c7728ce669df9059169132 (patch) | |
| tree | 4121580d23be8c08aa0a7b0077254035ecb4473b /src/cmd/internal/obj/arm | |
| parent | 877ef86bec593cd7e40899ac5446791e65b47839 (diff) | |
| download | go-fc8a6336d1ad29acf2c7728ce669df9059169132.tar.xz | |
cmd/asm, cmd/compile, runtime: add -spectre=ret mode
This commit extends the -spectre flag to cmd/asm and adds
a new Spectre mitigation mode "ret", which enables the use
of retpolines.
Retpolines prevent speculation about the target of an indirect
jump or call and are described in more detail here:
https://support.google.com/faqs/answer/7625886
Change-Id: I4f2cb982fa94e44d91e49bd98974fd125619c93a
Reviewed-on: https://go-review.googlesource.com/c/go/+/222661
Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/cmd/internal/obj/arm')
| -rw-r--r-- | src/cmd/internal/obj/arm/asm5.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/cmd/internal/obj/arm/asm5.go b/src/cmd/internal/obj/arm/asm5.go index bc55dac878..b398de2dac 100644 --- a/src/cmd/internal/obj/arm/asm5.go +++ b/src/cmd/internal/obj/arm/asm5.go @@ -379,6 +379,11 @@ func checkSuffix(c *ctxt5, p *obj.Prog, o *Optab) { } func span5(ctxt *obj.Link, cursym *obj.LSym, newprog obj.ProgAlloc) { + if ctxt.Retpoline { + ctxt.Diag("-spectre=ret not supported on arm") + ctxt.Retpoline = false // don't keep printing + } + var p *obj.Prog var op *obj.Prog |
