public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* PATCH: Properly check local symbol on error
@ 2009-06-20  2:46 H.J. Lu
  0 siblings, 0 replies; only message in thread
From: H.J. Lu @ 2009-06-20  2:46 UTC (permalink / raw)
  To: binutils

We should check h not h->root.root.string for non-IFUNC local symbol. I
checked in this patch to fix it.


H.J.
---
2009-06-19  H.J. Lu  <hongjiu.lu@intel.com>

	* elf32-i386.c (elf_i386_check_relocs): Properly check local
	symbol on error.
	* elf64-x86-64.c (elf64_x86_64_check_relocs): Likewise.

Index: elf64-x86-64.c
===================================================================
--- elf64-x86-64.c	(revision 6206)
+++ elf64-x86-64.c	(working copy)
@@ -1232,7 +1232,7 @@ elf64_x86_64_check_relocs (bfd *abfd, st
 	case R_X86_64_TPOFF32:
 	  if (info->shared)
 	    {
-	      if (h->root.root.string)
+	      if (h)
 		name = h->root.root.string;
 	      else
 		name = bfd_elf_sym_name (abfd, symtab_hdr, isym,
@@ -1327,7 +1327,7 @@ elf64_x86_64_check_relocs (bfd *abfd, st
 		  tls_type |= old_tls_type;
 		else
 		  {
-		    if (h->root.root.string)
+		    if (h)
 		      name = h->root.root.string;
 		    else
 		      name = bfd_elf_sym_name (abfd, symtab_hdr,
@@ -1402,7 +1402,7 @@ elf64_x86_64_check_relocs (bfd *abfd, st
 	      && (sec->flags & SEC_ALLOC) != 0
 	      && (sec->flags & SEC_READONLY) != 0)
 	    {
-	      if (h->root.root.string)
+	      if (h)
 		name = h->root.root.string;
 	      else
 		name = bfd_elf_sym_name (abfd, symtab_hdr, isym, NULL);
Index: elf32-i386.c
===================================================================
--- elf32-i386.c	(revision 6206)
+++ elf32-i386.c	(working copy)
@@ -1538,7 +1538,7 @@ elf_i386_check_relocs (bfd *abfd,
 		  tls_type |= old_tls_type;
 		else
 		  {
-		    if (h->root.root.string)
+		    if (h)
 		      name = h->root.root.string;
 		    else
 		      name = bfd_elf_sym_name (abfd, symtab_hdr, isym,

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-06-20  0:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-20  2:46 PATCH: Properly check local symbol on error H.J. Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).