* objcopy.c (set_long_section_mode): Check input_bfd is coff
authorAlan Modra <amodra@gmail.com>
Tue, 12 May 2009 09:07:37 +0000 (09:07 +0000)
committerAlan Modra <amodra@gmail.com>
Tue, 12 May 2009 09:07:37 +0000 (09:07 +0000)
before accessing coff specific fields of bfd.

binutils/ChangeLog
binutils/objcopy.c

index d9c672ace105b9196a14d96d02b858563d3b5501..c5c36bb935d2e8373df8b1d45ad38351ae7c9feb 100644 (file)
@@ -1,3 +1,8 @@
+2009-05-12  Alan Modra  <amodra@bigpond.net.au>
+
+       * objcopy.c (set_long_section_mode): Check input_bfd is coff
+       before accessing coff specific fields of bfd.
+
 2009-05-09  Dave Korn  <dave.korn.cygwin@gmail.com>
 
        * MAINTAINERS:  Add myself as PE/COFF co-maintainer.
index 7ef95c52c16c34919f180891b5def0b31279abc8..83d9e1b2aace81bc1e76e13bd601339f6b388baf 100644 (file)
@@ -2143,7 +2143,8 @@ set_long_section_mode (bfd *output_bfd, bfd *input_bfd, enum long_section_name_h
   /* This is only relevant to Coff targets.  */
   if (bfd_get_flavour (output_bfd) == bfd_target_coff_flavour)
     {
-      if (style == KEEP)
+      if (style == KEEP
+         && bfd_get_flavour (input_bfd) == bfd_target_coff_flavour)
        style = bfd_coff_long_section_names (input_bfd) ? ENABLE : DISABLE;
       bfd_coff_set_long_section_names (output_bfd, style != DISABLE);
     }