[all-commits] [llvm/llvm-project] 73c9f1: [LowerTypeTests] Add ENDBR to .cfi.jumptable for x...

Fangrui Song via All-commits all-commits at lists.llvm.org
Wed Jan 4 12:28:20 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 73c9f167ffed8454e80b584ac2f75f817f90eca0
      https://github.com/llvm/llvm-project/commit/73c9f167ffed8454e80b584ac2f75f817f90eca0
  Author: Fangrui Song <i at maskray.me>
  Date:   2023-01-04 (Wed, 04 Jan 2023)

  Changed paths:
    M llvm/lib/Transforms/IPO/LowerTypeTests.cpp
    M llvm/test/Transforms/LowerTypeTests/function.ll
    A llvm/test/Transforms/LowerTypeTests/x86-jumptable.ll

  Log Message:
  -----------
  [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




More information about the All-commits mailing list