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]

elf-attrs segfault


Applying mainline and branch.

	PR binutils/14873
	* elf-attrs.c (_bfd_elf_copy_obj_attributes): Don't attempt to
	copy attributes from or to non-ELF.

Index: bfd/elf-attrs.c
===================================================================
RCS file: /cvs/src/src/bfd/elf-attrs.c,v
retrieving revision 1.15
diff -u -p -r1.15 elf-attrs.c
--- bfd/elf-attrs.c	5 May 2012 03:05:25 -0000	1.15
+++ bfd/elf-attrs.c	7 Feb 2013 03:32:24 -0000
@@ -347,6 +347,10 @@ _bfd_elf_copy_obj_attributes (bfd *ibfd,
   int i;
   int vendor;
 
+  if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
+      || bfd_get_flavour (obfd) != bfd_target_elf_flavour)
+    return;
+
   for (vendor = OBJ_ATTR_FIRST; vendor <= OBJ_ATTR_LAST; vendor++)
     {
       in_attr

-- 
Alan Modra
Australia Development Lab, IBM


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