Fix a major regression on COFF targets introduced by r103267: 'discardable' section...
authorAnton Korobeynikov <asl@math.spbu.ru>
Tue, 6 Jul 2010 15:24:56 +0000 (15:24 +0000)
committerAnton Korobeynikov <asl@math.spbu.ru>
Tue, 6 Jul 2010 15:24:56 +0000 (15:24 +0000)
This way *only* debug sections can be discarded, but not the opposite. Seems like the copy-and-pasto from ELF code, since there it contains the reverse flag ('alloc').

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107658 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/TargetLoweringObjectFileImpl.cpp

index 350d50ccad94023e1ec97e08870e71d60e15ed05..a80cfc4b256fe62a124ba6ebd4ad2eb548962821 100644 (file)
@@ -936,7 +936,7 @@ static unsigned
 getCOFFSectionFlags(SectionKind K) {
   unsigned Flags = 0;
 
-  if (!K.isMetadata())
+  if (K.isMetadata())
     Flags |=
       COFF::IMAGE_SCN_MEM_DISCARDABLE;
   else if (K.isText())