Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow -fsanitize=function on all targets
Functions instrumented with -fsanitize=function have two words before the function label: a signature and a RTTI proxy. Instrumented call sites check the signature first to skip checks for uninstrumented callees. The code is generic and works for all targets supporting C++ RTTI. Change clangDriver to allow all targets. Add tests for Armv8.5 Branch Target Identification and `-fpatchable-function-entry=`. Reviewed By: peter.smith Differential Revision: https://reviews.llvm.org/D148573
- Loading branch information
Showing
13 changed files
with
55 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
compiler-rt/test/ubsan/TestCases/TypeCheck/Function/lit.local.cfg.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
# The function type checker is only supported on x86 and x86_64 for now. | ||
if config.target_arch not in ['x86', 'x86_64']: | ||
if config.host_os not in ['Darwin', 'FreeBSD', 'Linux', 'NetBSD']: | ||
config.unsupported = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
; RUN: llc -mtriple=aarch64-unknown-linux-gnu < %s | FileCheck %s | ||
|
||
; CHECK-LABEL: .type _Z3funv,@function | ||
; CHECK-NEXT: .word 3238382334 // 0xc105cafe | ||
; CHECK-NEXT: .word .L__llvm_rtti_proxy-_Z3funv | ||
; CHECK-NEXT: _Z3funv: | ||
; CHECK-NEXT: // %bb.0: | ||
; CHECK-NEXT: ret | ||
|
||
; CHECK: .section .rodata,"a",@progbits | ||
; CHECK-LABEL: .L__llvm_rtti_proxy: | ||
; CHECK-NEXT: .xword _ZTIFvvE | ||
; CHECK-NEXT: .size .L__llvm_rtti_proxy, 8 | ||
|
||
@_ZTIFvvE = linkonce_odr constant i32 1 | ||
@__llvm_rtti_proxy = private unnamed_addr constant ptr @_ZTIFvvE | ||
|
||
define dso_local void @_Z3funv() nounwind !func_sanitize !0 { | ||
ret void | ||
} | ||
|
||
!0 = !{i32 3238382334, ptr @__llvm_rtti_proxy} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters