Skip to content

Commit 2accefa

Browse files
committed
hwasan: Enable -hwasan-allow-ifunc by default.
It's been on in Android for a while without causing problems, so it's time to make it the default and remove the flag. Differential Revision: https://reviews.llvm.org/D60355 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357960 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent c840562 commit 2accefa

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

lib/Transforms/Instrumentation/HWAddressSanitizer.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,6 @@ static cl::opt<bool> ClInlineAllChecks("hwasan-inline-all-checks",
160160
cl::desc("inline all checks"),
161161
cl::Hidden, cl::init(false));
162162

163-
static cl::opt<bool> ClAllowIfunc("hwasan-allow-ifunc",
164-
cl::desc("allow the use of ifunc"),
165-
cl::Hidden, cl::init(false));
166-
167163
namespace {
168164

169165
/// An instrumentation pass implementing detection of addressability bugs
@@ -836,7 +832,7 @@ Value *HWAddressSanitizer::emitPrologue(IRBuilder<> &IRB,
836832
if (!Mapping.InTls)
837833
return getDynamicShadowNonTls(IRB);
838834

839-
if (ClAllowIfunc && !WithFrameRecord && TargetTriple.isAndroid())
835+
if (!WithFrameRecord && TargetTriple.isAndroid())
840836
return getDynamicShadowIfunc(IRB);
841837

842838
Value *SlotPtr = getHwasanThreadSlotPtr(IRB, IntptrTy);

test/Instrumentation/HWAddressSanitizer/lazy-thread-init.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: opt -S -hwasan -hwasan-allow-ifunc < %s | FileCheck %s
1+
; RUN: opt -S -hwasan < %s | FileCheck %s
22

33
target triple = "aarch64--linux-android"
44

test/Instrumentation/HWAddressSanitizer/prologue.ll

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
; Test -hwasan-with-ifunc flag.
22
;
3-
; RUN: opt -hwasan -hwasan-allow-ifunc -S < %s | \
3+
; RUN: opt -hwasan -S < %s | \
44
; RUN: FileCheck %s --check-prefixes=CHECK,CHECK-NOGLOBAL,CHECK-TLS,CHECK-HISTORY
5-
; RUN: opt -hwasan -hwasan-allow-ifunc -S -hwasan-with-ifunc=0 -hwasan-with-tls=1 -hwasan-record-stack-history=1 < %s | \
5+
; RUN: opt -hwasan -S -hwasan-with-ifunc=0 -hwasan-with-tls=1 -hwasan-record-stack-history=1 < %s | \
66
; RUN: FileCheck %s --check-prefixes=CHECK,CHECK-NOGLOBAL,CHECK-TLS,CHECK-HISTORY
7-
; RUN: opt -hwasan -hwasan-allow-ifunc -S -hwasan-with-ifunc=0 -hwasan-with-tls=1 -hwasan-record-stack-history=0 < %s | \
7+
; RUN: opt -hwasan -S -hwasan-with-ifunc=0 -hwasan-with-tls=1 -hwasan-record-stack-history=0 < %s | \
88
; RUN: FileCheck %s --check-prefixes=CHECK,CHECK-NOGLOBAL,CHECK-IFUNC,CHECK-NOHISTORY
9-
; RUN: opt -hwasan -hwasan-allow-ifunc -S -hwasan-with-ifunc=0 -hwasan-with-tls=0 < %s | \
9+
; RUN: opt -hwasan -S -hwasan-with-ifunc=0 -hwasan-with-tls=0 < %s | \
1010
; RUN: FileCheck %s --check-prefixes=CHECK,CHECK-GLOBAL,CHECK-NOHISTORY
11-
; RUN: opt -hwasan -hwasan-allow-ifunc -S -hwasan-with-ifunc=1 -hwasan-with-tls=0 < %s | \
11+
; RUN: opt -hwasan -S -hwasan-with-ifunc=1 -hwasan-with-tls=0 < %s | \
1212
; RUN: FileCheck %s --check-prefixes=CHECK,CHECk-NOGLOBAL,CHECK-IFUNC,CHECK-NOHISTORY
1313

1414
target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"

0 commit comments

Comments
 (0)