[LowerTypeTests] Add ENDBR to .cfi.jumptable for x86 Indirect Branch Tracking
Similar to D81251 for AArch64 BTI. This fixes `./a.out test` for
```
void foo(void) {}
void bar(void) {}
static void (*fptr)(void);
int main(int argc, char **argv) {
if (argv[1]) fptr = foo;
else fptr = bar;
fptr();
}
```
`clang -flto=thin -fvisibility=hidden -fsanitize=cfi-icall -fcf-protection=branch -fuse-ld=lld a.cc`
Reviewed By: tejohnson
Differential Revision: https://reviews.llvm.org/D140655
parent
9768a71a
Please register or sign in to comment