Add cast to avoid signed/unsigned warning.
[deliverable/binutils-gdb.git] / gold / reloc.h
index 5d2a160e41c1d2410b6fd0815837d95d8a9ab240..39ffe4ac229eef971dc8c780d4becd899cc11147 100644 (file)
 #ifndef GOLD_RELOC_H
 #define GOLD_RELOC_H
 
+#include <vector>
 #include <byteswap.h>
 
+#include "elfcpp.h"
 #include "workqueue.h"
 
 namespace gold
 {
 
 class General_options;
+class Object;
 class Relobj;
 class Read_relocs_data;
 class Symbol;
 class Layout;
+class Output_section;
 
 template<int size>
 class Sized_symbol;
@@ -66,15 +70,18 @@ class Read_relocs : public Task
 
   // The standard Task methods.
 
-  Is_runnable_type
-  is_runnable(Workqueue*);
+  Task_token*
+  is_runnable();
 
-  Task_locker*
-  locks(Workqueue*);
+  void
+  locks(Task_locker*);
 
   void
   run(Workqueue*);
 
+  std::string
+  get_name() const;
+
  private:
   const General_options& options_;
   Symbol_table* symtab_;
@@ -101,18 +108,19 @@ class Scan_relocs : public Task
 
   // The standard Task methods.
 
-  Is_runnable_type
-  is_runnable(Workqueue*);
+  Task_token*
+  is_runnable();
 
-  Task_locker*
-  locks(Workqueue*);
+  void
+  locks(Task_locker*);
 
   void
   run(Workqueue*);
 
- private:
-  class Scan_relocs_locker;
+  std::string
+  get_name() const;
 
+ private:
   const General_options& options_;
   Symbol_table* symtab_;
   Layout* layout_;
@@ -139,18 +147,19 @@ class Relocate_task : public Task
 
   // The standard Task methods.
 
-  Is_runnable_type
-  is_runnable(Workqueue*);
+  Task_token*
+  is_runnable();
 
-  Task_locker*
-  locks(Workqueue*);
+  void
+  locks(Task_locker*);
 
   void
   run(Workqueue*);
 
- private:
-  class Relocate_locker;
+  std::string
+  get_name() const;
 
+ private:
   const General_options& options_;
   const Symbol_table* symtab_;
   const Layout* layout_;
@@ -537,12 +546,12 @@ class Copy_relocs
   // index of the section to which the reloc is being applied.
   void
   save(Symbol* sym, Relobj*, unsigned int shndx,
-       const elfcpp::Rel<size, big_endian>&);
+       Output_section* output_section, const elfcpp::Rel<size, big_endian>&);
 
   // Save a Rela against SYM for possible emission later.
   void
   save(Symbol* sym, Relobj*, unsigned int shndx,
-       const elfcpp::Rela<size, big_endian>&);
+       Output_section* output_section, const elfcpp::Rela<size, big_endian>&);
 
   // Return whether there are any relocs to emit.  This also discards
   // entries which need not be emitted.
@@ -565,9 +574,11 @@ class Copy_relocs
    public:
     Copy_reloc_entry(Symbol* sym, unsigned int reloc_type,
                     Relobj* relobj, unsigned int shndx,
+                    Output_section* output_section,
                     Address address, Addend addend)
       : sym_(sym), reloc_type_(reloc_type), relobj_(relobj),
-       shndx_(shndx), address_(address), addend_(addend)
+       shndx_(shndx), output_section_(output_section),
+       address_(address), addend_(addend)
     { }
 
     // Return whether we should emit this reloc.  If we should not
@@ -588,6 +599,7 @@ class Copy_relocs
     unsigned int reloc_type_;
     Relobj* relobj_;
     unsigned int shndx_;
+    Output_section* output_section_;
     Address address_;
     Addend addend_;
   };
@@ -608,7 +620,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
@@ -617,7 +629,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
@@ -636,14 +648,12 @@ 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_;
+  section_size_type len_;
   // Our current position in the reloc section.
-  off_t pos_;
+  section_size_type pos_;
   // The size of the relocs in the section.
   int reloc_size_;
 };
This page took 0.025484 seconds and 4 git commands to generate.