Add a testcase for PR ld/12356.
[deliverable/binutils-gdb.git] / gold / mapfile.cc
index 3f1fe285cf48e40380d61f40948194aa0130534a..0cde51e21465a947a1eb6f43050c06c3b117989a 100644 (file)
@@ -105,8 +105,7 @@ Mapfile::advance_to_column(size_t from, size_t to)
 // Report about including a member from an archive.
 
 void
-Mapfile::report_include_archive_member(const Archive* archive,
-                                      const std::string& member_name,
+Mapfile::report_include_archive_member(const std::string& member_name,
                                       const Symbol* sym, const char* why)
 {
   // We print a header before the list of archive members, mainly for
@@ -118,13 +117,9 @@ Mapfile::report_include_archive_member(const Archive* archive,
       this->printed_archive_header_ = true;
     }
 
-  fprintf(this->map_file_, "%s(%s)", archive->file().filename().c_str(),
-         member_name.c_str());
+  fprintf(this->map_file_, "%s", member_name.c_str());
 
-  size_t len = (archive->file().filename().length()
-               + member_name.length()
-               + 2);
-  this->advance_to_column(len, 30);
+  this->advance_to_column(member_name.length(), 30);
 
   if (sym == NULL)
     fprintf(this->map_file_, "%s", why);
@@ -258,7 +253,7 @@ Mapfile::print_input_section(Relobj* relobj, unsigned int shndx)
     {
       os = relobj->output_section(shndx);
       addr = relobj->output_section_offset(shndx);
-      if (addr != -1U)
+      if (addr != -1ULL)
        addr += os->address();
     }
 
@@ -352,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.023812 seconds and 4 git commands to generate.