This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] i386: Update sgotplt_jump_table_size setting


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=92c10f5f61e8342eda76fb6927dcc1c885eda96a

commit 92c10f5f61e8342eda76fb6927dcc1c885eda96a
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sat Sep 2 11:18:30 2017 -0700

    i386: Update sgotplt_jump_table_size setting
    
    elf_i386_size_dynamic_sections has
    
          htab->next_tls_desc_index = htab->elf.srelplt->reloc_count;
          htab->sgotplt_jump_table_size = htab->next_tls_desc_index * 4;
    
    This patch changes it to
    
          htab->sgotplt_jump_table_size
    	= elf_x86_compute_jump_table_size (htab)
    
    Since elf_x86_compute_jump_table_size is defined as
    
      ((htab)->elf.srelplt->reloc_count * (htab)->got_entry_size)
    
    there is no change in output.  It makes elf_i386_size_dynamic_sections
    the same as elf_x86_64_size_dynamic_sections.
    
    	* elf32-i386.c (elf_i386_size_dynamic_sections): Set
    	sgotplt_jump_table_size with elf_x86_compute_jump_table_size.

Diff:
---
 bfd/ChangeLog    | 5 +++++
 bfd/elf32-i386.c | 3 ++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 23cb882..1058a8b 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,10 @@
 2017-09-02  H.J. Lu  <hongjiu.lu@intel.com>
 
+	* elf32-i386.c (elf_i386_size_dynamic_sections): Set
+	sgotplt_jump_table_size with elf_x86_compute_jump_table_size.
+
+2017-09-02  H.J. Lu  <hongjiu.lu@intel.com>
+
 	* elf32-i386.c (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
 	PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Moved to ...
 	* elfxx-x86.h (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index 034511c..a123bbd 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -2238,7 +2238,8 @@ elf_i386_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info)
   if (htab->elf.srelplt)
     {
       htab->next_tls_desc_index = htab->elf.srelplt->reloc_count;
-      htab->sgotplt_jump_table_size = htab->next_tls_desc_index * 4;
+      htab->sgotplt_jump_table_size
+	= elf_x86_compute_jump_table_size (htab);
       htab->next_irelative_index = htab->elf.srelplt->reloc_count - 1;
     }
   else if (htab->elf.irelplt)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]