[PATCH] D24582: [MC] Add section flag 'D' for disardable COFF sections

David Majnemer via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 14 15:01:54 PDT 2016


majnemer added a comment.

In https://reviews.llvm.org/D24582#543165, @rnk wrote:

> In https://reviews.llvm.org/D24582#543125, @majnemer wrote:
>
> > In https://reviews.llvm.org/D24582#543082, @rnk wrote:
> >
> > > In https://reviews.llvm.org/D24582#543071, @majnemer wrote:
> > >
> > > > I wonder if we should just adopt the section name hack for improved compatibility with mingw. We'd give any section which starts with .debug IMAGE_SCN_MEM_DISCARDABLE
> > >
> > >
> > > Maybe we should do both? I don't want to leave MCSectionCOFF with an incomplete .section serialization.
> >
> >
> > It won't work when we try to take our .s output to mingw though.  Seeing as how this won't work in the general case, I'd suggest the following:
> >
> > - Infer IMAGE_SCN_MEM_DISCARDABLE if the section starts with .debug
> > - Raise an error if we have a section with IMAGE_SCN_MEM_DISCARDABLE which does not start with .debug
>
>
> How about I do all that, and instead of raising an error if there is a discardable section that doesn't start with .debug, I emit the 'D' flag?


SGTM


https://reviews.llvm.org/D24582





More information about the llvm-commits mailing list