These input sections can have decimal numbers as the priority suffix.
SORT is an alias for SORT_BY_NAME, hence will result in wrong order of
constructors / destructors in output sections. Fix by using the correct
sorting command SORT_BY_INIT_PRIORITY instead [1].
If the input section does not have a priority suffix, then it should be
treated as having a priority of 65535.
Currently these sections are not used, there should be no functional
change.
Note: As for the .ctors and .dtors sections, the priority suffix is in
the form of %05u so there is no semantic difference between SORT_BY_NAME
and SORT_BY_INIT_PRIORITY [2].
- https://sourceware.org/binutils/docs/ld/Input-Section-Wildcards.html
- https://reviews.llvm.org/D91187
In memoriam: hselasky
Obtained from: https://reviews.freebsd.org/D40467
MFC after: 1 week