[PATCH] D56929: lld-link: Use just one code path to process associative comdats, reject some invalid associated comdats

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 22 15:37:17 PST 2019


ruiu added inline comments.


================
Comment at: lld/COFF/InputFiles.cpp:239
+    COFFObj->getSectionName(ParentSec, ParentName);
+    error("associative comdat " + Name +
+          " refers to associative comdat " + ParentName);
----------------
pcc wrote:
> I think this is not the only reason why we might end up here. We could also get here if an `IMAGE_SCN_LNK_COMDAT` section does not have any symbols at all (or just has a section definition) and another section is associative with it. I reckon it's probably not worth trying to disambiguate these cases in code so maybe the diagnostic should just say `invalid COFF file`? (I am slightly inclined to say that we shouldn't try to diagnose at all here and should just let the linker crash.)
The error message is more user-friendly if you include the name of a file. You can do that by appending `toString(this)` to the error message.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56929/new/

https://reviews.llvm.org/D56929





More information about the llvm-commits mailing list