This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Garbage collecting debug sections
- From: Senthil Kumar Selvaraj <senthil_kumar dot selvaraj at atmel dot com>
- To: <binutils at sourceware dot org>
- Cc: <nickc at redhat dot com>, <amodra at gmail dot com>
- Date: Mon, 23 Mar 2015 19:34:15 +0530
- Subject: Garbage collecting debug sections
- Authentication-results: sourceware.org; auth=none
Hi,
I noticed that _bfd_elf_gc_mark_extra_sections (in bfd/elflink.c)
attempts to unmark related debug sections when it finds an unmarked
code section. When it finds .text.foo is unmarked, for example, it removes
.debug_line.text.foo as well (using the section name as a suffix match
check).
However, it bails out after finding one such section (see attached
patch). Is this intentional?
I'm working on a gcc patch to make the compiler emit debug
information on a more granular basis (by function), and I was hoping to use
this name based removal for garbage collecting debug information along
with the code for the function. I'm also playing around with section groups,
but that's turning out to be bit tricky to implement.
Regards
Senthil
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 94ab762..037c6da 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -11873,7 +11873,6 @@ _bfd_elf_gc_mark_extra_sections (struct bfd_link_info *info,
isec->name, ilen) == 0)
{
dsec->gc_mark = 0;
- break;
}
}
}