Hi guys,<div><br></div><div>While trying to get dwarf debugging information to work with Win32 COFF targets, I came across a couple of issues with the current implementation of WinCOFFObjectWriter. Emitting empty section causes debug information to invalid, as the presence of certain debug section implies available information, and emission of labels as symbols confused gdb about the structure of the program.</div>
<div><br></div><div>The attached patch allows the WinCOFFObjectWriter to drop empty sections, and label symbols. It converts relocations targeted at symbols into relocations relative to the containing section.</div><div><br>
</div><div>I have not run the tests in the '/test/MC/COFF', but have run through the unit-test framework for my compiler and generated some text executables with clang and everything looks to be in order. It may change the output of the  '/test/MC/COFF' if the string references are emitted as temporaries.</div>
<div><br></div><div>-Nathan</div><div><br></div>