[cfi] Support explicit sections for functions in cfi-icall.
Allow explicit section for indirectly called functions in cfi-icall.
Jumptables for functions in the same type class must be contiguous, so they
always go to the default text section.
Fixes PR25079.
llvm-svn: 266486
diff --git a/llvm/lib/Transforms/IPO/LowerBitSets.cpp b/llvm/lib/Transforms/IPO/LowerBitSets.cpp
index 1798d83..db5bab0 100644
--- a/llvm/lib/Transforms/IPO/LowerBitSets.cpp
+++ b/llvm/lib/Transforms/IPO/LowerBitSets.cpp
@@ -639,8 +639,9 @@
if (OpGlobal->isThreadLocal())
report_fatal_error("Bit set element may not be thread-local");
- if (OpGlobal->hasSection())
- report_fatal_error("Bit set element may not have an explicit section");
+ if (isa<GlobalVariable>(OpGlobal) && OpGlobal->hasSection())
+ report_fatal_error(
+ "Bit set global var element may not have an explicit section");
if (isa<GlobalVariable>(OpGlobal) && OpGlobal->isDeclarationForLinker())
report_fatal_error("Bit set global var element must be a definition");