[PATCH] D34326: [ELF] - Support SORT_BY_INIT_PRIORITY for .ctors.*/.dtors sections in linkerscript.

Davide Italiano via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 20 20:03:34 PDT 2017


davide added a comment.

In https://reviews.llvm.org/D34326#786241, @ruiu wrote:

> The rule this patch implements seems too odd that I don't think we should handle this. If you want to sort .ctors or .dtors, I think you can use SORT_BY_NAME. If you use SORT_BY_INIT_PRIORITY on .ctors or .dtors, that is a misuse of the feature.


Agree, what was trying to point out in my first post :)
My guess about the real reason why bfd has this in their default linker script is that they're trying to support ordering of mixed `.ctors` and `.init_array` and given they're always driven by their default linkerscript, unless overridden, they can't support this in a different way.


https://reviews.llvm.org/D34326





More information about the llvm-commits mailing list