Only use wild_sort_fast
authorMichael Matz <matz@suse.de>
Thu, 10 Nov 2022 15:06:20 +0000 (16:06 +0100)
committerMichael Matz <matz@suse.de>
Mon, 28 Nov 2022 15:30:18 +0000 (16:30 +0100)
commitaf31506c31a59a6edbb13498d6075fa704b801cd
treeef51c9ca7ae6683c3a2fc134e3b4074245df4dc0
parent049522cae9798e51dd0c58566a9a2c61ba9100a9
Only use wild_sort_fast

there's no reason why the tree-based variant can't always be used
when sorting is required, it merely needs to also support filename
sorting and have a fast path for insertion at end (aka rightmost tree
leaf).

The filename sorting isn't tested anywhere and the only scripttempl
that uses it is avr (for 'SORT(*)(.ctors)'), and I believe even there it
was a mistake.  Either way, this adds a testcase for filename sorting as
well.

Then the non-BST based sorting can be simplified to only support
the fast case of no sorting required at all (at the same time renaming
the two variants to _sort and _nosort).
ld/ldlang.c
ld/ldlang.h
ld/testsuite/ld-scripts/sort-file.d [new file with mode: 0644]
ld/testsuite/ld-scripts/sort-file.t [new file with mode: 0644]
ld/testsuite/ld-scripts/sort-file1.s [new file with mode: 0644]
ld/testsuite/ld-scripts/sort-file2.s [new file with mode: 0644]