mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-14 12:28:37 +08:00

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).
19 lines
389 B
Makefile
19 lines
389 B
Makefile
#source: sort-file2.s
|
|
#source: sort-file1.s
|
|
#ld: -T sort-file.t
|
|
#nm: -n
|
|
|
|
# Check that SORT_BY_NAME on filenames works
|
|
# the text sections should come in sorted order, the data
|
|
# sections in input order. Note how we specifically pass
|
|
# the object filenames in non-alphabetical order
|
|
#...
|
|
0[0-9a-f]* t infile1
|
|
#...
|
|
0[0-9a-f]* t infile2
|
|
#...
|
|
0[0-9a-f]* d data2
|
|
#...
|
|
0[0-9a-f]* d data1
|
|
#pass
|