+2010-08-23 Cary Coutant <ccoutant@google.com>
+
+ * archive.cc (Lib_group::add_symbols): Lock object before deleting its
+ symbols data.
+ (Lib_group::include_member): Unlock object after deleting its
+ symbols data.
+ * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
+ the bug fixed here.
+
2010-08-19 Neil Vachharajani <nvachhar@google.com>
Cary Coutant <ccoutant@google.com>
else
{
if (member.sd_ != NULL)
- delete member.sd_;
+ {
+ // The file must be locked in order to destroy the views
+ // associated with it.
+ gold_assert(obj != NULL);
+ obj->lock(this->task_);
+ delete member.sd_;
+ obj->unlock(this->task_);
+ }
}
this->members_[i] = this->members_.back();
layout->incremental_inputs()->report_object(obj, NULL);
obj->layout(symtab, layout, sd);
obj->add_symbols(symtab, sd, layout);
- // Unlock the file for the next task.
- obj->unlock(this->task_);
}
delete sd;
+ // Unlock the file for the next task.
+ obj->unlock(this->task_);
}
// Print statistical information to stderr. This is used for --stats.