__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.
Details
Details
- Reviewers
echristo craig.topper - Commits
- rG303b2333e403: Declares __cpu_model as dso local
rG6b22f592075f: Declares __cpu_model as dso local
rL349825: Declares __cpu_model as dso local
rC349825: Declares __cpu_model as dso local
rC348978: Declares __cpu_model as dso local
rL348978: Declares __cpu_model as dso local
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/CodeGen/CGBuiltin.cpp | ||
---|---|---|
9013 ↗ | (On Diff #171608) | This code looks to be out of date. It's missing the changes from r344832 that added another runtime variable that presumably has the same issue. |
lib/CodeGen/CGBuiltin.cpp | ||
---|---|---|
9013 ↗ | (On Diff #171608) | By the way, what is the reason for gcc to add a separate cpu_feature2, but not adding an element to cpu_model.__cpu_features array? |