2006-08-08 H.J. Lu <hongjiu.lu@intel.com>
authorH.J. Lu <hjl.tools@gmail.com>
Tue, 8 Aug 2006 16:08:47 +0000 (16:08 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Tue, 8 Aug 2006 16:08:47 +0000 (16:08 +0000)
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.

ld/ChangeLog
ld/ldlang.c
ld/ldlang.h

index 39d7d1fcbc8aed0029da364eda0f6adaa9f523fe..4435a256b4d5a3a40f271a1251f1f8c88ad11d9d 100644 (file)
@@ -1,3 +1,15 @@
+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.
+
 2006-08-08  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR ld/3009
index 51dfe3670f20e1c214065581e77af39a8cb006c1..0ee11569700f03d613934d566796343f0004b28e 100644 (file)
 #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);
index 91a4344fb8eafef3d3167cf803ff0172126da568..c23c3e5ed5d861153989123323494cfcba5bcc00 100644 (file)
@@ -305,6 +305,15 @@ typedef void (*walk_wild_section_handler_t) (lang_wild_statement_type *,
 typedef bfd_boolean (*lang_match_sec_type_func) (bfd *, const asection *,
                                                 bfd *, const asection *);
 
+/* 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;
+
 struct lang_wild_statement_struct
 {
   lang_statement_header_type header;
@@ -316,6 +325,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;
 };
 
 typedef struct lang_address_statement_struct
This page took 0.037284 seconds and 4 git commands to generate.