From deec799746e92ab0487eca489499ade08a2610bf Mon Sep 17 00:00:00 2001 From: Caroline Tice Date: Mon, 8 Jan 2018 10:25:12 -0800 Subject: [GCC] Commit retpoline patch code, for fixing security issues. This applies the Intel GCC code patches, to allow compiling with appropriate flags for mitigating the indirect branch variant of the speculative execution security flaw. Bug: None Test: This is already in place in ChromeOS and has been tested on the ChromeOS kernels. Change-Id: Ideffb433b697f1fe7e4ca2c1eaa968160abfcc8b --- gcc-4.9/gcc/testsuite/gcc.target/i386/ret-thunk-5.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/i386/ret-thunk-5.c (limited to 'gcc-4.9/gcc/testsuite/gcc.target/i386/ret-thunk-5.c') diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/ret-thunk-5.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/ret-thunk-5.c new file mode 100644 index 000000000..28c576e22 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/ret-thunk-5.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -mfunction-return=keep" } */ + +extern void foo (void) __attribute__ ((function_return("thunk"))); + +void +foo (void) +{ +} + +/* { dg-final { scan-assembler "jmp\[ \t\]*__x86.return_thunk" } } */ +/* { dg-final { scan-assembler "jmp\[ \t\]*\.LIND" } } */ +/* { dg-final { scan-assembler "call\[ \t\]*\.LIND" } } */ +/* { dg-final { scan-assembler {\tlfence} } } */ -- cgit v1.2.3