Previously we supported only sorting by name.
I found that SORT_BY_ALIGNMENT is also often used in combination with nested sorting:
https://searchcode.com/codesearch/view/85938978/
https://searchcode.com/codesearch/view/47611074/
When there are nested section sorting commands in linker script, there can be at most 1
level of nesting for section sorting commands.
- SORT_BY_NAME (SORT_BY_ALIGNMENT (wildcard section pattern)). It will sort the input
sections by name first, then by alignment if 2 sections have the same name.
- SORT_BY_ALIGNMENT (SORT_BY_NAME (wildcard section pattern)). It will sort the input
sections by alignment first, then by name if 2 sections have the same alignment.
- SORT_BY_NAME (SORT_BY_NAME (wildcard section pattern)) is treated the same as SORT_
BY_NAME (wildcard section pattern).
- SORT_BY_ALIGNMENT (SORT_BY_ALIGNMENT (wildcard section pattern)) is treated the
same as SORT_BY_ALIGNMENT (wildcard section pattern).
- All other nested section sorting commands are invalid.
Patch implements that all above.