gdb: add target_ops::supports_displaced_step
[deliverable/binutils-gdb.git] / gold / stringpool.cc
index d6fd7157bf0fbd53b21111dc7006a7343af2a26d..8918f6f054fd1108faceedf6f8b709051995043a 100644 (file)
@@ -1,6 +1,6 @@
 // stringpool.cc -- a string pool for gold
 
-// Copyright (C) 2006-2015 Free Software Foundation, Inc.
+// Copyright (C) 2006-2020 Free Software Foundation, Inc.
 // Written by Ian Lance Taylor <iant@google.com>.
 
 // This file is part of gold.
@@ -228,9 +228,8 @@ Stringpool_template<Stringpool_char>::new_key_offset(size_t length)
   else
     {
       offset = this->offset_;
-      // Align non-zero length strings.
-      if (length != 0)
-       offset = align_address(offset, this->addralign_);
+      // Align strings.
+      offset = align_address(offset, this->addralign_);
       this->offset_ = offset + (length + 1) * sizeof(Stringpool_char);
     }
   this->key_to_offset_.push_back(offset);
@@ -421,6 +420,8 @@ Stringpool_template<Stringpool_char>::set_string_offsets()
           if (this->zero_null_ && (*curr)->first.string[0] == 0)
             this_offset = 0;
           else if (last != v.end()
+                   && ((((*curr)->first.length - (*last)->first.length)
+                       % this->addralign_) == 0)
                    && is_suffix((*curr)->first.string,
                                (*curr)->first.length,
                                 (*last)->first.string,
This page took 0.022901 seconds and 4 git commands to generate.