<br><br><div class="gmail_quote"><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div style="word-wrap:break-word"><div><div class="im"><div>...</div></div><div>Thanks, applied in r103150! llvm-mc -filetype=obj probably needs a similar patch.</div>
<div class="im"><div><br></div></div></div></div></blockquote><div><br></div><div>cool!, I will make that change and submit it too. </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div style="word-wrap:break-word"><div><div class="im"><blockquote type="cite"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
<div style="word-wrap:break-word"><div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">
</div></div></div></blockquote></div></blockquote><div>...</div></div><div>Yes probably, I don't know what the .def and .scl directives "do" :)</div><div><br></div></div></div></blockquote><div><br></div><div>
I think I can figure out the right thing to do here.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div style="word-wrap:break-word"><div><div></div>
<div>Also, w.r.t. section handling stuff, there is this fixme in the asmprinter:</div><div><br></div><div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"> } <span style="color:#b50da1">else</span> <span style="color:#b50da1">if</span> (<span style="color:#b50da1">const</span> <span style="color:#b50da1">char</span> *LinkOnce = MAI->getLinkOnceDirective()) {</div>
<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;color:rgb(20, 135, 11)"><span style="color:#000000"> </span>// .globl _foo</div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">
OutStreamer.EmitSymbolAttribute(GVSym, MCSA_Global);</div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;color:rgb(20, 135, 11)"><span style="color:#000000"> </span>// FIXME: linkonce should be a section attribute, handled by COFF Section</div>
<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;color:rgb(20, 135, 11)"><span style="color:#000000"> </span>// assignment.</div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;color:rgb(58, 0, 252)">
<span style="color:#000000"> </span><span style="color:#14870b">// <a href="http://sourceware.org/binutils/docs-2.20/as/Linkonce.html#Linkonce" target="_blank"><span style="color:#3a00fc">http://sourceware.org/binutils/docs-2.20/as/Linkonce.html#Linkonce</span></a></span></div>
<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;color:rgb(20, 135, 11)"><span style="color:#000000"> </span>// .linkonce discard</div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;color:rgb(20, 135, 11)">
<span style="color:#000000"> </span>// FIXME: It would be nice to use .linkonce samesize for non-common</div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;color:rgb(20, 135, 11)"><span style="color:#000000"> </span>// globals.</div>
<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"> OutStreamer.EmitRawText(StringRef(LinkOnce));</div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"> } <span style="color:#b50da1">else</span> {</div>
<div><font face="Inconsolata"><br></font></div><div><font face="Inconsolata">Basically, it seems like the MCSectionCOFF implementation should get the linkonce bit. I'm not an expert on COFF, but I think that's the right place for it. ".linkonce" will also have to be added as a new MCStreamer api, which would set the bit.</font></div>
<div><font face="Inconsolata"><br></font></div></div></div></div></blockquote><div><br></div><div>linkonce is one option for COFF COMDAT sections. I think that this call should not exist at all, instead, when the AsmPrinter asks the TLOF what section to use for the global, TLOF should create a new unique section with the bit set already.</div>
<div></div></div><div><br></div><div>One thing that I don't understand is why common symbols do not get sections assigned to them. I ended up assigning them to the '.bss' section in my streamer (which I now know was wrong) but it still seems like they should be part of some section. At least in COFF, they will be handled as a COMDAT just like symbols with the linkonce linkage type.</div>
<div><br></div><div>I guess this all goes back to the assembly language view of things. I think I have enough information to handle these things correctly now.</div><div><br></div><div>Thanks for the feedback.</div><br><div>
- Nathan</div><div><br></div>