Garbage collecting debug sections
Senthil Kumar Selvaraj
senthil_kumar.selvaraj@atmel.com
Mon Mar 23 14:03:00 GMT 2015
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;
}
}
}
More information about the Binutils
mailing list