From Craig Silverstein: Track_relocs doesn't need to hold onto the
authorIan Lance Taylor <iant@google.com>
Mon, 12 Nov 2007 20:35:21 +0000 (20:35 +0000)
committerIan Lance Taylor <iant@google.com>
Mon, 12 Nov 2007 20:35:21 +0000 (20:35 +0000)
object.

gold/reloc.cc
gold/reloc.h

index e72c134e1d5840fbe2697c3c90bbb509d0ff3f26..7a95deea59a0f50a8646dcdca697acda6f560273 100644 (file)
@@ -672,12 +672,10 @@ Copy_relocs<size, big_endian>::emit(
 template<int size, bool big_endian>
 bool
 Track_relocs<size, big_endian>::initialize(
-    Sized_relobj<size, big_endian>* object,
+    Object* object,
     unsigned int reloc_shndx,
     unsigned int reloc_type)
 {
-  this->object_ = object;
-
   // If RELOC_SHNDX is -1U, it means there is more than one reloc
   // section for the .eh_frame section.  We can't handle that case.
   if (reloc_shndx == -1U)
index 91b08199b9874fb7f08b43eb914e1d8d80209cfb..51b6143b8d4667821dd2ce8c0bbe087553a83520 100644 (file)
@@ -32,6 +32,7 @@ namespace gold
 {
 
 class General_options;
+class Object;
 class Relobj;
 class Read_relocs_data;
 class Symbol;
@@ -609,7 +610,7 @@ class Track_relocs
 {
  public:
   Track_relocs()
-    : object_(NULL), prelocs_(NULL), len_(0), pos_(0), reloc_size_(0)
+    : prelocs_(NULL), len_(0), pos_(0), reloc_size_(0)
   { }
 
   // Initialize the Track_relocs object.  OBJECT is the object holding
@@ -618,7 +619,7 @@ class Track_relocs
   // (elfcpp::SHT_REL or elfcpp::SHT_RELA).  This returns false if
   // something went wrong.
   bool
-  initialize(Sized_relobj<size, big_endian>* object, unsigned int reloc_shndx,
+  initialize(Object* object, unsigned int reloc_shndx,
             unsigned int reloc_type);
 
   // Return the offset in the data section to which the next reloc
@@ -637,9 +638,7 @@ class Track_relocs
   advance(off_t offset);
 
  private:
-  // The object file.
-  Sized_relobj<size, big_endian>* object_;
-  // The contents of the reloc section.
+  // The contents of the input object's reloc section.
   const unsigned char* prelocs_;
   // The length of the reloc section.
   off_t len_;
This page took 0.029406 seconds and 4 git commands to generate.