aboutsummaryrefslogtreecommitdiff
path: root/gold/mapfile.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gold/mapfile.cc')
-rw-r--r--gold/mapfile.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/gold/mapfile.cc b/gold/mapfile.cc
index a3ba52b..0cde51e 100644
--- a/gold/mapfile.cc
+++ b/gold/mapfile.cc
@@ -347,6 +347,12 @@ Mapfile::print_discarded_sections(const Input_objects* input_objects)
++p)
{
Relobj* relobj = *p;
+ // Lock the object so we can read from it. This is only called
+ // single-threaded from Layout_task_runner, so it is OK to lock.
+ // Unfortunately we have no way to pass in a Task token.
+ const Task* dummy_task = reinterpret_cast<const Task*>(-1);
+ Task_lock_obj<Object> tl(dummy_task, relobj);
+
unsigned int shnum = relobj->shnum();
for (unsigned int i = 0; i < shnum; ++i)
{