diff options
author | Haibo Huang <hhb@google.com> | 2018-12-12 22:04:12 +0000 |
---|---|---|
committer | Haibo Huang <hhb@google.com> | 2018-12-12 22:04:12 +0000 |
commit | 3279c3642e5fe23624de5e6e5ef0481cbd6ac7a1 (patch) | |
tree | d5f1d84c4ed9d457d78899c7a7b50db1060b6233 /test/CodeGen/builtin-cpu-supports.c | |
parent | f89e5ce8508a67f732e550b8313fa7d2f889ee3f (diff) | |
download | clang-3279c3642e5fe23624de5e6e5ef0481cbd6ac7a1.tar.gz |
Declares __cpu_model as dso local
__builtin_cpu_supports and __builtin_cpu_is use information in __cpu_model to decide cpu features. Before this change, __cpu_model was not declared as dso local. The generated code looks up the address in GOT when reading __cpu_model. This makes it impossible to use these functions in ifunc, because at that time GOT entries have not been relocated. This change makes it dso local.
Differential Revision: https://reviews.llvm.org/D53850
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348978 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/builtin-cpu-supports.c')
-rw-r--r-- | test/CodeGen/builtin-cpu-supports.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/CodeGen/builtin-cpu-supports.c b/test/CodeGen/builtin-cpu-supports.c index d384efbc20..761f00cf95 100644 --- a/test/CodeGen/builtin-cpu-supports.c +++ b/test/CodeGen/builtin-cpu-supports.c @@ -4,6 +4,9 @@ // global, the bit grab, and the icmp correct. extern void a(const char *); +// CHECK: @__cpu_model = external dso_local global { i32, i32, i32, [1 x i32] } +// CHECK: @__cpu_features2 = external dso_local global i32 + int main() { __builtin_cpu_init(); @@ -25,3 +28,5 @@ int main() { return 0; } + +// CHECK: declare dso_local void @__cpu_indicator_init() |