MC: prevent early DCE of empty sections
authorSaleem Abdulrasool <compnerd@compnerd.org>
Fri, 6 Jun 2014 21:40:16 +0000 (21:40 +0000)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Fri, 6 Jun 2014 21:40:16 +0000 (21:40 +0000)
commita51acc7631fec5bc371d996d7cea45e8a3caee95
tree9740f10aef3c571fb536ee42b5446811a38d173d
parent0da5960e5b7473b97fbb891e0b2761d3012ba724
MC: prevent early DCE of empty sections

Prevent the early elimination of sections in the object writer.  There may be
references to the section itself by other symbols, which may potentially not be
possible to resolve.  ML (Visual Studio's Macro Assembler) also seems to retain
empty sections.

The elimination of symbols and sections which are unused should really occur at
the link phase.  This will not cause any change in the resulting binary, simply
in the generated object files.

The adjustments to the other unit tests account for the fluctuating section
index caused by the appearance of sections which were previously discarded.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210373 91177308-0d34-0410-b5e6-96231b3b80d8
lib/MC/WinCOFFObjectWriter.cpp
test/MC/COFF/alias.s
test/MC/COFF/basic-coff-64.s
test/MC/COFF/basic-coff.s
test/MC/COFF/early-dce.s [new file with mode: 0644]
test/MC/COFF/linkonce.s
test/MC/COFF/section-comdat.s
test/MC/COFF/section-name-encoding.s
test/MC/COFF/seh.s
test/MC/COFF/symbol-fragment-offset-64.s
test/MC/COFF/symbol-fragment-offset.s