]> granicus.if.org Git - clang/commit
Declares __cpu_model as dso local
authorHaibo Huang <hhb@google.com>
Thu, 20 Dec 2018 21:33:59 +0000 (21:33 +0000)
committerHaibo Huang <hhb@google.com>
Thu, 20 Dec 2018 21:33:59 +0000 (21:33 +0000)
commitec67fa58d2d4e4f803023a06c9faa02a7b124b9d
tree159c63de20dc0f1e61022b0374ec009e951fda18
parent0b2c3959f16c11f0689b747b905ef59a6075cdd2
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@349825 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGBuiltin.cpp
test/CodeGen/builtin-cpu-is.c
test/CodeGen/builtin-cpu-supports.c