Allow dso_local on ifunc.
It was never fully disallowed. We were rejecting it in the asm parser, but not in the verifier. Currently TargetMachine::shouldAssumeDSOLocal returns true for hidden ifuncs. I considered changing it and moving the check from the asm parser to the verifier. The reason for deciding to allow it instead is that all linkers handle a direct reference just fine. They use the plt address as the address of the function. In fact doing that means that clang doesn't have the same bug as gcc: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83782. This patch then removes the check from the asm parser and updates the bitcode reader and writer. llvm-svn: 322378
This commit is contained in:
@@ -3054,14 +3054,17 @@ Error BitcodeReader::parseGlobalIndirectSymbolRecord(
|
||||
// FIXME: Change to an error if non-default in 4.0.
|
||||
NewGA->setVisibility(getDecodedVisibility(Record[VisInd]));
|
||||
}
|
||||
if (OpNum != Record.size())
|
||||
NewGA->setDLLStorageClass(getDecodedDLLStorageClass(Record[OpNum++]));
|
||||
else
|
||||
upgradeDLLImportExportLinkage(NewGA, Linkage);
|
||||
if (OpNum != Record.size())
|
||||
NewGA->setThreadLocalMode(getDecodedThreadLocalMode(Record[OpNum++]));
|
||||
if (OpNum != Record.size())
|
||||
NewGA->setUnnamedAddr(getDecodedUnnamedAddrType(Record[OpNum++]));
|
||||
if (BitCode == bitc::MODULE_CODE_ALIAS ||
|
||||
BitCode == bitc::MODULE_CODE_ALIAS_OLD) {
|
||||
if (OpNum != Record.size())
|
||||
NewGA->setDLLStorageClass(getDecodedDLLStorageClass(Record[OpNum++]));
|
||||
else
|
||||
upgradeDLLImportExportLinkage(NewGA, Linkage);
|
||||
if (OpNum != Record.size())
|
||||
NewGA->setThreadLocalMode(getDecodedThreadLocalMode(Record[OpNum++]));
|
||||
if (OpNum != Record.size())
|
||||
NewGA->setUnnamedAddr(getDecodedUnnamedAddrType(Record[OpNum++]));
|
||||
}
|
||||
if (OpNum != Record.size())
|
||||
NewGA->setDSOLocal(getDecodedDSOLocal(Record[OpNum++]));
|
||||
ValueList.push_back(NewGA);
|
||||
|
||||
Reference in New Issue
Block a user