summaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2011-09-29 05:40:21 +0000
committerAlan Modra <amodra@bigpond.net.au>2011-09-29 05:40:21 +0000
commit4170953e718f82e490bd91e9d63482751dd3f138 (patch)
treebb9442673ac34851df66e9a69c5ec63f8be18858 /bfd
parent77ad24042504627c2c9a49eae86fef3045591689 (diff)
downloadgdb-4170953e718f82e490bd91e9d63482751dd3f138.tar.gz
PR ld/13233
* elflink.c (_bfd_elf_gc_mark_extra_sections): Mark single member debug and special section groups.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elflink.c5
2 files changed, 9 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index d34193192a2..011e33cf5db 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2011-09-29 Alan Modra <amodra@gmail.com>
+
+ PR ld/13233
+ * elflink.c (_bfd_elf_gc_mark_extra_sections): Mark single member
+ debug and special section groups.
+
2011-09-27 Kai Tietz <ktietz@redhat.com>
* coffcode.h (sec_to_styp_flags): Handle
diff --git a/bfd/elflink.c b/bfd/elflink.c
index a15ad27bac5..5d181f7993c 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -11668,9 +11668,10 @@ _bfd_elf_gc_mark_extra_sections (struct bfd_link_info *info,
continue;
/* Keep debug and special sections like .comment when they are
- not part of a group. */
+ not part of a group, or when we have single-member groups. */
for (isec = ibfd->sections; isec != NULL; isec = isec->next)
- if (elf_next_in_group (isec) == NULL
+ if ((elf_next_in_group (isec) == NULL
+ || elf_next_in_group (isec) == isec)
&& ((isec->flags & SEC_DEBUGGING) != 0
|| (isec->flags & (SEC_ALLOC | SEC_LOAD | SEC_RELOC)) == 0))
isec->gc_mark = 1;