gold: Increment plt_offset after setting TLSDESC PLT entry
authorH.J. Lu <hjl.tools@gmail.com>
Fri, 1 May 2020 16:00:14 +0000 (09:00 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Fri, 1 May 2020 16:00:27 +0000 (09:00 -0700)
Increment plt_offset after setting the reserved TLSDESC PLT entry.

PR gold/25872
* x86_64.cc (Output_data_plt_x86_64_bnd::do_write): Increment
plt_offset after setting the reserved TLSDESC PLT entry.
(Output_data_plt_x86_64_ibt<size>::do_write): Likewise.

gold/ChangeLog
gold/x86_64.cc

index cc62a3e827573c6d048f96aadd67ea4b20e77cae..c1cee528a2e5328342468db7613050c081ee39e2 100644 (file)
@@ -1,3 +1,10 @@
+2020-05-01  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR gold/25872
+       * x86_64.cc (Output_data_plt_x86_64_bnd::do_write): Increment
+       plt_offset after setting the reserved TLSDESC PLT entry.
+       (Output_data_plt_x86_64_ibt<size>::do_write): Likewise.
+
 2020-05-01  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR gold/25872
index 6219c8e306fffc4d7ccec2e85872d3264db552fa..114ebb081fd76275e0a11d5a9fe1bd31a9571a77 100644 (file)
@@ -2736,6 +2736,7 @@ Output_data_plt_x86_64_bnd::do_write(Output_file* of)
       this->fill_tlsdesc_entry(pov, got_address, plt_address, got_base,
                               tlsdesc_got_offset, plt_offset);
       pov += this->get_plt_entry_size();
+      plt_offset += plt_entry_size;
     }
 
   // Write the additional PLT.
@@ -2831,6 +2832,7 @@ Output_data_plt_x86_64_ibt<size>::do_write(Output_file* of)
       this->fill_tlsdesc_entry(pov, got_address, plt_address, got_base,
                               tlsdesc_got_offset, plt_offset);
       pov += this->get_plt_entry_size();
+      plt_offset += plt_entry_size;
     }
 
   // Write the additional PLT.