COFF: Let globals with private linkage reside in their own section

COFF COMDATs (for selection kinds other than 'select any') require at
least one non-section symbol in the symbol table.
Satisfy this by morally enhancing the linkage from private to internal.

Differential Revision: http://reviews.llvm.org/D8394

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232570 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Majnemer
2015-03-17 23:54:51 +00:00
parent 11f53b7797
commit 7605cdd6e4
10 changed files with 56 additions and 13 deletions

View File

@ -150,8 +150,8 @@ DataLayout::InvalidPointerElem = { 0U, 0U, 0U, ~0U };
const char *DataLayout::getManglingComponent(const Triple &T) {
if (T.isOSBinFormatMachO())
return "-m:o";
if (T.isOSWindows() && T.getArch() == Triple::x86 && T.isOSBinFormatCOFF())
return "-m:w";
if (T.isOSWindows() && T.isOSBinFormatCOFF())
return T.getArch() == Triple::x86 ? "-m:x" : "-m:w";
return "-m:e";
}
@ -359,7 +359,10 @@ void DataLayout::parseSpecifier(StringRef Desc) {
ManglingMode = MM_Mips;
break;
case 'w':
ManglingMode = MM_WINCOFF;
ManglingMode = MM_WinCOFF;
break;
case 'x':
ManglingMode = MM_WinCOFFX86;
break;
}
break;