public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* PATCH: PR ld/17713: 64-bit linker fails("Segment Fault") call libbfd
@ 2014-12-15 16:36 H.J. Lu
  0 siblings, 0 replies; only message in thread
From: H.J. Lu @ 2014-12-15 16:36 UTC (permalink / raw)
  To: binutils

Hi,

I am checking this patch into master and 2.25 branch to check corrupt
input.

H.J.
---
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 23e4ba5..561c603 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2014-12-15  H.J. Lu  <hongjiu.lu@intel.com>
+
+	PR ld/17713
+	* elflink.c (_bfd_elf_gc_mark_rsec): Check corrupt input.
+
 2014-12-13  H.J. Lu  <hongjiu.lu@intel.com>
 
 	PR ld/17689
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 2da6d1b..b701fa0 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -11860,6 +11860,12 @@ _bfd_elf_gc_mark_rsec (struct bfd_link_info *info, asection *sec,
       || ELF_ST_BIND (cookie->locsyms[r_symndx].st_info) != STB_LOCAL)
     {
       h = cookie->sym_hashes[r_symndx - cookie->extsymoff];
+      if (h == NULL)
+	{
+	  info->callbacks->einfo (_("%F%P: corrupt input: %B\n"),
+				  sec->owner);
+	  return NULL;
+	}
       while (h->root.type == bfd_link_hash_indirect
 	     || h->root.type == bfd_link_hash_warning)
 	h = (struct elf_link_hash_entry *) h->root.u.i.link;

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

only message in thread, other threads:[~2014-12-15 16:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-15 16:36 PATCH: PR ld/17713: 64-bit linker fails("Segment Fault") call libbfd 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).