aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2008-09-28 13:29:18 +0000
committerAlan Modra <amodra@gmail.com>2008-09-28 13:29:18 +0000
commit119f42450026294aa95b7dff3fe48bf76102602f (patch)
treee28081b0c65193faef2af72bf74c0c950316380f
parent1a6f01b5dc7cd231df50ea282519eb7031142475 (diff)
downloadgdb-119f42450026294aa95b7dff3fe48bf76102602f.zip
gdb-119f42450026294aa95b7dff3fe48bf76102602f.tar.gz
gdb-119f42450026294aa95b7dff3fe48bf76102602f.tar.bz2
* objcopy.c (setup_section): Set elf_group_id.
-rw-r--r--binutils/ChangeLog4
-rw-r--r--binutils/objcopy.c19
2 files changed, 16 insertions, 7 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index ab1d8f3..fa5aea4 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -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.
diff --git a/binutils/objcopy.c b/binutils/objcopy.c
index deff169..f8c1732 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;