PR binutils/12523
[deliverable/binutils-gdb.git] / gold / mapfile.cc
index a9b4e728ebb4673c207ec2938253ae4ffb5027b9..0cde51e21465a947a1eb6f43050c06c3b117989a 100644 (file)
@@ -217,7 +217,7 @@ Mapfile::print_input_section_symbols(
          && is_ordinary
          && sym->is_defined())
        {
-         for (size_t j = 0; j < Mapfile::section_name_map_length; ++j)
+         for (size_t i = 0; i < Mapfile::section_name_map_length; ++i)
            putc(' ', this->map_file_);
          const Sized_symbol<size>* ssym =
            static_cast<const Sized_symbol<size>*>(sym);
@@ -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)
        {
This page took 0.024645 seconds and 4 git commands to generate.