svn commit: r208960 - projects/ppc64/contrib/binutils/bfd

Nathan Whitehorn nwhitehorn at FreeBSD.org
Wed Jun 9 19:10:28 UTC 2010


Author: nwhitehorn
Date: Wed Jun  9 19:10:27 2010
New Revision: 208960
URL: http://svn.freebsd.org/changeset/base/208960

Log:
  Fix yet another bug in binutils 2.15 in which objcopy could segfault
  when making a PPC64 ELF file from something that was not an ELF file
  (e.g. binary input). This caused intermittent crashes while building
  uathload on PPC64.
  
  Reported by:	Yannick Bertin, Andreas Tobler

Modified:
  projects/ppc64/contrib/binutils/bfd/elf64-ppc.c

Modified: projects/ppc64/contrib/binutils/bfd/elf64-ppc.c
==============================================================================
--- projects/ppc64/contrib/binutils/bfd/elf64-ppc.c	Wed Jun  9 19:09:49 2010	(r208959)
+++ projects/ppc64/contrib/binutils/bfd/elf64-ppc.c	Wed Jun  9 19:10:27 2010	(r208960)
@@ -6033,6 +6033,10 @@ ppc64_elf_size_dynamic_sections (bfd *ou
 
   for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
     {
+      /* Skip this BFD if it is not ELF */
+      if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour)
+	continue;
+
       s = ppc64_elf_tdata (ibfd)->got;
       if (s != NULL && s != htab->got)
 	{
@@ -9000,6 +9004,10 @@ ppc64_elf_finish_dynamic_sections (bfd *
   while ((dynobj = dynobj->link_next) != NULL)
     {
       asection *s;
+
+      if (bfd_get_flavour (dynobj) != bfd_target_elf_flavour)
+	continue;
+
       s = ppc64_elf_tdata (dynobj)->got;
       if (s != NULL
 	  && s->_raw_size != 0


More information about the svn-src-projects mailing list