llvm: add llvm-dlltool support to the archiver

A PE COFF spec compliant import library generator.
Intended to be used with mingw-w64.

Supports:
PE COFF spec (section 8, Import Library Format)
PE COFF spec (Aux Format 3: Weak Externals)

Reviewed By: ruiu
Differential Revision: https://reviews.llvm.org/D29892

This reapplies rL308329, which was reverted in rL308374

llvm-svn: 308379
This commit is contained in:
Martell Malone
2017-07-18 21:26:38 +00:00
parent f6b8ac28ab
commit 1079ef8dfe
18 changed files with 411 additions and 26 deletions

View File

@@ -227,8 +227,11 @@ uint32_t COFFObjectFile::getSymbolFlags(DataRefImpl Ref) const {
if (Symb.isExternal() || Symb.isWeakExternal())
Result |= SymbolRef::SF_Global;
if (Symb.isWeakExternal())
if (Symb.isWeakExternal()) {
Result |= SymbolRef::SF_Weak;
// We use indirect to allow the archiver to write weak externs
Result |= SymbolRef::SF_Indirect;
}
if (Symb.getSectionNumber() == COFF::IMAGE_SYM_ABSOLUTE)
Result |= SymbolRef::SF_Absolute;