From: Reid Kleckner Date: Wed, 27 Feb 2019 23:38:44 +0000 (+0000) Subject: [InstrProf] Use separate comdat group for data and counters X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=54cb5304bd89e37e4af46031f81950bd2ddd6ba7;p=clang [InstrProf] Use separate comdat group for data and counters Summary: I hadn't realized that instrumentation runs before inlining, so we can't use the function as the comdat group. Doing so can create relocations against discarded sections when references to discarded __profc_ variables are inlined into functions outside the function's comdat group. In the future, perhaps we should consider standardizing the comdat group names that ELF and COFF use. It will save object file size, since __profv_$sym won't appear in the symbol table again. Reviewers: xur, vsk Subscribers: eraman, hiraditya, cfe-commits, #sanitizers, llvm-commits Tags: #clang, #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D58737 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355044 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Profile/cxx-templates.cpp b/test/Profile/cxx-templates.cpp index ac0b338271..7af6660f52 100644 --- a/test/Profile/cxx-templates.cpp +++ b/test/Profile/cxx-templates.cpp @@ -10,8 +10,8 @@ // RUN: FileCheck --input-file=%tuse -check-prefix=T0USE -check-prefix=ALL %s // RUN: FileCheck --input-file=%tuse -check-prefix=T100USE -check-prefix=ALL %s -// T0GEN: @[[T0C:__profc__Z4loopILj0EEvv]] = {{(linkonce_odr hidden|internal)}} global [2 x i64] zeroinitializer -// T100GEN: @[[T100C:__profc__Z4loopILj100EEvv]] = {{(linkonce_odr hidden|internal)}} global [2 x i64] zeroinitializer +// T0GEN: @[[T0C:__profc__Z4loopILj0EEvv]] = linkonce_odr {{(hidden|dso_local)}} global [2 x i64] zeroinitializer +// T100GEN: @[[T100C:__profc__Z4loopILj100EEvv]] = linkonce_odr {{(hidden|dso_local)}} global [2 x i64] zeroinitializer // T0GEN-LABEL: define linkonce_odr {{.*}}void @_Z4loopILj0EEvv() // T0USE-LABEL: define linkonce_odr {{.*}}void @_Z4loopILj0EEvv()