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] Revert commit aab921adcb656e4eefcc7d0f14241f3d7504400e


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

commit 34bb2571d40e1ca323a1b60e0827a25047890faa
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Thu Aug 24 03:33:42 2017 -0700

    Revert commit aab921adcb656e4eefcc7d0f14241f3d7504400e
    
    	* elf32-i386.c (elf_i386_check_relocs): Revert the last change.
    	Undefined symbols may not have a type.
    	* elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.

Diff:
---
 bfd/ChangeLog      | 6 ++++++
 bfd/elf32-i386.c   | 5 ++---
 bfd/elf64-x86-64.c | 5 ++---
 3 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 9cb390c..a45b896 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2017-08-24  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* elf32-i386.c (elf_i386_check_relocs): Revert the last change.
+	Undefined symbols may not have a type.
+	* elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
+
 2017-08-23  H.J. Lu  <hongjiu.lu@intel.com>
 
 	* elf64-x86-64.c (elf_x86_64_need_pic): Add an argument for
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index ae23752..1009c17 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -2273,9 +2273,8 @@ do_relocation:
 	      /* We may need a .plt entry if the symbol is a function
 		 defined in a shared lib or is a STT_GNU_IFUNC function
 		 referenced from the code or read-only section.  */
-	      if ((h->type == STT_FUNC || h->type == STT_GNU_IFUNC)
-		  && (!h->def_regular
-		      || (sec->flags & (SEC_CODE | SEC_READONLY)) != 0))
+	      if (!h->def_regular
+		  || (sec->flags & (SEC_CODE | SEC_READONLY)) != 0)
 		h->plt.refcount += 1;
 
 	      if (r_type == R_386_PC32)
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index 775c911..84d63f4 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -2726,9 +2726,8 @@ pointer:
 	      /* We may need a .plt entry if the symbol is a function
 		 defined in a shared lib or is a STT_GNU_IFUNC function
 		 referenced from the code or read-only section.  */
-	      if ((h->type == STT_FUNC || h->type == STT_GNU_IFUNC)
-		  && (!h->def_regular
-		      || (sec->flags & (SEC_CODE | SEC_READONLY)) != 0))
+	      if (!h->def_regular
+		  || (sec->flags & (SEC_CODE | SEC_READONLY)) != 0)
 		h->plt.refcount += 1;
 
 	      if (r_type == R_X86_64_PC32)


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