2012-09-10 Sterling Augustine <saugustine@google.com>
authorSterling Augustine <saugustine@google.com>
Mon, 10 Sep 2012 19:16:33 +0000 (19:16 +0000)
committerSterling Augustine <saugustine@google.com>
Mon, 10 Sep 2012 19:16:33 +0000 (19:16 +0000)
* gdb-index.cc (Gdb_index::pubnames_read): New parameter.
(Gdb_index::pubtypes_read): New parameter.
(Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
to calls.
* gdb-index.h (Gdb_index): New fields pubnames_object_ and
pubtypes_object_.

gold/ChangeLog
gold/gdb-index.cc
gold/gdb-index.h

index 7c16d7b82c0d58ca78cf88c975f7c151d34bda0e..e481713d3d94fdb61cbf6ef8d91c889d025d4180 100644 (file)
@@ -1,3 +1,12 @@
+2012-09-10  Sterling Augustine  <saugustine@google.com>
+
+       * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
+       (Gdb_index::pubtypes_read): New parameter.
+       (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
+       to calls.
+       * gdb-index.h (Gdb_index): New fields pubnames_object_ and
+       pubtypes_object_.
+
 2012-09-09  Alan Modra  <amodra@gmail.com>
 
        * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
index 66669888487d1900b7a5be1a648fc1ef892392d4..51d0816f1b1c48c21c7242ad91ba31ed0287dd06 100644 (file)
@@ -864,7 +864,8 @@ Gdb_index_info_reader::read_pubnames_and_pubtypes(Dwarf_die* die)
                                             &pubnames_shndx);
   if (pubnames_offset != -1)
     {
-      if (this->gdb_index_->pubnames_read(pubnames_shndx, pubnames_offset))
+      if (this->gdb_index_->pubnames_read(this->object(), pubnames_shndx,
+                                          pubnames_offset))
        ret = true;
       else
        {
@@ -890,7 +891,8 @@ Gdb_index_info_reader::read_pubnames_and_pubtypes(Dwarf_die* die)
                                             &pubtypes_shndx);
   if (pubtypes_offset != -1)
     {
-      if (this->gdb_index_->pubtypes_read(pubtypes_shndx, pubtypes_offset))
+      if (this->gdb_index_->pubtypes_read(this->object(),
+                                          pubtypes_shndx, pubtypes_offset))
        ret = true;
       else
        {
@@ -961,8 +963,10 @@ Gdb_index::Gdb_index(Output_section* gdb_index_section)
     symtab_offset_(0),
     cu_pool_offset_(0),
     stringpool_offset_(0),
+    pubnames_object_(NULL),
     pubnames_shndx_(0),
     pubnames_offset_(0),
+    pubtypes_object_(NULL),
     pubtypes_shndx_(0),
     pubtypes_offset_(0)
 {
@@ -1034,10 +1038,12 @@ Gdb_index::add_symbol(int cu_index, const char* sym_name)
 // OFFSET in section SHNDX
 
 bool
-Gdb_index::pubnames_read(unsigned int shndx, off_t offset)
+Gdb_index::pubnames_read(const Relobj* object, unsigned int shndx, off_t offset)
 {
-  bool ret = (this->pubnames_shndx_ == shndx
+  bool ret = (this->pubnames_object_ == object
+              && this->pubnames_shndx_ == shndx
              && this->pubnames_offset_ == offset);
+  this->pubnames_object_ = object;
   this->pubnames_shndx_ = shndx;
   this->pubnames_offset_ = offset;
   return ret;
@@ -1047,10 +1053,12 @@ Gdb_index::pubnames_read(unsigned int shndx, off_t offset)
 // OFFSET in section SHNDX
 
 bool
-Gdb_index::pubtypes_read(unsigned int shndx, off_t offset)
+Gdb_index::pubtypes_read(const Relobj* object, unsigned int shndx, off_t offset)
 {
-  bool ret = (this->pubtypes_shndx_ == shndx
+  bool ret = (this->pubtypes_object_ == object
+              && this->pubtypes_shndx_ == shndx
              && this->pubtypes_offset_ == offset);
+  this->pubtypes_object_ = object;
   this->pubtypes_shndx_ = shndx;
   this->pubtypes_offset_ = offset;
   return ret;
index 1ca38cc9288a77d46e35e4eb0636ce202865b0af..14c1583371ac9abce62aad0ec4de2c3d12556d6b 100644 (file)
@@ -91,15 +91,15 @@ class Gdb_index : public Output_section_data
   void
   add_symbol(int cu_index, const char* sym_name);
 
-  // Return TRUE if we have already processed the pubnames set at
-  // OFFSET in section SHNDX
+  // Return TRUE if we have already processed the pubnames set for
+  // OBJECT at OFFSET in section SHNDX
   bool
-  pubnames_read(unsigned int shndx, off_t offset);
+  pubnames_read(const Relobj* object, unsigned int shndx, off_t offset);
 
-  // Return TRUE if we have already processed the pubtypes set at
-  // OFFSET in section SHNDX
+  // Return TRUE if we have already processed the pubtypes set for
+  // OBJECT at OFFSET in section SHNDX
   bool
-  pubtypes_read(unsigned int shndx, off_t offset);
+  pubtypes_read(const Relobj* object,  unsigned int shndx, off_t offset);
 
   // Print usage statistics.
   static void
@@ -200,10 +200,12 @@ class Gdb_index : public Output_section_data
   off_t symtab_offset_;
   off_t cu_pool_offset_;
   off_t stringpool_offset_;
-  // Section index and offset of last read pubnames section.
+  // Object, section index and offset of last read pubnames section.
+  const Relobj* pubnames_object_;
   unsigned int pubnames_shndx_;
   off_t pubnames_offset_;
-  // Section index and offset of last read pubtypes section.
+  // Object, section index and offset of last read pubtypes section.
+  const Relobj* pubtypes_object_;
   unsigned int pubtypes_shndx_;
   off_t pubtypes_offset_;
 };