<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
><br>
> Also it probably shouldn't be returning subsections via symbols as well.<br>
><br>
> Anyhow, let's solve the original problem better :)<br>
<br>
Soo... any ideas here?<br></blockquote><div><br></div><div>Sure. Looking through the code a bit...</div><div><br></div><div>A) Rename getNoopForMacho to just getNoop. I don't think any of the nop codes are mach-o specific.</div><div>B) The subsections via symbols thing there is important, as far as I know only darwin will actually fail if a function is empty (and that's only because the linker will just coalesce the two symbols and ditch one iirc).</div><div>C) Reading the patch that put in RequiresNoop I think it's still an "only darwin" thing.</div><div><br></div><div>At the very least gcc doesn't have a problem emitting:</div><div><div><br></div><div>dzur:~/tmp> cat foo.c</div><div>void f(void) {</div><div>  __builtin_unreachable();</div><div>}</div></div><div><br></div><div><div>dzur:~/tmp> gcc -O3 -S -o - -fomit-frame-pointer foo.c</div><div><span class="Apple-tab-span" style="white-space:pre">       </span>.file<span class="Apple-tab-span" style="white-space:pre">       </span>"foo.c"</div><div><span class="Apple-tab-span" style="white-space:pre">    </span>.section<span class="Apple-tab-span" style="white-space:pre">    </span>.text.unlikely,"ax",@progbits</div><div>.LCOLDB0:</div><div><span class="Apple-tab-span" style="white-space:pre">      </span>.text</div><div>.LHOTB0:</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>.p2align 4,,15</div><div><span class="Apple-tab-span" style="white-space:pre">       </span>.globl<span class="Apple-tab-span" style="white-space:pre">      </span>f</div><div><span class="Apple-tab-span" style="white-space:pre">    </span>.type<span class="Apple-tab-span" style="white-space:pre">       </span>f, @function</div><div>f:</div><div>.LFB0:</div><div><span class="Apple-tab-span" style="white-space:pre">   </span>.cfi_startproc</div><div><span class="Apple-tab-span" style="white-space:pre">       </span>.cfi_endproc</div><div>.LFE0:</div><div><span class="Apple-tab-span" style="white-space:pre">    </span>.size<span class="Apple-tab-span" style="white-space:pre">       </span>f, .-f</div><div><span class="Apple-tab-span" style="white-space:pre">       </span>.section<span class="Apple-tab-span" style="white-space:pre">    </span>.text.unlikely</div><div>.LCOLDE0:</div><div><span class="Apple-tab-span" style="white-space:pre">       </span>.text</div><div>.LHOTE0:</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>.ident<span class="Apple-tab-span" style="white-space:pre">      </span>"GCC: (GNU) 4.9.0 20140310 (experimental)"</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>.section<span class="Apple-tab-span" style="white-space:pre">    </span>.note.GNU-stack,"",@progbits</div></div><div><br></div><div>and I think the FDE appears valid there. Which means that r108568 should be darwin only.</div><div><br></div><div>So, ultimately, I think the correct fix is to make sure that HasAnyRealCode returns false for the testcases that r108568 was designed to work around, then remove the RequiresNoop bit from the conditional that was leading you down this path.</div><div><br></div><div>How does this sound?</div><div><br></div><div>-eric</div></div>