Add cast to avoid signed/unsigned warning.
[deliverable/binutils-gdb.git] / gold / symtab.h
index 9c7fb0935c747bb921a68a25eb0dcfd8bfd65036..59cda2e9d060fc34852f30030fc014aa64efd494 100644 (file)
@@ -541,19 +541,6 @@ class Symbol
   set_is_copied_from_dynobj()
   { this->is_copied_from_dynobj_ = true; }
 
-  // Mark this symbol as needing its value written to the GOT even when
-  // the value is subject to dynamic relocation (e.g., when the target
-  // uses a RELATIVE relocation for the GOT entry).
-  void
-  set_needs_value_in_got()
-  { this->needs_value_in_got_ = true; }
-
-  // Return whether this symbol needs its value written to the GOT even
-  // when the value is subject to dynamic relocation.
-  bool
-  needs_value_in_got() const
-  { return this->needs_value_in_got_; }
-
  protected:
   // Instances of this class should always be created at a specific
   // size.
@@ -730,9 +717,6 @@ class Symbol
   // True if we are using a COPY reloc for this symbol, so that the
   // real definition lives in a dynamic object.
   bool is_copied_from_dynobj_ : 1;
-  // True if the static value should be written to the GOT even
-  // when the final value is subject to dynamic relocation.
-  bool needs_value_in_got_ : 1;
 };
 
 // The parts of a symbol which are size specific.  Using a template
@@ -913,10 +897,11 @@ class Warnings
     : warnings_()
   { }
 
-  // Add a warning for symbol NAME in section SHNDX in object OBJ.
+  // Add a warning for symbol NAME in object OBJ.  WARNING is the text
+  // of the warning.
   void
   add_warning(Symbol_table* symtab, const char* name, Object* obj,
-             unsigned int shndx);
+             const std::string& warning);
 
   // For each symbol for which we should give a warning, make a note
   // on the symbol.
@@ -938,25 +923,19 @@ class Warnings
   {
     // The object the warning is in.
     Object* object;
-    // The index of the warning section.
-    unsigned int shndx;
-    // The warning text if we have already loaded it.
+    // The warning text.
     std::string text;
 
     Warning_location()
-      : object(NULL), shndx(0), text()
+      : object(NULL), text()
     { }
 
     void
-    set(Object* o, unsigned int s)
+    set(Object* o, const std::string& t)
     {
       this->object = o;
-      this->shndx = s;
+      this->text = t;
     }
-
-    void
-    set_text(const char* t, off_t l)
-    { this->text.assign(t, l); }
   };
 
   // A mapping from warning symbol names (canonicalized in
@@ -971,7 +950,10 @@ class Warnings
 class Symbol_table
 {
  public:
-  Symbol_table();
+  // COUNT is an estimate of how many symbosl will be inserted in the
+  // symbol table.  It's ok to put 0 if you don't know; a correct
+  // guess will just save some CPU by reducing hashtable resizes.
+  Symbol_table(unsigned int count);
 
   ~Symbol_table();
 
@@ -1041,7 +1023,8 @@ class Symbol_table
   template<int size>
   void
   define_with_copy_reloc(const Target*, Sized_symbol<size>* sym,
-                        Output_data* posd, uint64_t value);
+                        Output_data* posd,
+                        typename elfcpp::Elf_types<size>::Elf_Addr);
 
   // Look up a symbol.
   Symbol*
@@ -1069,10 +1052,11 @@ class Symbol_table
   void
   allocate_commons(const General_options&, Layout*);
 
-  // Add a warning for symbol NAME in section SHNDX in object OBJ.
+  // Add a warning for symbol NAME in object OBJ.  WARNING is the text
+  // of the warning.
   void
-  add_warning(const char* name, Object* obj, unsigned int shndx)
-  { this->warnings_.add_warning(this, name, obj, shndx); }
+  add_warning(const char* name, Object* obj, const std::string& warning)
+  { this->warnings_.add_warning(this, name, obj, warning); }
 
   // Canonicalize a symbol name for use in the hash table.
   const char*
@@ -1091,7 +1075,7 @@ class Symbol_table
   // Check candidate_odr_violations_ to find symbols with the same name
   // but apparently different definitions (different source-file/line-no).
   void
-  detect_odr_violations(const char* output_file_name) const;
+  detect_odr_violations(const Task*, const char* output_file_name) const;
 
   // SYM is defined using a COPY reloc.  Return the dynamic object
   // where the original definition was found.
@@ -1127,6 +1111,10 @@ class Symbol_table
   void
   write_section_symbol(const Output_section*, Output_file*, off_t) const;
 
+  // Dump statistical information to stderr.
+  void
+  print_stats() const;
+
  private:
   Symbol_table(const Symbol_table&);
   Symbol_table& operator=(const Symbol_table&);
This page took 0.024838 seconds and 4 git commands to generate.