<div dir="ltr">+<span style="font-size:12.8px">tmsriram because he seems to have done something with --section-ordering-file so he might have an expert's opinion about how much it is useful/effective.</span></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 20, 2016 at 8:48 AM, George Rimar <span dir="ltr"><<a href="mailto:grimar@accesssoftek.com" target="_blank">grimar@accesssoftek.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">grimar added a comment.<br>
<span class=""><br>
In <a href="https://reviews.llvm.org/D25766#574420" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D25766#574420</a>, @davide wrote:<br>
<br>
> In <a href="https://reviews.llvm.org/D25766#574368" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D25766#574368</a>, @ruiu wrote:<br>
><br>
> > Is this effort coordinated with Davide?<br>
><br>
><br>
> Yes! Thanks George for taking care of this.<br>
>  BTW, I think the hard part of this feature is trying to evaluate and understand if it's worth it.<br>
>  You may want to do some benchmarking/write a systap/dtrace script to collect data and feed into the linker and make sure this has some real impact. I recommend to use bare metal for testing and not VM as the results might be unreliable.<br>
>  Rui, Rafael, what do you think?<br>
<br>
<br>
</span>After today investigations I found next more or less known ways to produce such file.<br>
<br>
- First is use of valgring + icegrind plugin:<br>
<br>
<a href="https://blog.mozilla.org/tglek/2010/04/07/icegrind-valgrind-plugin-for-optimizing-cold-startup/" rel="noreferrer" target="_blank">https://blog.mozilla.org/<wbr>tglek/2010/04/07/icegrind-<wbr>valgrind-plugin-for-<wbr>optimizing-cold-startup/</a><br>
<a href="https://glandium.org/blog/?p=1008" rel="noreferrer" target="_blank">https://glandium.org/blog/?p=<wbr>1008</a><br>
Method looks a bit outdated though.<br>
<br>
- Use of function_reordering_plugin from gcc google branch (<a href="https://codereview.appspot.com/5124041" rel="noreferrer" target="_blank">https://codereview.appspot.<wbr>com/5124041</a>, <a href="https://codereview.appspot.com/4802070/" rel="noreferrer" target="_blank">https://codereview.appspot.<wbr>com/4802070/</a>).<br>
<br>
As far I understand along with job it do, it also should produce final_layout.txt file where sections should be dumped in a correct order,<br>
and we should be able to reuse that file for LLD needs.<br>
<br>
- facebook/hhvm (<a href="https://github.com/facebook/hhvm/tree/master/hphp/tools/hfsort" rel="noreferrer" target="_blank">https://github.com/facebook/<wbr>hhvm/tree/master/hphp/tools/<wbr>hfsort</a>) has tools and scrips for generating sections ordering file for gold, though<br>
<br>
I am not sure how much easy can be to reuse it for any other applications.<br>
<br>
I am going to check gcc way tomorrow, it seems to me as most easy possible path.<br>
<br>
<br>
<a href="https://reviews.llvm.org/D25766" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D25766</a><br>
<br>
<br>
<br>
</blockquote></div><br></div>