<div dir="ltr">Hi Rafael,<div><br></div><div>I'm finally getting back to this.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span style="font-size:13px">Now you get a crash when using .</span><span class="" style="font-size:13px">alt_entry</span><span style="font-size:13px"> on non MachO. It should be<br></span><span style="font-size:13px">an error. That is, you should not be parsing this in generic code,<br></span><span style="font-size:13px">only on MachO specific code.</span></blockquote><div><span style="font-size:13px"><br></span></div><div>Do you have a test-case that crashes on non-MachO? The trivial cases I tried were silently accepted.</div><div><br></div><div>I'm going to make any use of .alt_entry on other formats an error anyway, but I'd like to make sure I understand any crashes first.</div><div><span style="font-size:13px"><br></span></div><div><span style="font-size:13px">- Lang.</span></div><div><span style="font-size:13px"><br></span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 15, 2016 at 10:40 AM, Rafael Espíndola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I don't think this was ready for commit.<br>
<br>
Why was it decided that the .alt_entry syntax was needed?<br>
<span class=""><br>
> +<br>
> +    if (MAI->hasAltEntry() && isa<MCBinaryExpr>(Expr))<br>
> +      OutStreamer->EmitSymbolAttribute(Name, MCSA_AltEntry);<br>
> +<br>
<br>
</span>I think this is a odd. You are handling "foo" and "foo + 0"<br>
differently. Given what you handle "a = ..." in MC, why do you need to<br>
change codegen at all?<br>
<span class=""><br>
>    DirectiveKindMap[".symbol_resolver"] = DK_SYMBOL_RESOLVER;<br>
> +  DirectiveKindMap[".alt_entry"] = DK_ALT_ENTRY;<br>
>    DirectiveKindMap[".private_extern"] = DK_PRIVATE_EXTERN;<br>
>    DirectiveKindMap[".reference"] = DK_REFERENCE;<br>
>    DirectiveKindMap[".weak_definition"] = DK_WEAK_DEFINITION;<br>
<br>
</span>Now you get a crash when using .alt_entry on non MachO. It should be<br>
an error. That is, you should not be parsing this in generic code,<br>
only on MachO specific code.<br>
<br>
Probably most importantly:<br>
<br>
As noted in the review this introduces a different bug with regards to<br>
ld and llvm-mc not agreeing about which symbols are atoms. Given<br>
<br>
bar:<br>
        .alt_entry foo<br>
foo:<br>
call bar<br>
<br>
llvm-mc produces a relocation. Given<br>
<br>
bar:<br>
foo = .<br>
call bar<br>
<br>
we get no relocation. In both cases the linker thinks foo is not an atom.<br>
<br>
Cheers,<br>
Rafael<br>
</blockquote></div><br></div>