This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Fix ld/13233 --gc-sections discards .debug_types
- From: Alan Modra <amodra at gmail dot com>
- To: binutils at sourceware dot org
- Date: Thu, 29 Sep 2011 15:13:06 +0930
- Subject: Fix ld/13233 --gc-sections discards .debug_types
- References: <bug-13233-3@http.sourceware.org/bugzilla/> <bug-13233-3-aKJKOD5k52@http.sourceware.org/bugzilla/>
Applied mainline and branch.
PR ld/13233
* elflink.c (_bfd_elf_gc_mark_extra_sections): Mark single member
debug and special section groups.
Index: bfd/elflink.c
===================================================================
RCS file: /cvs/src/src/bfd/elflink.c,v
retrieving revision 1.420
diff -u -p -r1.420 elflink.c
--- bfd/elflink.c 16 Sep 2011 01:17:16 -0000 1.420
+++ bfd/elflink.c 29 Sep 2011 01:10:38 -0000
@@ -11667,9 +11667,10 @@ _bfd_elf_gc_mark_extra_sections (struct
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;
--
Alan Modra
Australia Development Lab, IBM