[COFF] Hoist constant pool handling from X86AsmPrinter into AsmPrinter
authorMartin Storsjo <martin@martin.st>
Wed, 25 Jul 2018 18:35:31 +0000 (18:35 +0000)
committerMartin Storsjo <martin@martin.st>
Wed, 25 Jul 2018 18:35:31 +0000 (18:35 +0000)
commitd2662c32fbb8ded38cd48fea954aea66864eb37d
treee87ac8e2141e3d070e91315f39fda174c3d3b3be
parentf55b8c6e91b54a6d4a48187c4f897c8bf157c215
[COFF] Hoist constant pool handling from X86AsmPrinter into AsmPrinter

In SVN r334523, the first half of comdat constant pool handling was
hoisted from X86WindowsTargetObjectFile (which despite the name only
was used for msvc targets) into the arch independent
TargetLoweringObjectFileCOFF, but the other half of the handling was
left behind in X86AsmPrinter::GetCPISymbol.

With only half of the handling in place, inconsistent comdat
sections/symbols are created, causing issues with both GNU binutils
(avoided for X86 in SVN r335918) and with the MS linker, which
would complain like this:

fatal error LNK1143: invalid or corrupt file: no symbol for COMDAT section 0x4

Differential Revision: https://reviews.llvm.org/D49644

llvm-svn: 337950
llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
llvm/lib/Target/ARM/ARMAsmPrinter.cpp
llvm/lib/Target/ARM/ARMAsmPrinter.h
llvm/lib/Target/X86/X86AsmPrinter.cpp
llvm/lib/Target/X86/X86AsmPrinter.h
llvm/test/CodeGen/AArch64/win_cst_pool.ll