Set Stringpool zero_null option via a call, not a default constructor
authorIan Lance Taylor <iant@google.com>
Fri, 21 Sep 2007 06:12:32 +0000 (06:12 +0000)
committerIan Lance Taylor <iant@google.com>
Fri, 21 Sep 2007 06:12:32 +0000 (06:12 +0000)
argument.

gold/merge.h
gold/stringpool.cc
gold/stringpool.h

index dd97bf2d39e227056ae016b9bb9dcc562d5ac1f9..591ac91e1bf37310f85bd43725e5df26e76e9a55 100644 (file)
@@ -169,8 +169,8 @@ class Output_merge_string : public Output_merge_base
 {
  public:
   Output_merge_string()
-    : Output_merge_base(sizeof(Char_type)), stringpool_(false), hashtable_()
-  { }
+    : Output_merge_base(sizeof(Char_type)), stringpool_(), hashtable_()
+  { this->stringpool_.set_no_zero_null(); }
 
   // Add an input section.
   bool
index 4a301fec3a0d7c240842e75b6437cb964b9e0574..c0a4ae72c99973006b417394a394a082593fba34 100644 (file)
@@ -13,9 +13,9 @@ namespace gold
 {
 
 template<typename Stringpool_char>
-Stringpool_template<Stringpool_char>::Stringpool_template(bool zero_null)
+Stringpool_template<Stringpool_char>::Stringpool_template()
   : string_set_(), strings_(), strtab_size_(0), next_index_(1),
-    zero_null_(zero_null)
+    zero_null_(true)
 {
 }
 
index cdd36e7b9ddaa9b30d58f7db0fc09726659cf926..11e97368bf921e355050ef37492dae67f7f01290 100644 (file)
@@ -58,14 +58,18 @@ class Stringpool_template
   // is never a valid key value.
   typedef size_t Key;
 
-  // Create a Stringpool.  ZERO_NULL is true if we should reserve
-  // offset 0 to hold the empty string when converting the stringpool
-  // to a string table.  ZERO_NULL should be true if you want a proper
-  // ELF SHT_STRTAB section.
-  Stringpool_template(bool zero_null = true);
+  // Create a Stringpool.
+  Stringpool_template();
 
   ~Stringpool_template();
 
+  // Indicate that we should not reserve offset 0 to hold the empty
+  // string when converting the stringpool to a string table.  This
+  // should not be called for a proper ELF SHT_STRTAB section.
+  void
+  set_no_zero_null()
+  { this->zero_null_ = false; }
+
   // Add the string S to the pool.  This returns a canonical permanent
   // pointer to the string in the pool.  If PKEY is not NULL, this
   // sets *PKEY to the key for the string.
This page took 0.027012 seconds and 4 git commands to generate.