* objcopy.c (setup_section): Set elf_group_id.
authorAlan Modra <amodra@gmail.com>
Sun, 28 Sep 2008 13:29:18 +0000 (13:29 +0000)
committerAlan Modra <amodra@gmail.com>
Sun, 28 Sep 2008 13:29:18 +0000 (13:29 +0000)
binutils/ChangeLog
binutils/objcopy.c

index ab1d8f3f0b5281e4abd9d6f34d2e4f5f336d8b7c..fa5aea4114d2787acb8365499ace1c876a2928bc 100644 (file)
@@ -1,3 +1,7 @@
+2008-09-28  Alan Modra  <amodra@bigpond.net.au>
+
+       * objcopy.c (setup_section): Set elf_group_id.
+
 2008-09-24  Richard Henderson  <rth@redhat.com>
 
        * dwarf.c (size_of_encoded_value, get_encoded_value): Move up.
index deff1697e9b221de9009a21727dec2770d0a3218..f8c1732fb2cd07a5dca0a9ea277a46639feb7149 100644 (file)
@@ -2344,6 +2344,18 @@ setup_section (bfd *ibfd, sec_ptr isection, void *obfdarg)
   if (extract_symbol)
     return;
 
+  if ((isection->flags & SEC_GROUP) != 0)
+    {
+      asymbol *gsym = group_signature (isection);
+
+      if (gsym != NULL)
+       {
+         gsym->flags |= BSF_KEEP;
+         if (ibfd->xvec->flavour == bfd_target_elf_flavour)
+           elf_group_id (isection) = gsym;
+       }
+    }
+
   /* Allow the BFD backend to copy any private data it understands
      from the input section to the output section.  */
   if (!bfd_copy_private_section_data (ibfd, isection, obfd, osection))
@@ -2351,13 +2363,6 @@ setup_section (bfd *ibfd, sec_ptr isection, void *obfdarg)
       err = _("failed to copy private data");
       goto loser;
     }
-  else if ((isection->flags & SEC_GROUP) != 0)
-    {
-      asymbol *gsym = group_signature (isection);
-
-      if (gsym != NULL)
-       gsym->flags |= BSF_KEEP;
-    }
 
   /* All went well.  */
   return;