<div dir="ltr">LGTM. This matches the output of MSVC.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, May 20, 2014 at 10:15 PM, Saleem Abdulrasool <span dir="ltr"><<a href="mailto:compnerd@compnerd.org" target="_blank">compnerd@compnerd.org</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: compnerd<br>
Date: Wed May 21 00:15:01 2014<br>
New Revision: 209273<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=209273&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=209273&view=rev</a><br>
Log:<br>
MC: mark COFF .drectve section as REMOVE<br>
<br>
The .drectve section should be marked as IMAGE_SCN_LNK_REMOVE.  This matches what<br>
the MSVC toolchain does and accurately reflects that this section should not be<br>
emitted into the final binary.  This section is merely information for the<br>
linker, comprising of additional linker directives.<br>
<br>
Added:<br>
    llvm/trunk/test/MC/COFF/directive-section-characteristics.ll<br>
Modified:<br>
    llvm/trunk/lib/MC/MCObjectFileInfo.cpp<br>
<br>
Modified: llvm/trunk/lib/MC/MCObjectFileInfo.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCObjectFileInfo.cpp?rev=209273&r1=209272&r2=209273&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCObjectFileInfo.cpp?rev=209273&r1=209272&r2=209273&view=diff</a><br>


==============================================================================<br>
--- llvm/trunk/lib/MC/MCObjectFileInfo.cpp (original)<br>
+++ llvm/trunk/lib/MC/MCObjectFileInfo.cpp Wed May 21 00:15:01 2014<br>
@@ -739,7 +739,7 @@ void MCObjectFileInfo::InitCOFFMCObjectF<br>
<br>
   DrectveSection =<br>
     Ctx->getCOFFSection(".drectve",<br>
-                        COFF::IMAGE_SCN_LNK_INFO,<br>
+                        COFF::IMAGE_SCN_LNK_INFO | COFF::IMAGE_SCN_LNK_REMOVE,<br>
                         SectionKind::getMetadata());<br>
<br>
   PDataSection =<br>
<br>
Added: llvm/trunk/test/MC/COFF/directive-section-characteristics.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/COFF/directive-section-characteristics.ll?rev=209273&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/COFF/directive-section-characteristics.ll?rev=209273&view=auto</a><br>


==============================================================================<br>
--- llvm/trunk/test/MC/COFF/directive-section-characteristics.ll (added)<br>
+++ llvm/trunk/test/MC/COFF/directive-section-characteristics.ll Wed May 21 00:15:01 2014<br>
@@ -0,0 +1,17 @@<br>
+; RUN: llc -mtriple i686-windows -filetype obj -o - %s | llvm-readobj -sections \<br>
+; RUN:    | FileCheck %s<br>
+<br>
+define dllexport void @function() {<br>
+entry:<br>
+  ret void<br>
+}<br>
+<br>
+; CHECK: Section {<br>
+; CHECK:   Name: .drectve<br>
+; CHECK:   Characteristics [<br>
+; CHECK:     IMAGE_SCN_ALIGN_1BYTES<br>
+; CHECK:     IMAGE_SCN_LNK_INFO<br>
+; CHECK:     IMAGE_SCN_LNK_REMOVE<br>
+; CHECK:   ]<br>
+; CHECK: }<br>
+<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>