diff options
author | Michael Matz <matz@suse.de> | 2022-11-10 16:06:20 +0100 |
---|---|---|
committer | Michael Matz <matz@suse.de> | 2022-11-28 16:30:18 +0100 |
commit | af31506c31a59a6edbb13498d6075fa704b801cd (patch) | |
tree | ef51c9ca7ae6683c3a2fc134e3b4074245df4dc0 /ld/ldlang.h | |
parent | 049522cae9798e51dd0c58566a9a2c61ba9100a9 (diff) | |
download | gdb-af31506c31a59a6edbb13498d6075fa704b801cd.zip gdb-af31506c31a59a6edbb13498d6075fa704b801cd.tar.gz gdb-af31506c31a59a6edbb13498d6075fa704b801cd.tar.bz2 |
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).
Diffstat (limited to 'ld/ldlang.h')
-rw-r--r-- | ld/ldlang.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ld/ldlang.h b/ld/ldlang.h index b853cdb..713c528 100644 --- a/ld/ldlang.h +++ b/ld/ldlang.h @@ -384,6 +384,7 @@ struct lang_wild_statement_struct lang_statement_header_type header; const char *filename; bool filenames_sorted; + bool any_specs_sorted; struct wildcard_list *section_list; bool keep_sections; lang_statement_list_type children; @@ -391,7 +392,7 @@ struct lang_wild_statement_struct walk_wild_section_handler_t walk_wild_section_handler; struct wildcard_list *handler_data[4]; - lang_section_bst_type *tree; + lang_section_bst_type *tree, **rightmost; struct flag_info *section_flag_list; }; |