Please upload a new patch after you add comments. This patch basically looks good (note that it does not mean I have LGTM'ed this, just in case), but because COFF section groups have different semantics from ELF's, I'd like to know how your code would (or wouldn't) work for COFF. http://llvm-reviews.chandlerc.com/D3182