[PECOFF] Fully cover the switch for COMDAT attributes and add a comment.

llvm-svn: 188046
This commit is contained in:
Rui Ueyama 2013-08-09 01:06:21 +00:00
parent 6427ae8ae6
commit d7414e25da
1 changed files with 13 additions and 2 deletions

View File

@ -85,9 +85,20 @@ DefinedAtom::Merge getMerge(const coff_aux_section_definition *auxsym) {
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");
}
}