[PATCH] Make --start-lib/--end-lib block on previous add symbols tasks

Neil Vachharajani nvachhar@google.com
Thu Aug 19 22:54:00 GMT 2010


On Thu, Aug 19, 2010 at 3:19 PM, Ian Lance Taylor <iant@google.com> wrote:
> Neil Vachharajani <nvachhar@google.com> writes:
>
>> That was the way I originally implemented it :)  But talking to Cary
>> we couldn't find a precedent of having two blockers for one task.
>
> I certainly hope that it works.

It works just fine.  Here's the new patch and ChangeLog

ChangeLog

        gold/
        * gold/archive.h (Add_lib_group_symbols): Add
readsyms_blocker_, adjust constructor, and set_blocker.
        * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also
check readsyms_blocker_.
        * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
this->this_blocker_ to Add_lib_group_symbols::set_blocker.

>
> Ian
>



-- 
Neil Vachharajani
Google
650-214-1804
-------------- next part --------------
Index: gold/archive.cc
===================================================================
RCS file: /cvs/src/src/gold/archive.cc,v
retrieving revision 1.56
diff -u -r1.56 archive.cc
--- gold/archive.cc	12 Aug 2010 22:01:11 -0000	1.56
+++ gold/archive.cc	19 Aug 2010 22:23:23 -0000
@@ -1118,6 +1118,8 @@
 Task_token*
 Add_lib_group_symbols::is_runnable()
 {
+  if (this->readsyms_blocker_ != NULL && this->readsyms_blocker_->is_blocked())
+    return this->readsyms_blocker_;
   if (this->this_blocker_ != NULL && this->this_blocker_->is_blocked())
     return this->this_blocker_;
   return NULL;
Index: gold/archive.h
===================================================================
RCS file: /cvs/src/src/gold/archive.h,v
retrieving revision 1.29
diff -u -r1.29 archive.h
--- gold/archive.h	12 Aug 2010 22:01:11 -0000	1.29
+++ gold/archive.h	19 Aug 2010 22:23:23 -0000
@@ -495,7 +495,8 @@
                         Input_objects* input_objects,
                         Lib_group* lib, Task_token* next_blocker)
       : symtab_(symtab), layout_(layout), input_objects_(input_objects),
-        lib_(lib), this_blocker_(NULL), next_blocker_(next_blocker)
+        lib_(lib), readsyms_blocker_(NULL), this_blocker_(NULL),
+        next_blocker_(next_blocker)
   { }
 
   ~Add_lib_group_symbols();
@@ -513,9 +514,10 @@
 
   // Set the blocker to use for this task.
   void
-  set_blocker(Task_token* this_blocker)
+  set_blocker(Task_token* readsyms_blocker, Task_token* this_blocker)
   {
-    gold_assert(this->this_blocker_ == NULL);
+    gold_assert(this->readsyms_blocker_ == NULL && this->this_blocker_ == NULL);
+    this->readsyms_blocker_ = readsyms_blocker;
     this->this_blocker_ = this_blocker;
   }
 
@@ -530,6 +532,7 @@
   Layout* layout_;
   Input_objects* input_objects_;
   Lib_group * lib_;
+  Task_token* readsyms_blocker_;
   Task_token* this_blocker_;
   Task_token* next_blocker_;
 };
Index: gold/readsyms.cc
===================================================================
RCS file: /cvs/src/src/gold/readsyms.cc,v
retrieving revision 1.44
diff -u -r1.44 readsyms.cc
--- gold/readsyms.cc	12 Aug 2010 22:01:11 -0000	1.44
+++ gold/readsyms.cc	19 Aug 2010 22:23:23 -0000
@@ -248,7 +248,7 @@
 					     m, NULL, next_blocker));
     }
 
-  add_lib_group_symbols->set_blocker(next_blocker);
+  add_lib_group_symbols->set_blocker(next_blocker, this->this_blocker_);
   workqueue->queue_soon(add_lib_group_symbols);
 
   return true;


More information about the Binutils mailing list