table variations (calculate address into %rax, jmp %rax) which is not
compatible with IBT endbr64. The specific generated code sequence was
found inside clang, which made the debugging experience pretty miserable.
So we will have to disable jump tables by default.
ok kettenis
} else if (Triple.isOSOpenBSD() && Triple.getArch() == llvm::Triple::x86_64) {
// Emit IBT endbr64 instructions by default
CmdArgs.push_back("-fcf-protection=branch");
+ // jump-table can generate indirect jumps, which are not permitted
+ CmdArgs.push_back("-fno-jump-tables");
}
// Forward -f options with positive and negative forms; we translate these by