WinCOFF: Add support for -fdata-sections
authorDavid Majnemer <david.majnemer@gmail.com>
Tue, 25 Mar 2014 06:14:26 +0000 (06:14 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Tue, 25 Mar 2014 06:14:26 +0000 (06:14 +0000)
commit4fd5cd06c815724fa410c0bea276d919dea868c3
treee27e203429de11eeb68146260f2142dcdde9524c
parent9d5961d0d89b561be9ef91ea6cca81ef00672d17
WinCOFF: Add support for -fdata-sections

This is a pretty straight forward translation for COFF, we just need to
stick the data in a COMDAT section marked as
IMAGE_COMDAT_SELECT_NODUPLICATES.

N.B. We must be careful to avoid sticking entities with private linkage
in COMDAT groups.  COFF is pretty hostile to the renaming of entities so
we must be careful to disallow GlobalVariables with unstable names.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204703 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/TargetLoweringObjectFileImpl.cpp
test/CodeGen/X86/global-sections.ll