diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2006-08-08 16:08:47 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2006-08-08 16:08:47 +0000 |
commit | e6f2cbf536d07211d8ff0d47c2f961a216f046f8 (patch) | |
tree | 25ae860b384d83bcd80e84f3966aefecaaea77ea /ld/ldlang.c | |
parent | 6798554723617c1f63f3359e89aa96df72f9daf3 (diff) | |
download | gdb-e6f2cbf536d07211d8ff0d47c2f961a216f046f8.zip gdb-e6f2cbf536d07211d8ff0d47c2f961a216f046f8.tar.gz gdb-e6f2cbf536d07211d8ff0d47c2f961a216f046f8.tar.bz2 |
2006-08-08 H.J. Lu <hongjiu.lu@intel.com>
PR ld/3006
* ldlang.c (lang_section_bst_type): Moved to ...
* ldlang.h: Here.
* ldlang.h (lang_wild_statement_struct): Add a tree field.
* ldlang.c (wild_sort_fast): Use the tree field for BST.
(wild): Likeise.
(analyze_walk_wild_section_handler): Initialize the tree field.
Diffstat (limited to 'ld/ldlang.c')
-rw-r--r-- | ld/ldlang.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/ld/ldlang.c b/ld/ldlang.c index 51dfe36..0ee1156 100644 --- a/ld/ldlang.c +++ b/ld/ldlang.c @@ -45,15 +45,6 @@ #define offsetof(TYPE, MEMBER) ((size_t) & (((TYPE*) 0)->MEMBER)) #endif -/* Binary search tree structure to - efficiently sort sections by name. */ -typedef struct lang_section_bst -{ - asection *section; - struct lang_section_bst *left; - struct lang_section_bst *right; -} lang_section_bst_type; - /* Locals variables. */ static struct obstack stat_obstack; static struct obstack map_obstack; @@ -377,7 +368,7 @@ wild_sort_fast (lang_wild_statement_type *wild, { lang_section_bst_type **tree; - tree = (lang_section_bst_type **) &wild->handler_data[1]; + tree = &wild->tree; if (!wild->filenames_sorted && (sec == NULL || sec->spec.sorted == none)) { @@ -674,6 +665,7 @@ analyze_walk_wild_section_handler (lang_wild_statement_type *ptr) ptr->handler_data[1] = NULL; ptr->handler_data[2] = NULL; ptr->handler_data[3] = NULL; + ptr->tree = NULL; /* Count how many wildcard_specs there are, and how many of those actually use wildcards in the name. Also, bail out if any of the @@ -2552,10 +2544,12 @@ wild (lang_wild_statement_type *s, walk_wild (s, output_section_callback_fast, output); - tree = (lang_section_bst_type *) s->handler_data[1]; + tree = s->tree; if (tree) - output_section_callback_tree_to_list (s, tree, output); - s->handler_data[1] = NULL; + { + output_section_callback_tree_to_list (s, tree, output); + s->tree = NULL; + } } else walk_wild (s, output_section_callback, output); |