gold: Increment plt_offset after setting TLSDESC PLT entry

Message ID 20200501160211.139282-2-hjl.tools@gmail.com
State New
Headers show
Series
  • gold: Increment plt_offset after setting TLSDESC PLT entry
Related show

Commit Message

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/x86_64.cc | 2 ++
 1 file changed, 2 insertions(+)

-- 
2.26.2

Patch

diff --git a/gold/x86_64.cc b/gold/x86_64.cc
index b094e4bd3b..a0247b5707 100644
--- a/gold/x86_64.cc
+++ b/gold/x86_64.cc
@@ -2764,6 +2764,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.
@@ -2859,6 +2860,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.