<div dir="ltr">Thanks!</div><div class="gmail_extra"><br><div class="gmail_quote">On 17 September 2016 at 05:50, George Rimar via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: grimar<br>
Date: Sat Sep 17 04:50:10 2016<br>
New Revision: 281818<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=281818&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=281818&view=rev</a><br>
Log:<br>
[ELF] Linkerscript: fixed bug about commands processing.<br>
<br>
It was possible situation about some commands just were not processed<br>
(were skipped) because of a bug appeared when constraint checking used.<br>
<br>
Testcase is attached.<br>
<br>
Added:<br>
    lld/trunk/test/ELF/<wbr>linkerscript/sections-<wbr>constraint4.s<br>
Modified:<br>
    lld/trunk/ELF/LinkerScript.cpp<br>
<br>
Modified: lld/trunk/ELF/LinkerScript.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LinkerScript.cpp?rev=281818&r1=281817&r2=281818&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lld/trunk/ELF/<wbr>LinkerScript.cpp?rev=281818&<wbr>r1=281817&r2=281818&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lld/trunk/ELF/LinkerScript.cpp (original)<br>
+++ lld/trunk/ELF/LinkerScript.cpp Sat Sep 17 04:50:10 2016<br>
@@ -297,6 +297,7 @@ void LinkerScript<ELFT>::<wbr>processCommands<br>
         for (InputSectionBase<ELFT> *S : V)<br>
           S->OutSec = nullptr;<br>
         Opt.Commands.erase(Iter);<br>
+        --I;<br>
         continue;<br>
       }<br>
<br>
<br>
Added: lld/trunk/test/ELF/<wbr>linkerscript/sections-<wbr>constraint4.s<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/linkerscript/sections-constraint4.s?rev=281818&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lld/trunk/test/ELF/<wbr>linkerscript/sections-<wbr>constraint4.s?rev=281818&view=<wbr>auto</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lld/trunk/test/ELF/<wbr>linkerscript/sections-<wbr>constraint4.s (added)<br>
+++ lld/trunk/test/ELF/<wbr>linkerscript/sections-<wbr>constraint4.s Sat Sep 17 04:50:10 2016<br>
@@ -0,0 +1,20 @@<br>
+# REQUIRES: x86<br>
+# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t<br>
+# RUN: echo "SECTIONS { \<br>
+# RUN:  .foo : ONLY_IF_RO { *(.foo) } \<br>
+# RUN:  .bar : {bar1 = .; *(.bar) } }" > %t1.script<br>
+# RUN: ld.lld -o %t1 --script %t1.script %t<br>
+# RUN: llvm-readobj -t %t1 | FileCheck %s<br>
+<br>
+# CHECK: Name: bar1<br>
+<br>
+.global _start<br>
+_start:<br>
+  nop<br>
+<br>
+.section .bar, "aw"<br>
+bar:<br>
+ .long 1<br>
+<br>
+.section .foo, "aw"<br>
+ .long 0<br>
<br>
<br>
______________________________<wbr>_________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>