[lld] r188046 - [PECOFF] Fully cover the switch for COMDAT attributes and add a comment.
Rui Ueyama
ruiu at google.com
Thu Aug 8 18:06:21 PDT 2013
Author: ruiu
Date: Thu Aug 8 20:06:21 2013
New Revision: 188046
URL: http://llvm.org/viewvc/llvm-project?rev=188046&view=rev
Log:
[PECOFF] Fully cover the switch for COMDAT attributes and add a comment.
Modified:
lld/trunk/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp
Modified: lld/trunk/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp?rev=188046&r1=188045&r2=188046&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp Thu Aug 8 20:06:21 2013
@@ -85,9 +85,20 @@ DefinedAtom::Merge getMerge(const coff_a
switch (auxsym->Selection) {
case llvm::COFF::IMAGE_COMDAT_SELECT_NODUPLICATES:
return DefinedAtom::mergeNo;
- default:
- // FIXME: COFF supports more mergable symbol attributes.
+ case llvm::COFF::IMAGE_COMDAT_SELECT_ANY:
+ return DefinedAtom::mergeAsWeakAndAddressUsed;
+ case llvm::COFF::IMAGE_COMDAT_SELECT_SAME_SIZE:
+ case llvm::COFF::IMAGE_COMDAT_SELECT_EXACT_MATCH:
+ case llvm::COFF::IMAGE_COMDAT_SELECT_ASSOCIATIVE:
+ case llvm::COFF::IMAGE_COMDAT_SELECT_LARGEST:
+ case llvm::COFF::IMAGE_COMDAT_SELECT_NEWEST:
+ // FIXME: These attributes has more complicated semantics than the regular
+ // weak symbol. These are mapped to mergeAsWeakAndAddressUsed for now
+ // because the core linker does not support them yet. We eventually have
+ // to implement them for full COFF support.
return DefinedAtom::mergeAsWeakAndAddressUsed;
+ default:
+ llvm_unreachable("Unknown merge type");
}
}
More information about the llvm-commits
mailing list