]> granicus.if.org Git - clang/commit
Declares __cpu_model as dso local
authorHaibo Huang <hhb@google.com>
Wed, 12 Dec 2018 22:04:12 +0000 (22:04 +0000)
committerHaibo Huang <hhb@google.com>
Wed, 12 Dec 2018 22:04:12 +0000 (22:04 +0000)
commit3279c3642e5fe23624de5e6e5ef0481cbd6ac7a1
treed5f1d84c4ed9d457d78899c7a7b50db1060b6233
parentf89e5ce8508a67f732e550b8313fa7d2f889ee3f
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
lib/CodeGen/CGBuiltin.cpp
test/CodeGen/builtin-cpu-is.c
test/CodeGen/builtin-cpu-supports.c