This is the mail archive of the binutils@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]

PATCH: Make room for PLT0 directly


There is no need for "+=" in

if (s->size == 0)
  s->size += plt_entry_size;

if (s->size == 0)
  s->size = plt_entry_size;

works fine.  I checked it in.

H.J.
---
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index c0c9fa8..94b89a0 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2013-11-15  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* elf32-i386.c (elf_i386_allocate_dynrelocs): Make room for
+	PLT0 directly.
+	* elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
+
 2013-11-14  Nick Clifton  <nickc@redhat.com>
 
 	PR ld/16017
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index a623a13..4574c59 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -2219,7 +2219,7 @@ elf_i386_allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
 	  /* If this is the first .plt entry, make room for the special
 	     first entry.  */
 	  if (s->size == 0)
-	    s->size += plt_entry_size;
+	    s->size = plt_entry_size;
 
 	  h->plt.offset = s->size;
 
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index 058e97a..8eac635 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -2335,7 +2335,7 @@ elf_x86_64_allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
 	  /* If this is the first .plt entry, make room for the special
 	     first entry.  */
 	  if (s->size == 0)
-	    s->size += plt_entry_size;
+	    s->size = plt_entry_size;
 
 	  h->plt.offset = s->size;
 


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