[lld] [LLD] [COFF] Fix handling of comdat .drectve sections (PR #68116)

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 3 10:19:33 PDT 2023


mstorsjo wrote:

> I take it that we already parse all .drective sections and interpret them as flags, even if they are comdat? Certainly we have to parse the flags before we do comdat resolution.

In this case, the contents of the comdat section does get parsed within `readSection`: https://github.com/llvm/llvm-project/blob/llvmorg-17.0.2/lld/COFF/InputFiles.cpp#L212-L217 (Apparently this stores it within one single `StringRef directives;` - this wouldn't work right if the file had several separate directive sections.)

In particular, the testcase I'm adding here does test and make sure that the directives in the comdat do get applied.


https://github.com/llvm/llvm-project/pull/68116


More information about the llvm-commits mailing list