From 2accefaaf345068975592797a2aceace2a41e973 Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Tue, 9 Apr 2019 00:25:59 +0000 Subject: [PATCH] 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 --- lib/Transforms/Instrumentation/HWAddressSanitizer.cpp | 6 +----- .../HWAddressSanitizer/lazy-thread-init.ll | 2 +- test/Instrumentation/HWAddressSanitizer/prologue.ll | 10 +++++----- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp b/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp index 6ecbd239f5b..71eaf4645cf 100644 --- a/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp +++ b/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp @@ -160,10 +160,6 @@ static cl::opt ClInlineAllChecks("hwasan-inline-all-checks", cl::desc("inline all checks"), cl::Hidden, cl::init(false)); -static cl::opt ClAllowIfunc("hwasan-allow-ifunc", - cl::desc("allow the use of ifunc"), - cl::Hidden, cl::init(false)); - namespace { /// An instrumentation pass implementing detection of addressability bugs @@ -836,7 +832,7 @@ Value *HWAddressSanitizer::emitPrologue(IRBuilder<> &IRB, if (!Mapping.InTls) return getDynamicShadowNonTls(IRB); - if (ClAllowIfunc && !WithFrameRecord && TargetTriple.isAndroid()) + if (!WithFrameRecord && TargetTriple.isAndroid()) return getDynamicShadowIfunc(IRB); Value *SlotPtr = getHwasanThreadSlotPtr(IRB, IntptrTy); diff --git a/test/Instrumentation/HWAddressSanitizer/lazy-thread-init.ll b/test/Instrumentation/HWAddressSanitizer/lazy-thread-init.ll index d5a2541eb77..6c445ed1673 100644 --- a/test/Instrumentation/HWAddressSanitizer/lazy-thread-init.ll +++ b/test/Instrumentation/HWAddressSanitizer/lazy-thread-init.ll @@ -1,4 +1,4 @@ -; RUN: opt -S -hwasan -hwasan-allow-ifunc < %s | FileCheck %s +; RUN: opt -S -hwasan < %s | FileCheck %s target triple = "aarch64--linux-android" diff --git a/test/Instrumentation/HWAddressSanitizer/prologue.ll b/test/Instrumentation/HWAddressSanitizer/prologue.ll index 1163dbe72de..d9913f84f42 100644 --- a/test/Instrumentation/HWAddressSanitizer/prologue.ll +++ b/test/Instrumentation/HWAddressSanitizer/prologue.ll @@ -1,14 +1,14 @@ ; Test -hwasan-with-ifunc flag. ; -; RUN: opt -hwasan -hwasan-allow-ifunc -S < %s | \ +; RUN: opt -hwasan -S < %s | \ ; RUN: FileCheck %s --check-prefixes=CHECK,CHECK-NOGLOBAL,CHECK-TLS,CHECK-HISTORY -; RUN: opt -hwasan -hwasan-allow-ifunc -S -hwasan-with-ifunc=0 -hwasan-with-tls=1 -hwasan-record-stack-history=1 < %s | \ +; RUN: opt -hwasan -S -hwasan-with-ifunc=0 -hwasan-with-tls=1 -hwasan-record-stack-history=1 < %s | \ ; RUN: FileCheck %s --check-prefixes=CHECK,CHECK-NOGLOBAL,CHECK-TLS,CHECK-HISTORY -; RUN: opt -hwasan -hwasan-allow-ifunc -S -hwasan-with-ifunc=0 -hwasan-with-tls=1 -hwasan-record-stack-history=0 < %s | \ +; RUN: opt -hwasan -S -hwasan-with-ifunc=0 -hwasan-with-tls=1 -hwasan-record-stack-history=0 < %s | \ ; RUN: FileCheck %s --check-prefixes=CHECK,CHECK-NOGLOBAL,CHECK-IFUNC,CHECK-NOHISTORY -; RUN: opt -hwasan -hwasan-allow-ifunc -S -hwasan-with-ifunc=0 -hwasan-with-tls=0 < %s | \ +; RUN: opt -hwasan -S -hwasan-with-ifunc=0 -hwasan-with-tls=0 < %s | \ ; RUN: FileCheck %s --check-prefixes=CHECK,CHECK-GLOBAL,CHECK-NOHISTORY -; RUN: opt -hwasan -hwasan-allow-ifunc -S -hwasan-with-ifunc=1 -hwasan-with-tls=0 < %s | \ +; RUN: opt -hwasan -S -hwasan-with-ifunc=1 -hwasan-with-tls=0 < %s | \ ; RUN: FileCheck %s --check-prefixes=CHECK,CHECk-NOGLOBAL,CHECK-IFUNC,CHECK-NOHISTORY target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128" -- 2.50.1