<div dir="ltr">I tried to apply this with a test case that doesn't run the optimizer, and discovered something scary.  GlobalAlias inherits from GlobalValue and therefore has a section, but the LangRef doesn't document this and we don't know how to serialize and deserialize it.<div>
<br></div><div>So, if we applied this patch, the section on the alias would be dropped if we did LTO.  :(</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Feb 6, 2014 at 3:17 PM, Mark Mentovai <span dir="ltr"><<a href="mailto:mark@chromium.org" target="_blank">mark@chromium.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">LLVM r183756 changed how GlobalOpt handled aliases, exposing a latent bug in clang that caused attributes, such as __attribute__((section())) to not be honored in emitted code with this optimization. This optimization in question replaces an alias target with its sole alias, taking the name, linkage, and attributes of the alias. clang creates aliases for certain extern "C" values, setting the linkage of the alias correctly, but ignoring the attributes. This patch gives the aliases of such extern "C" values the same attributes as their targets, so that when GlobalOpt is performed, the correct attributes are used.<br>

</div>
<br>_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
<br></blockquote></div><br></div>