<div dir="ltr">Hi Nick,<div><br></div><div>I think Rafael had in mind that we'd write something like:</div><div><br></div><div><span style="font-size:13px">_bzero:</span><br style="font-size:13px"><span style="font-size:13px">        mov %rdx, %rsi</span><br style="font-size:13px"><span style="font-size:13px">        mov %rsi, 0</span><br style="font-size:13px"><span style="font-size:13px">_memset = .</span><br style="font-size:13px"><span style="font-size:13px">        blah</span><br style="font-size:13px"><span style="font-size:13px">        blah</span><br></div><div><span style="font-size:13px"><br></span></div><div>Which would be more livable for people hand-writing code. I like this because, if workable, it'd provide a solution to <span style="font-size:13px"><a href="http://llvm.org/PR25381">http://llvm.org/PR25381</a> at the same time.</span></div><div><span style="font-size:13px"><br></span></div><div><span style="font-size:13px">- Lang.</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 7, 2016 at 6:00 PM, Nick Kledzik 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"><span class=""><br>
> On Mar 3, 2016, at 6:41 PM, Bob Wilson <<a href="mailto:bob.wilson@apple.com">bob.wilson@apple.com</a>> wrote:<br>
><br>
><br>
>> On Mar 3, 2016, at 12:31 PM, Rafael Espíndola <<a href="mailto:rafael.espindola@gmail.com">rafael.espindola@gmail.com</a>> wrote:<br>
>><br>
>> On 3 March 2016 at 15:20, Bob Wilson <<a href="mailto:bob.wilson@apple.com">bob.wilson@apple.com</a>> wrote:<br>
>>> bob.wilson added a comment.<br>
>>><br>
>>> The object files have a new SF_AltEntry flag to distinguish symbols that do not start a new atom. ld64 has had support for that for a while now.<br>
>><br>
>> OK, so the idea is that the<br>
>><br>
>> .alt_entry foo<br>
>><br>
>> directive causes foo to have the SF_AltEntry flag which tells the<br>
>> linker that foo doesn't define an atom.<br>
>><br>
>> Another possibility would be to close pr25381 as working as intended and have<br>
>><br>
>> foo = bar<br>
>> and<br>
>> foo = bar + 42<br>
>><br>
>> not start new atoms and produce SF_AltEntry (maybe dropping it for<br>
>> offset 0 as an optimization).<br>
</span>That may make compiler generated assembly file simpler, but I think hand written files would not use the = syntax.  They’d use:<br>
<br>
_bzero:<br>
        mov %rdx, %rsi<br>
        mov %rsi, 0<br>
        .alt_entry _memset<br>
_memset:<br>
        blah<br>
        blah<br>
<br>
The idea is you have one function that falls into the next, and you want to tell the linker they should not be moved apart.  To use the = syntax, you’d need to figure out how many bytes are in the first chunk of code. Using a regular label seems more natural.<br>
<br>
-Nick<br>
<span class=""><br>
<br>
<br>
>><br>
>> This would have the advantage of not needing a new directive and<br>
>> avoiding having to diagnose things like<br>
>><br>
>> foo:<br>
>> .alt_entry foo<br>
><br>
> I’m open to that. I checked with the Swift team, and they’re generating global aliases in IR without relying on the assembly syntax.<br>
><br>
> + Nick, Lang, and Louis<br>
> Do you have an opinion on this from the linker’s perspective?<br>
><br>
> Here’s a test that Akira wrote for the assembly-to-object part.<br>
</span>> <altent.s><br>
<div class="HOEnZb"><div class="h5"><br>
_______________________________________________<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/mailman/listinfo/llvm-commits</a><br>
</div></div></blockquote></div><br></div>