[MC] Improve COFF associative section lookup
authorReid Kleckner <rnk@google.com>
Thu, 16 Aug 2018 21:34:41 +0000 (21:34 +0000)
committerReid Kleckner <rnk@google.com>
Thu, 16 Aug 2018 21:34:41 +0000 (21:34 +0000)
commit602c0dafdd022f23a26506fb26c6ce8ec7ae8a4d
tree7b67665c3e8d54f7687a168215526a0002d7bcd8
parent19763d93fdbe678485ff97fc43ac7472a7cdf807
[MC] Improve COFF associative section lookup

Handle the case when the symbol is private. Private symbols are not in
the COFF object file symbol table, so they aren't inserted into
SymbolMap. We can't look up the section of the symbol that way. Instead,
get the MCSection from the MCSymbol and map that to the object file
section.

Print a better error message when the symbol has no section, like when
the symbol is undefined.

Fixes PR38607

llvm-svn: 339942
llvm/lib/MC/WinCOFFObjectWriter.cpp
llvm/test/MC/COFF/assoc-private.s [new file with mode: 0644]
llvm/test/MC/COFF/assoc-undef.s [new file with mode: 0644]
llvm/test/MC/COFF/section-comdat.s