summaryrefslogtreecommitdiff
path: root/binutils/objcopy.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2008-09-28 13:29:18 +0000
committerAlan Modra <amodra@bigpond.net.au>2008-09-28 13:29:18 +0000
commit81d402ca4dc3bb40502f9f54b584cffcc2af5032 (patch)
tree686ad3038a0b93d017391b639a4d4fa4b83f9a54 /binutils/objcopy.c
parentb4111137e2a189460c93f9564a245571513a32f3 (diff)
downloadbinutils-redhat-81d402ca4dc3bb40502f9f54b584cffcc2af5032.tar.gz
* objcopy.c (setup_section): Set elf_group_id.
Diffstat (limited to 'binutils/objcopy.c')
-rw-r--r--binutils/objcopy.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/binutils/objcopy.c b/binutils/objcopy.c
index deff1697e9..f8c1732fb2 100644
--- a/binutils/objcopy.c
+++ b/binutils/objcopy.c
@@ -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;