[PATCH] D25766: [ELF] - Implemented --section-ordering-file option.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 20 08:48:26 PDT 2016

grimar added a comment.

In https://reviews.llvm.org/D25766#574420, @davide wrote:

> In https://reviews.llvm.org/D25766#574368, @ruiu wrote:
> > Is this effort coordinated with Davide?
> Yes! Thanks George for taking care of this.
>  BTW, I think the hard part of this feature is trying to evaluate and understand if it's worth it.
>  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.
>  Rui, Rafael, what do you think?

After today investigations I found next more or less known ways to produce such file.

- First is use of valgring + icegrind plugin:

Method looks a bit outdated though.

- Use of function_reordering_plugin from gcc google branch (https://codereview.appspot.com/5124041, https://codereview.appspot.com/4802070/).

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,
and we should be able to reuse that file for LLD needs.

- facebook/hhvm (https://github.com/facebook/hhvm/tree/master/hphp/tools/hfsort) has tools and scrips for generating sections ordering file for gold, though

I am not sure how much easy can be to reuse it for any other applications.

I am going to check gcc way tomorrow, it seems to me as most easy possible path.


More information about the llvm-commits mailing list